Page 866
SEE ALSO stat(2) Linux 0.99.11, 24 July 1993 stimestimeSet time SYPNOSIS #include <time.h> int stime(time_t *t); DESCRIPTION stime sets the system's idea of the time and date. time, pointed to by t, is measured in seconds from 00:00:00 GMT January 1, 1970. stime() may only be executed by the superuser. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS
CONFORMS TO SVID, AT&T, X/OPEN SEE ALSO date(1) Linux 0.99.11, 24 July 1993 swapon, swapoffswapon, swapoffStart/stop swapping to file/device SYPNOSIS #include <unistd.h> #include <linux/swap.h> int swapon(const char *path, int swapflags); int swapoff(const char *path); Page 867 DESCRIPTION swapon sets the swap area to the file or block device specified by path. swapoff stops swapping to the file or block device specified by path. swapon takes a swapflags argument. If swapflags has the SWAP_FLAG_PREFER bit turned on, the new swap area will have a higher priority than default. The priority is encoded as (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK. These functions may only be used by the superuser. Priority Each swap area has a priority, either high or low. The default priority is low. Within the low-priority areas, newer areas are of even lower priority than older areas. All priorities set with swapflags are high priority, higher than the default. They may have any non-negative value chosen by the caller. Higher numbers mean higher priority. Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and that is the highest priority available, pages are allocated on a round-robin basis between them. As of Linux 1.3.6, the kernel usually follows these rules, but there are exceptions. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS Many other errors besides the following can occur if path is not valid:
CONFORMS TO These functions are Linux specific. NOTES The partition or path must be prepared with mkswap(8). HISTORY The second (swapflags) argument was introduced in Linux 1.3.2. SEE ALSO mkswap(8), swapon(8), swapoff(8) Linux 1.3.6, 22 July 1995 symlinksymlinkMakes a new name for a file Page 868 SYPNOSIS #include <unistd.h> int symlink(const char *oldpath, const char *newpath); DESCRIPTION symlink creates a symbolic link named oldpath that contains newpath. Symbolic links are interpreted at runtime, as if the contents of the link were substituted into the path being followed to find a file or directory. Symbolic links may contain .. path components that (if used at the start of the link) refer to the parent directories of the one in which the link resides. A symbolic link (also known as a soft link) can point to an existing file or to a nonexistent one; the latter case is known as a dangling link. The permissions of a symbolic link are irrelevant; the ownership is ignored when following the link, but is checked when removal or renaming of the link is requested and the link is in a directory with the sticky bit set. If newpath exists, it will not be overwritten. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS
NOTES No checking of oldpath is done. Deleting the name referred to by a symlink will actually delete the file (unless it also has other hard links). If this behavior is not desired, use link. CONFORMS TO SVID, AT&T, POSIX, BSD 4.3 BUGS See open(2) regarding multiple files with the same name, and NFS. |