Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (r) rename_oss(2)
If the from and to parameters specify directories, the following requirements exist:
The directory specified by the from parameter must not be an ancestor of the directory
specified by the to parameter. For example, the to pathname must not contain a path-
name prefix that specifies from.
The directory specified by the to parameter must be empty, except for the . (dot) and ..
(dot-dot) entries.
Upon successful completion (where a rename occurs), the function marks the st_ctime and
st_mtime fields of the parent directory of each file for update.
Accessing Files in Restricted-Access Filesets
When accessing a file in a restricted-access leset, 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 les in restricted-access lesets as that ID.
Executable files that have the PRIVSOARFOPEN privilege and 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 leset. However, Network File System
(NFS) clients are not granted SOA group privileges, even if these clients are accessing the sys-
tem with a user ID that is a member of the SOA security group.
For more information about restricted-access lesets and file privileges, see the Open System Ser-
vices Management and Operations Guide.
Use on Guardian Objects
The OSS rename() function can be used on Guardian files (that is, files within /G). The OSS
rename() function cannot be used on directories within /G. The new pathname must correspond
to a Guardian permanent disk file name on the same volume, and the caller must have Guardian
write access to the file.
A call to rename a file in /G is implemented as the following sequence of Guardian procedure
calls:
FILE_OPEN_ with read access and shared exclusion
FILE_RENAME_
FILE_CLOSE_
Use From the Guardian Environment
The OSS rename() function belongs to a set of functions that have the following effects when
the first of them is called from the Guardian environment:
Two Guardian file-system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
The use of static memory by the process increases slightly.
These effects occur only when the first of the set of functions is called. The effects are not cumu-
lative.
527186-023 Hewlett-Packard Company 647