Ticket #19052: foo.c
File foo.c, 452 bytes (added by , 2 months ago) |
---|
Line | |
---|---|
1 | #include <errno.h> |
2 | #include <sys/stat.h> |
3 | #include <stdio.h> |
4 | #include <string.h> |
5 | #include <assert.h> |
6 | |
7 | int |
8 | main () |
9 | { |
10 | { |
11 | errno = 0; |
12 | int ret = fchmodat (-1, "foo", 0700, 0); |
13 | |
14 | if (ret >= 0) |
15 | printf ("ret = %d\n", ret); |
16 | else if (errno == EBADF) |
17 | printf ("ret = %d, errno == EBADF\n", ret); |
18 | else |
19 | printf ("ret = %d, errno == %s\n", ret, strerror (errno)); |
20 | |
21 | assert (ret < 0 && errno == EBADF); |
22 | } |
23 | |
24 | printf ("OK\n"); |
25 | } |