SETFILETYPE
Section: System Calls (2)
Updated: January 18, 1989
Index
Return to Main Contents
NAME
setfiletype - change advisory file type of file
SYNOPSIS
setfiletype(path, type)
char *path;
int type;
DESCRIPTION
The file whose name
is given by path
has its type changed to
type.
Types are defined in
<fs.h>.
-
FS_USER_TYPE_UNDEFINED 0 no type set
FS_USER_TYPE_TMP 1 temporary file
FS_USER_TYPE_SWAP 2 swap file
FS_USER_TYPE_OBJECT 3 object file
FS_USER_TYPE_BINARY 4 executable
FS_USER_TYPE_OTHER 5 file that doesn't correspond to any specific type
The advisory file type is used by the system for statistics gathering. At
some point in the future, it may be used for performance enhancements
as well: for example, varying the amount of time allowed before
flushing a file to disk,
depending on the importance of not losing data from it.
Only the owner of a file (or the super-user) may change its type.
RETURN VALUE
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and
errno
is set to indicate the error.
ERRORS
Setfiletype
will fail and the file type will be unchanged if:
- [ENOTDIR]
-
A component of the path prefix is not a directory.
- [EINVAL]
-
The pathname contains a character with the high-order bit set.
- [ENAMETOOLONG]
-
A component of a pathname exceeded 255 characters,
or an entire path name exceeded 1023 characters.
- [ENOENT]
-
The named file does not exist.
- [EACCES]
-
Search permission is denied for a component of the path prefix.
- [ELOOP]
-
Too many symbolic links were encountered in translating the pathname.
- [EPERM]
-
The effective user ID does not match the owner of the file and
the effective user ID is not the super-user.
- [EROFS]
-
The named file resides on a read-only file system.
- [EFAULT]
-
Path
points outside the process's allocated address space.
- [EIO]
-
An I/O error occurred while reading from or writing to the file system.
SEE ALSO
chown(2), stat(2)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- ERRORS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 22:47:22 GMT, December 11, 2024