/* See LICENSE file for copyright and license details. */ #include #include #include #include "util.h" int main(void) { char *buf, *p; long pathsize; pathsize = pathconf(".", _PC_PATH_MAX); if (pathsize < 0) pathsize = BUFSIZ; buf = malloc(pathsize); if (!buf) eprintf("malloc:"); p = getcwd(buf, pathsize); if (!p) eprintf("getcwd:"); printf("%s\n", p); return EXIT_SUCCESS; }