Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
chdir(2) OSS System Calls Reference Manual
NAME
chdir - Changes the current working directory
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series and J-series native Guardian processes: implicit libraries
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <unistd.h>
int chdir(
const char *path);
PARAMETERS
path Points to the pathname of the directory.
DESCRIPTION
The chdir( ) function changes the current working directory to the directory indicated by the path
parameter. If the path parameter refers to a symbolic link, the chdir( ) function sets the current
directory to the directory pointed to by the symbolic link.
The current working directory is the starting point for searches for pathnames that do not begin
with a / (slash). For a directory to become the current working directory, the calling process must
have search (execute) access to the directory.
Accessing Files in Restricted-Access Filesets
When accessing a file in a restricted-access fileset, the super ID (255,255 in the Guardian
environment, 65535 in the OSS environment) is restricted by the same file permissions and
owner privileges as any other user ID: It has no special privileges unless the executable file
started by the super ID has the PRIVSETID file privilege. In this case, the process started by the
super ID can switch to another ID and then access files in restricted-access filesets as that ID.
Processes that are started by a member of the Safeguard SECURITY-OSS-ADMINISTRATOR
(SOA) group have the appropriate privilege to use this function on any file in a restricted-access
fileset. However, Network File System (NFS) clients are not granted SOA group privileges, even
if these clients are accessing the system with a user ID that is a member of the SOA security
group.
For more information about restricted-access filesets and file privileges, see the Open System Ser-
vices Management and Operations Guide.
Use on Guardian Objects
Guardian process names are directories; however, they cannot be opened using chdir( ).
Attempts to do so fail and set errno to the value [EPERM].
A call to the chdir( ) function with a path parameter that points to a subprocess in the Guardian
file system fails when the process is not of subtype 30. Such a call sets errno to the value
[ENOENT].
A call to the chdir( ) function with a path parameter that points to an empty Guardian disk subvo-
lume (for example, /G/vol/subvol) succeeds.
A call to the chdir( ) function with a path parameter that points to a Guardian subvolume with a
reserved name (for example, /G/vol1/zyq00001) fails. Such a call sets errno to the value
[EPERM].
1−18 Hewlett-Packard Company 527186-023