how could I get process working directory

how could I use c program to get HP UX process working directory

#include <stdio.h>

int main()
{
system("pwd");

    return 0;

}