Page 879 CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 SEE ALSO time(1), getrusage(2), wait(2) Linux 0.99.11, 24 July 1993 truncate, ftruncatetruncate, ftruncateTruncate a file to a specified length SYPNOSIS #include <unistd.h> int truncate(const char *path, size_t length); int ftruncate(int fd, size_t length); DESCRIPTION truncate causes the file named by path or referenced by fd to be truncated to at most length bytes in size. If the file previously was larger than this size, the extra data is lost. With ftruncate, the file must be open for writing. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS The errors for truncate are
HISTORY These function calls appeared in BSD 4.2. Page 880 BUGS These calls should be generalized to allow ranges of bytes in a file to be discarded. SEE ALSO open(2) BSD Man Page, 24 July 1993 umaskumaskSets a file-creation mask SYPNOSIS #include <sys/stat.h> int umask(int mask); DESCRIPTION umask sets the umask to mask & 0777. RETURN VALUE The previous value of the mask is returned. CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 SEE ALSO creat(2), open(2) Linux 24 July 93 unameunameGets name and information about the current kernel SYPNOSIS #include <sys/utsname.h> int uname(struct utsname *buf); DESCRIPTION uname returns system information in buf. The utsname struct is as defined in /usr/include/sys/utsname.h: struct utsname { char sysname[65]; char nodename[65]; char release[65]; char version[65]; char machine[65]; char domainname[65]; }; RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. Page 881 ERRORS
CONFORMS TO SVID, AT&T, POSIX, X/OPEN SEE ALSO uname(1), getdomainname(2), gethostname(2) Linux 0.99.11 24 July 93 nonenoneUndocumented system calls SYPNOSIS Undocumented system calls. DESCRIPTION As of Linux 1.3.88, there are 163 system calls listed in /usr/include/asm/unistd.h. This man page mentions those calls that are implemented in the kernel but not yet documented in man pages. Some of these calls do not yet have prototypes in the libc include files. SOLICITATION If you have information about these system calls, please look in the kernel source code, write a man page (using a style similar to that of the other Linux section 2 man pages), and send it to aeb@cwi.nl for inclusion in the next man page release from the Linux Documentation Project. STATUS Undocumented are msync, readv, writev, getsid, fdatasync, sysctl, sched_setparam, sched_getparam, sched_setscheduler, sched_getscheduler, sched_yield, sched_get_priority_max, sched_get_priority_min, sched_rr_get_interval. SEE ALSO obsolete(2), unimplemented(2) Linux 1.3.86 12 April 1996 afs_syscall, break, gtty, lock, mpx, prof, quotactl, stty, ustatafs_syscall, break, gtty, lock, mpx, prof, quotactl, stty, ustatUnimplemented system calls SYPNOSIS Unimplemented system calls. DESCRIPTION These system calls are not implemented in the Linux 1.2.4 kernel. RETURN VALUE These system calls always return _1 and set errno to ENOSYS. Page 882 SEE ALSO obsolete(2), undocumented(2) Linux 1.2.4, 15 April 1995 unlinkunlinkDeletes a name and possibly the file it refers to SYPNOSIS #include <unistd.h> int unlink(const char *pathname); DESCRIPTION unlink deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted, and the space it was using is made available for reuse. If the name was the last link to a file but any processes still have the file open, the file will remain in existence until the last file descriptor referring to it is closed. If the name referred to a symbolic link, the link is removed. If the name referred to a socket, fifo, or device, the name for it is removed but processes that have the object open can continue to use it. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS
CONFORMS TO SVID, AT&T, POSIX, X/OPEN, BSD 4.3 BUGS Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files that are still being used. SEE ALSO link(2), rename(2), open(2), rmdir(2), mknod(2), mkfifo(3), remove(3), rm(1), unlink(8). Linux, 24 July 1993 Page 883 uselibuselibSelects shared library SYPNOSIS #include <unistd.h> int uselib(const char *library); DESCRIPTION uselib selects the shared library binary that will be used by this process. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS In addition to all the error codes returned by open(2) and mmap(2), the following may also be returned:
CONFORMS TO uselib() is Linux specific. SEE ALSO open(2), mmap(2), ldd(1), gcc(1), ar(1), ld(1) Linux 0.99.11, 24 July 1993 ustatustatGets filesystem statistics SYPNOSIS #include <sys/types.h> int ustat(dev_t dev, struct ustat * ubuf); DESCRIPTION ustat returns information about a mounted filesystem. dev is a device number identifying a device containing a mounted filesystem. ubuf is a pointer to a ustat structure that contains the following members: daddr_t f_tfree; /* Total free blocks */ ino_t f_tinode; /* Number of free inodes */ char f_fname[6]; /* Filsys name */ char f_fpack[6]; /* Filsys pack name */ The last two fields, f_fname and f_fpack, are not implemented and will always be filled with null characters. RETURN VALUE On success, 0 is returned, and the ustat structure pointed to by ubuf will be filled in. On error, _1 is returned, and errno is set appropriately. Page 884 ERRORS
NOTES ustat has been provided for compatibility only. All new programs should use statfs(2) instead. HISTORY ustat was first implemented in Linux 1.3.16. All versions of Linux before 1.3.16 will return ENOSYS. CONFORMS TO System V SEE ALSO statfs(2), stat(2) Linux 1.3.16, 9 August 1995 utime, utimesutime, utimesChange access and/or modification times of an inode SYPNOSIS #include <sys/types.h> #include <utime.h> int utime(const char *filename, struct utimbuf *buf); #include <sys/time.h> int utimes(char *filename, struct timeval *tvp); DESCRIPTION utime changes the access and modification times of the inode specified by filename to the actime and modtime fields of buf, respectively. If buf is NULL, the access and modification times of the file are set to the current time. The utimbuf structure is struct utimbuf { time_t actime; /* access time */ time_t modtime; /* modification time */ }; In the Linux DLL 4.4.1 libraries, utimes is just a wrapper for utime, tvp[0].tv_sec is actime, and tvp[1].tv_sec is modtime. The timeval structure is struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. |