FreeBSD regtest: remove test for version 13+ syscalls
[valgrind.git] / memcheck / tests / freebsd / realpathat.c
blob05a20cb924602a55016878888f0e79de0e0e965d
1 #include <stdlib.h>
2 #include <string.h>
3 #include <limits.h>
4 #include <sys/syscall.h>
5 #include <unistd.h>
6 #include <sys/fcntl.h>
8 int main(void)
10 // good
11 char buf[PATH_MAX];
12 char* self_path = "../../tests/freebsd/realpath.c";
13 realpath(self_path, buf);
15 // bad
16 int * bad_int1 = malloc(sizeof(char));
17 int * bad_int2 = malloc(sizeof(char));
18 size_t * bad_sz = malloc(sizeof(char));
19 *bad_int1 = AT_FDCWD;
20 *bad_int2 = 0;
21 *bad_sz = PATH_MAX;
22 syscall(SYS___realpathat, *bad_int1, self_path, buf, *bad_sz, *bad_int2);
23 free(bad_int1);
24 free(bad_int2);
26 // ugly
27 char * bad_buf = malloc(100);
28 char* bad_buf2 = strdup(self_path);
29 free(bad_buf);
30 free(bad_buf2);
31 // fingers crossed
32 realpath(bad_buf2, bad_buf);