Ticket #19053: foo.c

File foo.c, 450 bytes (added by bhaible, 2 weeks ago)

test case foo.c

Line 
1#include <errno.h>
2#include <unistd.h>
3#include <stdio.h>
4#include <string.h>
5#include <assert.h>
6
7int
8main ()
9{
10 {
11 errno = 0;
12 int ret = fchownat (-1, "foo", 0, 0, 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}