summaryrefslogtreecommitdiff
path: root/io/tst-faccessat.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/tst-faccessat.c')
-rw-r--r--io/tst-faccessat.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/io/tst-faccessat.c b/io/tst-faccessat.c
index 48532070a7..ef0470bf2f 100644
--- a/io/tst-faccessat.c
+++ b/io/tst-faccessat.c
@@ -105,7 +105,12 @@ do_test (void)
puts ("faccessat using descriptor for normal file worked");
return 1;
}
- if (errno != ENOTDIR)
+ if (errno == ENOSYS)
+ {
+ puts ("faccessat function not supported");
+ return 0;
+ }
+ else if (errno != ENOTDIR)
{
puts ("\
error for faccessat using descriptor for normal file not ENOTDIR ");
@@ -135,12 +140,13 @@ error for faccessat using descriptor for normal file not ENOTDIR ");
result = 1;
}
- if (fchmodat (dir_fd, "some-file", 0400, 0) != 0)
+ if (fchmodat (dir_fd, "some-file", 0400, 0) != 0 && errno != ENOSYS)
{
printf ("fchownat failed: %m\n");
return 1;
}
-
+ else if (errno != ENOSYS)
+ {
if (faccessat (dir_fd, "some-file", R_OK, AT_EACCESS))
{
printf ("faccessat R_OK: %m\n");
@@ -154,6 +160,7 @@ error for faccessat using descriptor for normal file not ENOTDIR ");
printf ("faccessat W_OK on unwritable file: %m\n");
result = 1;
}
+ }
/* Create a file descriptor which is closed again right away. */
int dir_fd2 = dup (dir_fd);