Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getcwd(3) — OSF/1 X2.0-8 MIPS

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

malloc(3)

getwd(3)

getcwd(3)  —  Subroutines

OSF

NAME

getcwd − Gets the pathname of the current directory

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

char ∗getcwd (
char ∗buffer,
size_t size );

PARAMETERS

bufferPoints to a string space to hold the pathname.  If the buffer parameter is a null pointer, the getcwd() function, using the malloc() function, obtains the number of bytes of free space as specified by the size parameter.  In this case, the pointer returned by the getcwd() function can be used as the parameter in a subsequent call to the free() function. 

sizeSpecifies the length of the string space in bytes.  The value of the size parameter must be at least the length of the pathname to be returned plus one byte for the terminating null. 

DESCRIPTION

The getcwd() function returns a pointer to a string containing the pathname of the current directory.  The getwd function is called to obtain the pathname. 

NOTES

The getcwd() function is supported for multi-threaded applications. 

AES Support Level:
Full use

RETURN VALUES

Upon successful completion, the buffer parameter is returned.  Otherwise, a null value is returned and errno is set to indicate the error. 

ERRORS

If the getcwd() function fails, errno may be set to one of the following values:

[EINVAL]The size parameter is zero. 

[ERANGE]The size parameter is greater than zero, but is smaller than the length of the pathname + 1. 

[ENOMEM]The requested amount of memory could not be allocated. 

RELATED INFORMATION

Functions: malloc(3), getwd(3)

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