specs: elide linkat tests with AT_SYMLINK_FOLLOW if necessary.
On my Mac, running OS X 10.10, and using a local HFS+ volume, calling
linkat without AT_SYMLINK_FOLLOW returns ENOTSUPP.
* specs/posix_unistd_spec.yaml (linkat): If such a call returns
non-zero, skip the examples that would always fail.
@@ -273,9 +273,10 @@ specify posix.unistd:
expect (st_after.st_nlink).to_be(st_link.st_nlink)
expect (S_ISREG (st_link.st_mode)).not_to_be(0)
- it creates hard link to file symbolic link:
+ # linkat without AT_SYMLINK_FOLLOW returns ENOTSUPP on some filesystems
link (dir .. "/file", dir .. "/soft", true)
st_before = lstat (dir .. "/file")
- linkat (dirfd, "soft", dirfd, "hard", 0)
+ if linkat (dirfd, "soft", dirfd, "hard", 0) == 0 then
st_after = lstat (dir .. "/file")
st_hard = lstat (dir .. "/hard")
st_soft = lstat (dir .. "/soft")
@@ -283,6 +284,7 @@ specify posix.unistd:
expect (st_soft.st_nlink).to_be(st_hard.st_nlink)
expect (S_ISREG (st_hard.st_mode)).to_be(0)
expect (S_ISLNK (st_hard.st_mode)).not_to_be(0)
+ end
- it creates hard link to file referenced by symbolic link:
link (dir .. "/file", dir .. "/soft", true)
st_before = lstat (dir .. "/file")
