Index of Section 2 Manual Pages
| Interix / SUA | renamewtmpx.2 | Interix / SUA |
renamewtmpx(2) renamewtmpx(2)
renamewtmpx()
NAME
renamewtmpx(), wcs_renamewtmpx() - rename current wtmpx file and start new
one
SYNOPSIS
#include
int renamewtmpx (const char *newname)
int wcs_renamewtmpx (const wchar_t *newname)
DESCRIPTION
The renamewtmpx(2) and wcs_renamewtmpx(2) functions are identical, except
that wcs_renamewtmpx(2) accepts wide characters in the newname argument.
The renamewtmpx(2) and wcs_renamewtmpx(2) functions rename the file /var/
adm/wtmpx to newname.
This ensures that the current wtmpx file is renamed and that a new wtmpx
file is started in its place, and that no data is lost during the renaming
process.
Failure to use this interface means that data continues to be sent to the
original file, even under a new name.
RETURN VALUES
The renamewtmpx(2) or wcs_renamewtmpx(2) function returns 0 on success; on
failure, it returns -1 and sets the global variable errno.
ERRORS
[EACCES]
A component of either path prefix denies search permission.
[EACCES]
The requested link requires writing in a directory with a mode that
denies write permission.
[EEXIST]
The file newname already exists.
[EFAULT]
Newname points outside the process's allocated address space.
[EINVAL]
Either pathname contains a character with the high-order bit set, or
the device holding one or both of the files does not permit the
operation.
[EIO]
An I/O error occurred while making or updating a directory entry.
[ENAMETOOLONG]
The newname exceeds {NAME_MAX} characters.
[ENOENT]
A path prefix of newname does not exist.
[ENOSPC]
The directory in which the entry for the new name is being placed
cannot be extended because there is no space left on the file system
containing the directory.
[ENOTDIR]
A component of newname's path prefix is not a directory.
[EPERM]
The newname file exists, the directory containing newname is marked
sticky, and neither the containing directory nor newname are owned by
the effective user ID.
[EROFS]
The requested link requires writing in a directory on a read-only file
system.
[EXDEV]
The file cannot be moved or renamed to different file system (for
example, /dev/fs/C/dog to /dev/fs/D/dog).
SEE ALSO
mvwtmpx(1)
rename(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.