[PATCH] Three patches for std::experimental::filesystem

Jonathan Wakely jwakely@redhat.com
Sat Oct 22 11:47:00 GMT 2016


On 21/10/16 18:01 +0100, Jonathan Wakely wrote:
>    LWG2720 implement filesystem::perms::symlink_nofollow
>    
>    	* include/experimental/bits/fs_fwd.h (perms::resolve_symlinks):
>    	Replace with symlink_nofollow (LWG 2720).
>    	* src/filesystem/ops.cc (permissions(const path&, perms, error_code&)):
>    	Handle symlink_nofollow.
>    	* testsuite/experimental/filesystem/operations/create_symlink.cc: New
>    	test.
>    	* testsuite/experimental/filesystem/operations/permissions.cc: Test
>    	overload taking error_code.

GNU libc doesn't implement AT_SYMLINK_NOFOLLOW so fchmodat always
returns EOPNOTSUPP even if it's used for non-symlinks.

This patch makes us ignore symlink_nofollow if the file isn't a
symlink, so we don't get an error unless we're actually trying to
change a symlink's permissions.

Tested x86_64-linux, committed to trunk.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3170 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161022/0f23d832/attachment.bin>


More information about the Gcc-patches mailing list