UNIX® System V Release 4 Programmer's Reference Manual

UNIX Software Operation

Publisher: Prentice Hall, 1990, 754 pages

ISBN: 0-13-947029-8

Keywords: Programming

Last modified: April 11, 2021, 1:20 p.m.

This manual describes the programming features of the UNIX system. It contains individual manual pages that describe commands, system calls, subroutines, file formats, and other useful topics, such as the ASCII table shown on ascii(5). It provides neither a general overview of the UNIX system nor details of the implementation of the system.

Not all commands, features, and facilities described in this manual are available in every UNIX system. Some of the features require additional utilities that may not exist on your system. The manual is divided into five sections:

  1. Commands
  2. System Calls
  3. Subroutines:
    • 3C. C Programming Language Library Routines
    • 3S. Standard I/O Library Routines
    • 3E. Executable and Linking Format Library Routines
    • 3G. General Purpose Library Routines
    • 3M. Math Library Routines
    • 3X. Specialized Library Routines
  4. File Formats
  5. Miscellaneous Facilities

Section 1 (Commands) describes commands that support C and other program- ming languages.

Section 2 (System Calls) describes the access to the services provided by the UNIX system kernel, including the C language interface.

Section 3 (Subroutines) describes the available general subroutines. In many cases, several related subroutines are described on the same manual page. Their binary versions reside,in various system libraries. See intro(3) for descriptions of these libraries and the files in which they are stored.

