Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / freebsd / access.c
blob69e5a36da5aa0abe47f03df1704979a10d42fdef
1 /*
2 * Tests for various access functions
4 * access
5 * eaccess
6 * accessat
7 */
10 #include <unistd.h>
11 #include <stdio.h>
12 #include <fcntl.h>
13 #include <string.h>
14 #include <stdlib.h>
16 int main()
18 if (-1 == access("access.c", R_OK))
20 perror("access failed:");
23 if (-1 == eaccess("access.c", F_OK))
25 perror("eaccess failed:");
28 if (-1 == faccessat(AT_FDCWD, "access.c", R_OK, AT_EACCESS))
30 perror("accessat failed:");
33 // error section
34 int badint;
35 char* badstring = strdup("foo");
36 free(badstring);
37 access(badstring, badint);
38 eaccess(badstring, badint);
39 faccessat(badint, badstring, badint, badint);
41 exit(badint);