1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <stdio.h> #include <string.h> #include <unistd.h> int main (int argc, char *argv) { char *cwd = getcwd (NULL, 256); if (cwd == NULL) { fprintf (stderr, "%s: getcwd returns NULL\n", argv[0]); exit (1); } exit (0); }