Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getcwd(3) — Ultrix-32 3.1D RISC

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pwd(1)

malloc(3)

popen(3)

getcwd(3)

NAME

getcwd − get pathname of working directory

SYNTAX

char ∗getcwd (buf, size)
char ∗buf;
int size;

DESCRIPTION

The getcwd subroutine returns a pointer to the current directory pathname. The value of size must be at least two greater than the length of the pathname to be returned. 

If buf is a NULL pointer, getcwd will obtain size bytes of space using malloc(.). In this case, the pointer returned by getcwd may be used as the argument in a subsequent call to free. 

RETURN VALUE

Returns NULL with errno set if size is not large enough, or if an error occurs in a lower-level function. 

SEE ALSO

pwd(1), malloc(3), popen(3)

Subroutines

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026