[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

getwd Subroutine

Purpose

Gets current directory path name.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>

char *getwd (PathName)
char *PathName;

Description

The getwd subroutine determines the absolute path name of the current directory, then copies that path name into the area pointed to by the PathName parameter.

The maximum path-name length, in characters, is set by the PATH_MAX value, as specified in the limits.h file.

Parameters

PathName Points to the full path name.

Return Values

If the call to the getwd subroutine is successful, a pointer to the absolute path name of the current directory is returned. If an error occurs, the getwd subroutine returns a null value and places an error message in the PathName parameter.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The getcwd subroutine.

Files, Directories, and File Systems for Programmers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]