Query: getcwd
OS: hpux
Section: 3c
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
getcwd(3C) getcwd(3C)NAMEgetcwd() - get pathname of current working directorySYNOPSISDESCRIPTIONThe function places the absolute pathname of the current working directory in the array pointed to by buf, and returns buf. The value of size must be at least one greater than the length of the pathname to be returned. If buf is a NULL pointer, obtains size bytes of space using (see malloc(3C)). In this case, the pointer returned by can be used as the argument in a subsequent call to (see malloc(3C)). Invoking with buf as a null pointer is not recommended because this functionality may be removed from the HP-UX operating system in a future release.RETURN VALUEUpon successful completion, returns a pointer to the current directory pathname. Otherwise, it returns NULL with set if size is not large enough, or if an error occurs in a lower-level function.ERRORSfails if any of the following conditions are encountered: The size argument is zero. The size argument is greater than zero, but is smaller than the length of the pathname. The length of the specified pathname exceeds bytes, or the length of a component of the pathname exceeds bytes while is in effect. may fail if any of the following conditions are encountered: Read or search permission is denied for a component of pathname. buf points outside the allocated address space of the process. may not always detect this error. failed to provide size bytes of memory.EXAMPLES#include <unistd.h> #include <limits.h> char *cwd; char buf[PATH_MAX+1]; ... if ((cwd = getcwd(buf, PATH_MAX+1)) == NULL) { perror("pwd"); exit(1); } puts(cwd);AUTHORwas developed by AT&T.SEE ALSOpwd(1), malloc(3C), thread_safety(5).STANDARDS CONFORMANCEgetcwd(3C)
Related Man Pages |
---|
getwd(3) - freebsd |
getwd(3) - netbsd |
getcwd(3) - osx |
getwd(3) - osx |
getcwd(3) - freebsd |
Similar Topics in the Unix Linux Community |
---|
getcwd: permission denied error |
getcwd problem. |
#$ -cwd #what does this mean? |
Restrict Max file size |
Getcwd |