Section 4 (File Formats) documents the structure of particular kinds of files; for example, the format of the output of the link editor is given in a.out(4). Excluded are files used by only one command (for example, the assembler's intermediate files, if any). In general, the C language structures corresponding to .these formats can be found in the directories /usr/include and /usr/include/sys.

Section 5 (Miscellaneous Facilities) contains a variety of things. Included are descriptions of character sets, macro packages, etc.

References with numbers other than those above mean that the utility is contained in the appropriate section of another manual. References with (1) following the command mean that the utility is contained in this manual or the User's Reference Manual. In these cases, the SEE ALSO section of the entry in which the reference appears will point you to the correct book.

Each section consists of a number of independent entries of a page or SO each. Entries within each section are alphabetized, with the exception of the introductory entry that begins each section. Some entries may describe several routines, commands, etc. In such cases, the entry appears only once, alphabetized under its "primary" name, the name that appears at the upper corners of each manual page. Subsections 3C and 3S are grouped together because their functions constitute the standard C library.

All entries are based on a common format, not all of whose parts always appear:

  • The NAME part gives the name(s) of the entry and briefly states its purpose.
  • The SYNOPSIS part summarizes the use of the program or function being described. A few conventions are used, particularly in Section 2 (System Calls):
    • Constant width typeface strings are literals and are to be typed just as they appear.
    • Italic strings usually represent substitutable argument prototypes and program names found elsewhere in the manual.
    • Square brackets [] around an argument prototype indicate that the argument is optional. When an argument prototype is given as name or file, it always refers to a file name.
    • Ellipses … are used to show that the previous argument prototype may be repeated.
    • A final convention is used by the commands themselves. An argument beginning with a minus - or plus + sign is often taken to be some sort of flag argument, even if it appears in a position where a file name could appear. Therefore, it is unwise to have files whose names begin with - or +. Programmer's Reference Manual
  • The DESCRIPTION part describes the utility.
  • The EXAMPLE(S) part gives example(s) of usage, where appropriate.
  • The FILES part gives the file names that are built into the program.
  • The SEE ALSO part gives pointers to related information.
  • The DIAGNOSTICS part discusses the diagnostic indications that may be produced. Messages that are intended to be self-explanatory are not listed.
  • The NOTES part gives generally helpful hints about the use of the utility.

A "Table of Contents" and a "Permuted Index" derived from that table precede Section 1. The "Permuted Index" is a list of keywords, given in the second of three columns, together with the context in which each keyword is found. Key- words are either topical keywords or the names of manual entries. Entries are identified with their section numbers shown in parentheses. This is important because there is considerable duplication of names among the sections, arising principally from commands and functions that exist only to exercise a particular system call. The right column lists the name of the manual page on which each keyword may be found. The left column contains useful information about the keyword.

  1. Commands
    • intro(1): introduction to programming commands
    • admin(1): create and administer SCCS files
    • ar(1): maintain portable archive or library
    • as(1): assembler
    • cb(1): C program beautifier
    • cc(1): C compiler
    • cdc(1): change the delta comment of an SCCS delta
    • cflow(1): generate C flowgraph
    • cof2elf(1): eOFF to ELF object file translation
    • comb (1): combine SCCS deltas
    • cscope(1): interactively examine a C program
    • ctrace(1): C program debugger
    • cxref(1): generate C program cross-reference
    • delta(1): make a delta (change) to an SCCS file
    • dis(1): object code disassembler
    • dump(1): dump selected parts of an object file
    • get(1): get a version of an SCCS file
    • help(1): ask for help with message numbers or SCCS commands
    • install(1M): install commands
    • ld(1): link editor for object files
    • ldd(1): list dynamic dependencies
    • lex(1): generate programs for simple lexical tasks
    • lint(1): a C program checker
    • lorder(1): find ordering relation for an object library
    • lprof(1): display line-by-line execution count profile data
    • m4(1): macro processor
    • make(1): maintain, update, and regenerate groups of programs
    • mcs(1): manipulate the comment section of an object fjle
    • nm(1): print name list of an object file
    • prof(1): display profile data
    • prs(1): print an SCCS file
    • regcmp(1): regular expression compile
    • rmdel(1): remove a delta from an SCCS file
    • sact(1): print current SCCS file editing activity
    • sccsdiff(1): compare two versions of an SCCS file
    • sdb(1): symbolic debugger
    • size(1): print section sizes in bytes of object files
    • strip (1): strip symbol table, debugging and line number information from an object file
    • tsort (1): topological sort
    • unget(1): undo a previous get of an SCCS file
    • val(1): validate an SCCS file
    • vc(1): version control
    • what(1): print identification strings
    • yacc(1): yet another compiler-compiler
  2. System Calls
    • intro(2): introduction to system calls and error numbers
    • access(2): determine accessibility of a file
    • acct(2): enable or disable process accounting
    • adjtime(2): correct the time to allow synchronization of the system clock
    • alarm(2): set a process alarm clock
    • brk, sbrk(2): change data segment space allocation
    • chdir, fchdir(2): change working directory
    • chmod, fchmod(2): change mode of file
    • chown, lchown, fchown(2): change owner and group of a file
    • chroot (2): change root directory
    • close(2): close a fue descriptor
    • creat (2): create a new file or rewrite an existing one
    • dup(2): duplicate an open file descriptor
    • exec: execl, execv, execle, execve, execlp, execvp(2): execute a file
    • exit, _exit (2): terminate process
    • fcntl (2): file control
    • fork(2): create a new process
    • fpathconf, pathconf(2): get configurable pathname variables
    • fsync(2): synchronize a file's in-memory state with that on the physical medium
    • getcontext, setcontext(2): get and set current user context
    • getdents(2): read directory entries and put in a file system independent format
    • getgroups, setgroups(2): get or set supplementary group access list IDs
    • getmsg(2): get next message off a stream
    • getpid, getpgrp, getppid, getpgid (2): get process, process group, and parent process IDs getrlimit,
    • setrlimit(2): control maximum system resource consumption
    • getsid (2): get session ID
    • getuid, geteuid, getgid, getegid (2): get real user, effective user, real group, and effective group IDs
    • ioctI (2): control device
    • kill(2): send a signal to a process or a group of processes
    • link(2): link to a file
    • lseek(2): move read/write file pointer
    • memcntl(2): memory management control
    • mincore(2): determine residency of memory pages
    • mkdir(2): make a directory
    • mknod(2): make a directory, or a special or ordinary file
    • mmap(2): map pages of memory
    • mount(2): mount a file system
    • mprotect(2): set protection of memory mapping
    • msgctl(2): message control operations
    • msgget(2): get message queue
    • msgop: msgsnd, msgrcv(2): message operations
    • munmap(2): unmap pages of memory
    • nice(2): change priority of a time-sharing process
    • open(2): open for reading or writing
    • pause(2): suspend process until signal
    • pipe(2): create an interprocess channel
    • plock(2): lock into memory or unlock process, text, or data
    • poll(2): input/output multiplexing
    • priocntl(2): process scheduler control
    • priocntlset(2): generalized process scheduler control
    • profil(2): execution time profile
    • ptrace (2): process trace
    • putmsg(2): send a message on a stream
    • read (2): read from file
    • readlink(2): read the value of a symbolic link
    • rename(2): change the name of a file
    • rmdir(2): remove a directory
    • semctl(2): semaphore control operations
    • semget(2): get set of semaphores
    • semop(2): semaphore operations
    • setpgid(2): set process group ID
    • setpgrp(2): set process group ID
    • setsid (2): set session ID
    • setuid, setgid(2): set user and group IDs
    • shmct1(2): shared memory control operations
    • shmget(2): get shared memory segment identifier
    • shmop: shmat, shmdt(2): shared memory operations
    • sigaction(2): detailed signal management
    • sigaltstack(2): set or get signal alternate stack context
    • signal, sigset, sighold, sigrelse, sigignore, sigpause(2): simplified signal management
    • sigpending(2): examine signals that are blocked and pending
    • sigprocmask(2): change or examine signal mask
    • sigsend, sigsendset(2): send a signal to a process or a group of processes
    • sigsuspend(2): install a signal mask and suspend process until signal
    • stat, lstat, fstat (2): get file status
    • statvfs, fstatvfs(2): get file system information
    • stime(2): set time
    • swapctl(2): manage swap space
    • symlink(2): make a symbolic link to a file
    • sync(2): update super block
    • sys3b(2): machine-specific functions
    • sysfs(2): get file system type information
    • sysinfo(2): get and set system information strings
    • termios: tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, tcgetpgrp, tcsetpgrp, tcgetsid (2): general terminal interface
    • time(2): get time
    • times (2): get process and child process times
    • uadmin(2): administrative control
    • ulimit(2): get and set user limits
    • umask(2): set and get file creation mask
    • umount(2): unmount a file system
    • uname(2): get name of current UNIX system
    • unlink(2): remove directory entry
    • ustat(2): get file system statistics
    • utime(2): set file access and modification times
    • vfork(2): spawn new process in a virtual memory efficient way
    • wait(2): wait for child process to stop or terminate
    • waitid(2): wait for child process to change state
    • waitpid(2): wait for child process to change state
    • write, writev(2): write on a file
  3. Functions
    • intro(3): introduction to functions and libraries
    • a64l, 164a(3C): convert between long integer and base-64 ASCII string
    • abort (3C): generate an abnormal termination signal
    • abs, labs(3C): return integer absolute value
    • addseverity(3C): build a list of severity levels for an application for use with fmtmsg
    • atexit(3C): add program termination routine
    • bsearch(3C): binary search a sorted table
    • catgets(3C): read a program message
    • catopen, catclose(3C): open/close a message catalogue
    • clock(3C): report CPU time used
    • conv: to upper, tolower, _toupper, _tolower, toascii(3C): translate characters
    • crypt, setkey, encrypt (3C): generate encryption
    • ctermid (3S): generate file name for terminal
    • ctime, localtime, gmtime, asctime, tzset(3C): , .. convert date and time to string
    • ctype: isdigit, isxdigit, islower, isupper, isalpha, isalnum, isspace, iscntrl, ispunct, isprint, isgraph, isascii(3C): character handling
    • cuserid (3S): get character login name of the user
    • decconv: _s2dec, _ d2dec, _ dec2s, _ dec2d(3C) .j ..... convert between binary and decimal values
    • difftime(3C): computes the difference between two calendar times
    • directory: opendir, readdir, telldir, seekdir, rewinddir, closedir(3C): directory operations
    • div, ldiv(3C): compute the quotient and remainder
    • drand48, erand48, lrand48, nrand48, mrand48, jiand48, srand48, seed48, lcong48(3C): generate uniformly distributed pseudo-random numbers
    • dup2(3C): duplicate an open file descriptor
    • ecvt, fcvt, gcvt(3C): convert floating-point number to string
    • end, etext, edata(3C): last locations in program
    • fclose, fflush(3S): close or flush a stream
    • ferror, feof, clearerr, fileno(3S): stream status inquiries
    • ffs(3C): find first set bit
    • fmtmsg(3C): display a message ()n stderr or system console
    • fopen, freopen, fdopen(3S): open a stream
    • fpgetround, fpsetround, fpgetmask, fpsetmask, fpgetsticky, fpsetsticky(3C): IEEE floating point environment control
    • fread, fwrite(3S): .............. binary input/output
    • frexp, ldexp, 10gb, modf, modff, nextafter, scalb(3C): manipulate parts of floating-point numbers
    • fseek, rewind, ftell(3S): reposition a file pointer in a stream
    • fsetpos, fgetpos(3C): reposition a file pointer in a stream
    • ftw, nftw(3C): walk a file tree
    • getc, getchar, fgetc, getw(3S): get character or word from a stream
    • getcwd(3C): get path-name ot current working directory
    • getdate(3C): convert user format date and time
    • getenv(3C): return value for environment name
    • getgrent, getgrgid, getgrnam, setgrent, endgrent, fgetgrent(3C): get group file entry
    • getitimer, setitimer(3C): get/set value of interval timer
    • getlogin(3C): get login name
    • getmntent, getmntany(3C): get mnttab file entry
    • getopt(SC): get option letter from argument vector
    • getpass(3C) read a password
    • getpw{3C): get name from UID
    • getpwent, getpwuid, getpwnam, setpwent, endpwent, fgetpwent(3C): manipulate password file entry
    • gets, fgets(3S): get a string from a stream
    • getspent, getspnam, setspent, endspent, fgetspent, lckpwdf, ulckpwdf(3C): manipulate shadow password file entry
    • getsubopt (3C): parse suboptions from a string
    • gettimeofday, settimeofday(3C): get or set the date and time
    • gettxt(3C): retrieve a text string
    • getut: getutent, getutid, getutline, pututline, setutent, endutent, utmpname(3C): access utmp file entry
    • getutx: getutxent, getutxid, getutxline, pututxline, setutxent, endutxent, utmpxname, getutmp, getutmpx, updwtmp, updwtmpx(3C): access utmpx file entry
    • getvfsent, getvfsfile, getvfsspec, getvfsany(3C): get vfstab file entry
    • hseareh, hcreate, hdestroy(3C): manage hash search tables
    • initgroups(3C): initialize the supplementary group access list
    • insque, remque(3C): insert/remove element from a queue
    • isnan, isnand, isnanf, finite, fpclass, unordered (3C): determine type of floating point number
    • 13tol, lto13(3C): convert between 3-byte integers and long integers
    • localeconv(3C): get numeric formatting information
    • lockf(3C): record locking on files
    • lsearch, lfind (3C): linear search and update
    • makecontext, swapcontext(3C): manipulate user contexts
    • makedev, major, minor(3C): manage a device number
    • malloc, free, realloc, calloe, memalign, valloc,(3C): memory allocator
    • mbchar: mbtowc, mblen, wctomb(3C): multibyte character handling
    • mbstring: mbstowcs, wcstornbs(3C): multibyte string functions
    • memory: memccpy, memchr, memcmp, memcpy, memmove, memset(3C): memory operations
    • mkfifo(3C): create a new FIFO
    • mktemp(3C): make a unique file name
    • mktime(3C): converts a tm structure to a calendar time
    • mlock, munlock(3C): lock (or unlock) pages in memory
    • mlockall, munlockall(3C): lock or unlock address space
    • monitor(3C): prepare execution profile
    • msync(3C): synchronize memory with physical storage
    • nl_langinfo(3C): language information
    • offsetof(3C): offset of structure member
    • perror(3C): print system error messages
    • popen, pclose(3S): initiate pipe to/from a process
    • printf, fprintf, sprintf(3S): print formatted output
    • psignal, psiginfo,-system signal messages(3C): psignal, psiginfo,-system signal messages
    • putc, putchar, fputc, putw(3S): put character or word on a stream
    • puts, fputs(3S): put a string on a stream
    • putenv(3C): change or add value to environment
    • putpwent(3C): write password file entry
    • putspent(3C): write shadow password file entry
    • qsort(3C): quicker sort
    • raise(3C): send signal to program
    • rand, srand(3C): simple random-number generator
    • realpath(3C): returns the real file name
    • remove(3C): remove file
    • scanf, fscanf, sscanf(3S): convert formatted input
    • setbuf, setvbuf(3S): assign buffering to a stream
    • setjmp, longjmp(3C): non-local goto
    • setlocale(3C): modify and query a program's locale
    • sigsetjmp, siglongjmp(3C): a non-local goto with signal state
    • sigemptyset, sigfillset, sigaddset, sigdelset, sigismember(3C): manipulate sets of signals
    • sleep(3C): suspend execution for interval
    • ssignal, gsignal(3C): software signals
    • stdipc: ftok(3C): standard interprocess communication package
    • stdio(3S): standard buffered input/output package
    • strcoll (3C): string collation
    • strerror(3C): get error message string
    • strftime, cftime, ascftime,(3C): convert date and time to string
    • string: strcat, strdup, strncat, strcmp, strncmp, strcpy, strncpy, strlen, strchr, strrchr, strpbrk, strspn, strcspn, strtok, strstr(3C): string operations
    • strtod, atof,(3C): convert string to double-precision number
    • strtol, strtoul, at 01, atoi (3C): convert string to integer
    • strxfrm(3C): string transformation
    • swab(3C): swap bytes
    • sysconf(3C): get configurable system variables
    • system (3S): issue a shell command
    • tcsetpgrp(3C): set terminal foreground process group ID
    • tmpfile(3S): create a temporary file
    • tmpnam, tempnam(3S): create a name for a temporary file
    • runcate, ftruncate(3C): set a file to a specified length
    • tsearch, tfind, tdelete, twalk(3C): manage binary search trees
    • ttyname, isatty(3C): find name of a terminal
    • ttyslot(3C): find the slot in the utmp file of the current user
    • ungetc(3S): push character back onto input stream
    • vprintf, vfprintf, vsprintf(3S): print formatted output of a variable argument list
    • elf(3E): object file access library
    • elf_begin(3E): make a file descriptor
    • elf_cntl(3E): control a file descriptor
    • elf_end(3E): finish using an object file
    • elf_errmsg, elf_errno (3E): error handling
    • elf_fill(3E): set fill byte
    • elf_flagdata, elf_flagehdr, elf_flagelf, elf_flagphdr, elf_flagscn, elf_flagshdr(3E): manipulate flags
    • elt_fsize: elf32_fsize(3E): return the size of an object file type
    • elf_getarhdr(3E): retrieve archive member header
    • elf_getarsym(3E): retrieve archive symbol table
    • elf_getbase(3E): get the base offset for an object file
    • elf_getdata, elf_newdata, elf_rawdata(3E): get section data
    • elf_getehdr: elf32_getehdr, elf32_newehdr(3E): retrieve class-dependent object file header
    • elf_getident(3E): retrieve file identification data
    • elf_getphdr: elf32_getphdr, elf32_newphdr(3E): retrieve class-dependent program header table
    • elf_getscn, elf_ndxscn, elf_newscn, elf_nextscn (3E): get section information
    • elf_getshdr: elf32_getshdr (3E): retrieve class-dependent section header
    • elf_hash(3E): compute hash value
    • elf_kind (3E): determine file type
    • elf_next (3E): sequential archive member access
    • elf_rand(3E): random archive member access
    • elf_rawfile(3E): retrieve uninterpreted file contents
    • elf_strptr(3E): make a string pointer
    • elt_update(3E): update an ELF descriptor
    • elf_version(3E): coordinate ELF library and application versions
    • elt_xlate: elf32_xlatetof, elf32_xlatetom (3E): class-dependent data translation
    • nlist(3E): get entries from name list
    • basename(3G): return the last element of a path name
    • bgets(3G): read stream up to next delimiter
    • bufsplit(3G): split buffer into fields
    • copylist (3G): copy a file into memory
    • dirname(3G): report the parent directory name of a file path name
    • gmatch(3G): shell global pattern matching
    • isencrypt(3G): determine whether a character buffer is encrypted
    • mkdirp, rmdirp(3G): create, remove directories in a path
    • p2open, p2close(3G): open, close pipes to and from a command
    • pathfind (3G): search for named file in named directories
    • regcmp, regex(3G): compile and execute regular expression
    • regexpr, compile, step, advance(3G): regular expression compile and match routines
    • str: strfind, strrspn, strtrns(3G): string manipulations
    • strccpy: streadd, strcadd, strecpy(3G): copy strings, compressing or expanding escape codes
    • intro(3M): introduction to math libraries
    • bessel: jO, jl, jn, yO, yl, yn(3M): Bessel functions
    • erf, erfc(3M): error function and complementary error function
    • exp, expf, cbrt, log, logf, log10, log10f, pow, powf, sqrt, sqrtf(3M): exponential, logarithm, power, square root functions
    • floor, floorf, ceil, ceilf, copysign, fmod, fmodf, fabs, fabsf, rint, remainder(3M): floor, ceiling, remainder, absolute value functions
    • gamma, Igamma(3M): log gamma function
    • hypot(3M): Euclidean distance function
    • matherr(3M): error-handling function
    • sinh, sinhf, cosh, coshf, tanh, tanhf, asinh, acosh, atanh(3M): hyperbolic functions
    • trig: sin, sinf, cos, cosf, tan, tanf, asin, asinf, acos, acosf, atan, atanf, atan2, atan2f(3M): trigonometric functions
    • assert (3X): verify program assertion
    • crypt (3X): password and file encryption functions
    • dlclose(3X): close a shared object
    • dlerror(3X): get diagnostic information
    • dlopen(3X): open a shared object
    • dlsym(3X): get the address of a symbol in shared object
    • libwindows(3X): windowing terminal function library
    • maillock(3X): manage lockfile for user's mailbox
    • malloc, free, realloc, calloc, mallopt, mallinfo(3X): memory allocator
    • sputl, sget1(3X): access long integer data in a machine-independent fashion
  4. File Formats
    • intro(4): introduction to file formats
    • a.out(4): ELF (Executable and Linking Format) files
    • ar(4): archive file format
    • core(4): core image file
    • limits(4): header file for implementation-specific constants
    • sccsfile(4): format of sces file
    • strftime(4): language specific strings
    • timezone(4): set default system time zone
    • utmp, wtmp(4): utmp and wtmp entry formats
    • utmpx, wtmpx(4): utmpix and wtmpx entry formats
  5. Miscellaneous Facilities
    • ntro(5): introduction to miscellany
    • ascii(5): map of ASCII character set
    • environ (5): user environment
    • fcntl(5): file control options
    • jagent(5): host control of windowing terminal
    • langinfo(5): language information constants
    • layers(5): protocol used between host and windowing terminal under layers(1)
    • math(5): math functions and constants
    • nl_types(5): native language data types
    • prof(5): profile within a function
    • regexp: compile, step, advance(5): regular expression compile and match routines
    • siginfo(5): signal generation information
    • signal(5): base signals
    • stat(5): data returned by stat system call
    • stdarg(5): handle variable argument list
    • types(5): primitive system data types
    • ucontext (5): user context
    • values(5): machine-dependent values
    • varargs(5): handle variable argument list
    • wstat(5): wait status
    • xtproto(5): multiplexed channels protocol used by xt driver

    Reviews

    UNIX® System V Release 4 Programmer's Reference Manual

    Reviewed by Roland Buresund

    OK ***** (5 out of 10)

    Last modified: May 21, 2007, 2:47 a.m.

    Fullfils its intended purpose.

    Comments

    There are currently no comments

    New Comment

    required

    required (not published)

    optional

    required

    captcha

    required