blob: bcecec7bec851e0744de2d5ec55ca89b7e73cfee [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* vi: set sw=4 ts=4: */
2/*
3 * fork test for uClibc
4 * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org>
5 *
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 */
8
9#include <stdio.h>
10#include <stdlib.h>
11#include <unistd.h>
12
13int main(void)
14{
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;
31}
32
33/*
34Local Variables:
35c-file-style: "linux"
36c-basic-offset: 4
37tab-width: 4
38End:
39*/