linuxthreads: add back signal.h
[uclibc-ng.git] / test / unistd / getcwd.c
blobbcecec7bec851e0744de2d5ec55ca89b7e73cfee
1 /* vi: set sw=4 ts=4: */
2 /*
3 * fork test for uClibc
4 * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org>
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 */
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <unistd.h>
13 int main(void)
15 char *foo;
16 char junk[12];
17 char crap[100];
18 foo = getcwd(NULL, 0);
19 printf("getcwd(NULL, 0)='%s'\n", foo);
20 if (foo) { free(foo); }
21 foo = getcwd(NULL, 100);
22 printf("\ngetcwd(NULL, 100)='%s'\n", foo);
23 if (foo) { free(foo); }
24 foo = getcwd(junk, sizeof(junk));
25 printf("\nchar junk[12];\n");
26 printf("getcwd(junk, sizeof(junk))='%s'\n", foo);
27 foo = getcwd(crap, sizeof(crap));
28 printf("\nchar crap[100];\n");
29 printf("getcwd(crap, sizeof(crap))='%s'\n", foo);
30 return EXIT_SUCCESS;
34 Local Variables:
35 c-file-style: "linux"
36 c-basic-offset: 4
37 tab-width: 4
38 End: