| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /* 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 | |
| 13 | int 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 | /* |
| 34 | Local Variables: |
| 35 | c-file-style: "linux" |
| 36 | c-basic-offset: 4 |
| 37 | tab-width: 4 |
| 38 | End: |
| 39 | */ |