Ticket #19061: foo.c

File foo.c, 448 bytes (added by bhaible, 2 months ago)

test case foo.c

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