Skip to main content

getcwd

Function getcwd 

Source
pub unsafe extern "system" fn getcwd(
    buf: *mut c_char,
    size: c_ulong,
) -> c_int
Expand description

The getcwd() function copies an absolute pathname of the current working directory to the array pointed to by buf, which is of length size.

§RETURN VALUE

On success, these functions return a pointer to a string containing the pathname of the current working directory. In the case of getcwd() and getwd() this is the same value as buf.

On failure, these functions return NULL, and errno is set to indicate the error. The contents of the array pointed to by buf are undefined on error.

Read the docs here