SICStus Prolog caches the name of the current working directory. To
take advantage of the cache and to keep it consistent, foreign code
should call the following interface functions instead of calling
int SP_chdir(const char *path)
pathto become the current working directory. Returns 0 upon successful completion. Otherwise, a value of -1 is returned and
errnois set to indicate the error.
char *SP_getcwd(char *buf, unsigned int size);
NULL, the pathname will be stored in the space pointed to by
sizebytes of space will be obtained using
SP_malloc(). In this case, the pointer returned may be used as the argument in a subsequent call to
sizeis not large enough to store the pathname.