xref: /relibc/tests/stdlib/realpath.c (revision ed19381547d66b76981ea1e4ff942c5a4da45ab7)
1 #include <errno.h>
2 #include <limits.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <string.h>
6 
7 #include "test_helpers.h"
8 
9 int main(void) {
10     char *path_res = realpath("stdlib/realpath.c", NULL);
11     ERROR_IF(realpath, path_res, == NULL);
12     puts(path_res);
13     free(path_res);
14 
15     char path_arg[PATH_MAX] = { 0 };
16     char *res = realpath("stdlib/realpath.c", path_arg);
17     ERROR_IF(realpath, res, == NULL);
18     puts(path_arg);
19 }
20