2 .\" Copyright 1989 AT&T.
3 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH INTRO 2 "Nov 17, 2008"
9 Intro, intro \- introduction to system calls and error numbers
13 \fB#include <errno.h>\fR
19 A system call is a C library function that requests a service from the system,
20 such as getting the time of day. This request is performed in the kernel. The
21 library interface executes a trap into the kernel, which actually executes the
25 Most system calls return one or more error conditions. An error condition is
26 indicated by an otherwise impossible return value. This is almost always
27 \fB\(mi1\fR or the null pointer; the individual descriptions specify the
28 details. An error number is also made available in the external variable
29 \fBerrno\fR, which is not cleared on successful calls, so it should be tested
30 only after an error has been indicated.
33 In the case of multithreaded applications, the \fB-mt\fR option must be
34 specified on the command line at compilation time (see \fBthreads\fR(5)). When
35 the \fB-mt\fR option is specified, \fBerrno\fR becomes a macro that enables
36 each thread to have its own \fBerrno\fR. This \fBerrno\fR macro can be used on
37 either side of the assignment as though it were a variable.
40 An error value listed as "will fail" describes a condition whose detection and
41 reporting is mandatory for an implementation that conforms to the Single UNIX
42 Specification (SUS). An application can rely on this condition being detected
43 and reported. An error value listed as "may fail" describes a condition whose
44 detection and reporting is optional for an implementation that conforms to the
45 SUS. An application should not rely this condition being detected and reported.
46 An application that relies on such behavior cannot be assured to be portable
47 across conforming implementations. If more than one error occurs in processing
48 a function call, any one of the possible errors might may be returned, as the
49 order of detection is undefined. See \fBstandards\fR(5) for additional
50 information regarding the Single UNIX Specification.
53 Each system call description attempts to list all possible error numbers. The
54 following is a complete list of the error numbers and their names as defined in
62 Lacking appropriate privileges
64 Typically this error indicates an attempt to modify a file in some way
65 forbidden except to its owner or an appropriately privileged process. It is
66 also returned for attempts by ordinary users to perform operations allowed only
67 to processes with certain privileges.
69 The manual pages for individual functions document which privileges are needed
70 to override the restriction.
79 No such file or directory
81 A file name is specified and the file should exist but doesn't, or one of the
82 directories in a path name does not exist.
91 No such process, LWP, or thread
93 No process can be found in the system that corresponds to the specified
94 \fBPID,\fR \fBLWPID_t\fR, or \fBthread_t\fR.
103 Interrupted system call
105 An asynchronous signal (such as interrupt or quit), which the user has elected
106 to catch, occurred during a system service function. If execution is resumed
107 after processing the signal, it will appear as if the interrupted function call
108 returned this error condition.
110 In a multithreaded application, \fBEINTR\fR may be returned whenever another
111 thread or \fBLWP\fR calls \fBfork\fR(2).
122 Some physical I/O error has occurred. This error may in some cases occur on a
123 call following the one to which it actually applies.
132 No such device or address
134 I/O on a special file refers to a subdevice which does not exist, or exists
135 beyond the limit of the device. It may also occur when, for example, a tape
136 drive is not on-line or no disk pack is loaded on a drive.
147 An argument list longer than \fBARG_MAX\fR bytes is presented to a member of
148 the \fBexec\fR family of functions (see \fBexec\fR(2)). The argument list limit
149 is the sum of the size of the argument list plus the size of the environment's
150 exported shell variables.
161 A request is made to execute a file which, although it has the appropriate
162 permissions, does not start with a valid format (see \fBa.out\fR(4)).
173 Either a file descriptor refers to no open file, or a \fBread\fR(2)
174 (respectively, \fBwrite\fR(2)) request is made to a file that is open only for
175 writing (respectively, reading).
186 A \fBwait\fR(3C) function call was executed by a process that had no existing
187 or unwaited-for child processes.
196 No more processes, or no more LWPs
198 For example, the \fBfork\fR(2) function failed because the system's process
199 table is full or the user is not allowed to create any more processes, or a
200 call failed because of insufficient memory or swap space.
211 During execution of \fBbrk()\fR or \fBsbrk()\fR (see \fBbrk\fR(2)), or one of
212 the \fBexec\fR family of functions, a program asks for more space than the
213 system is able to supply. This is not a temporary condition; the maximum size
214 is a system parameter. On some architectures, the error may also occur if the
215 arrangement of text, data, and stack segments requires too many segmentation
216 registers, or if there is not enough swap space during the \fBfork\fR(2)
228 An attempt was made to access a file in a way forbidden by the protection
231 The manual pages for individual functions document which privileges are needed
232 to override the protection system.
243 The system encountered a hardware fault in attempting to use an argument of a
244 routine. For example, \fBerrno\fR potentially may be set to \fBEFAULT\fR any
245 time a routine that takes a pointer argument is passed an invalid address, if
246 the system can detect the condition. Because systems will differ in their
247 ability to reliably detect a bad address, on some implementations passing a bad
248 address to a routine will result in undefined behavior.
257 Block device required
259 A non-block device or file was mentioned where a block device was required (for
260 example, in a call to the \fBmount\fR(2) function).
271 An attempt was made to mount a device that was already mounted or an attempt
272 was made to unmount a device on which there is an active file (open file,
273 current directory, mounted-on file, active text segment). It will also occur if
274 an attempt is made to enable accounting when it is already enabled. The device
275 or resource is currently unavailable. \fBEBUSY\fR is also used by mutexes,
276 semaphores, condition variables, and r/w locks, to indicate that a lock is
277 held, and by the processor control function \fBP_ONLINE\fR.
288 An existing file was mentioned in an inappropriate context (for example, call
289 to the \fBlink\fR(2) function).
300 A hard link to a file on another device was attempted.
311 An attempt was made to apply an inappropriate operation to a device (for
312 example, read a write-only device).
323 A non-directory was specified where a directory is required (for example, in a
324 path prefix or as an argument to the \fBchdir\fR(2) function).
335 An attempt was made to write on a directory.
346 An invalid argument was specified (for example, unmounting a non-mounted
347 device), mentioning an undefined signal in a call to the \fBsignal\fR(3C) or
348 \fBkill\fR(2) function, or an unsupported operation related to extended
349 attributes was attempted.
360 The system file table is full (that is, \fBSYS_OPEN\fR files are open, and
361 temporarily no more files can be opened).
372 No process may have more than \fBOPEN_MAX\fR file descriptors open at a time.
381 Inappropriate ioctl for device
383 A call was made to the \fBioctl\fR(2) function specifying a file that is not a
384 special character device.
393 Text file busy (obsolete)
395 An attempt was made to execute a pure-procedure program that is currently open
396 for writing. Also an attempt to open for writing or to remove a pure-procedure
397 program that is being executed. \fB(This message is obsolete.)\fR
408 The size of the file exceeded the limit specified by resource
409 \fBRLIMIT_FSIZEn\fR; the file size exceeds the maximum supported by the file
410 system; or the file size exceeds the offset maximum of the file descriptor.
411 See the \fBFile Descriptor\fR subsection of the \fBDEFINITIONS\fR section
421 No space left on device
423 While writing an ordinary file or creating a directory entry, there is no free
424 space left on the device. In the \fBfcntl\fR(2) function, the setting or
425 removing of record locks on a file cannot be accomplished because there are no
426 more record entries left on the system.
437 A call to the \fBlseek\fR(2) function was issued to a pipe.
446 Read-only file system
448 An attempt to modify a file or directory was made on a device mounted
460 An attempt to make more than the maximum number of links, \fBLINK_MAX\fR, to a
472 A write on a pipe for which there is no process to read the data. This
473 condition normally generates a signal; the error is returned if the signal is
483 Math argument out of domain of function
485 The argument of a function in the math package (3M) is out of the domain of the
495 Math result not representable
497 The value of a function in the math package (3M) is not representable within
507 No message of desired type
509 An attempt was made to receive a message of a type that does not exist on the
510 specified message queue (see \fBmsgrcv\fR(2)).
521 This error is returned to processes that resume execution due to the removal of
522 an identifier from the file system's name space (see \fBmsgctl\fR(2),
523 \fBsemctl\fR(2), and \fBshmctl\fR(2)).
532 Channel number out of range
541 Level 2 not synchronized
568 Link number out of range
577 Protocol driver not attached
586 No CSI structure available
606 A deadlock situation was detected and avoided. This error pertains to file and
607 record locking, and also applies to mutexes, semaphores, condition variables,
617 No record locks available
619 There are no more locks available. The system lock table is full (see
631 The associated asynchronous operation was canceled before completion.
642 This version of the system does not support this feature. Future versions of
643 the system may provide support.
654 A \fBwrite\fR(2) to an ordinary file, the creation of a directory or symbolic
655 link, or the creation of a directory entry failed because the user's quota of
656 disk blocks was exhausted, or the allocation of an inode for a newly created
657 file failed because the user's quota of inodes was exhausted.
677 A \fBputmsg\fR(2) or \fBgetmsg\fR(2) call was attempted on a file descriptor
678 that is not a STREAMS device.
698 The timer set for a STREAMS \fBioctl\fR(2) call has expired. The cause of this
699 error is device-specific and could indicate either a hardware or software
700 failure, or perhaps a timeout value that is too short for the specific
701 operation. The status of the \fBioctl()\fR operation is indeterminate. This is
702 also returned in the case of \fB_lwp_cond_timedwait\fR(2) or
703 \fBcond_timedwait\fR(3C).
712 Out of stream resources
714 During a \fBSTREAMS\fR \fBopen\fR(2) call, either no \fBSTREAMS\fR queues or
715 no \fBSTREAMS\fR head data structures were available. This is a temporary
716 condition; one may recover from it if other processes release resources.
725 Package not installed
727 This error occurs when users attempt to use a call from a package which has not
739 Some protocol error occurred. This error is device-specific, but is generally
740 not related to a hardware failure.
751 During a \fBread\fR(2), \fBgetmsg\fR(2), or \fBioctl\fR(2) \fBI_RECVFD\fR call
752 to a STREAMS device, something has come to the head of the queue that can not
753 be processed. That something depends on the call:
760 control information or passed file descriptor.
766 \fB\fBgetmsg()\fR:\fR
769 passed file descriptor.
778 control or data information.
786 \fB78 ENAMETOOLONG\fR
791 The length of the path argument exceeds \fIPATH_MAX\fR, or the length of a
792 path component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in effect;
793 see \fBlimits.h\fR(3HEAD).
802 Value too large for defined data type.
811 Name not unique on network
813 Given log name not unique.
822 File descriptor in bad state
824 Either a file descriptor refers to no open file or a read request was made to a
825 file that is open only for writing.
834 Remote address changed
843 Cannot access a needed share library
845 Trying to \fBexec\fR an \fBa.out\fR that requires a static shared library and
846 the static shared library does not exist or the user does not have permission
856 Accessing a corrupted shared library
858 Trying to \fBexec\fR an \fBa.out\fR that requires a static shared library (to
859 be linked in) and \fBexec\fR could not load the static shared library. The
860 static shared library is probably corrupted.
869 \fB\&.lib\fR section in \fBa.out\fR corrupted
871 Trying to \fBexec\fR an \fBa.out\fR that requires a static shared library (to
872 be linked in) and there was erroneous data in the \fB\&.lib\fR section of the
873 \fBa.out\fR. The \fB\&.lib\fR section tells \fBexec\fR what static shared
874 libraries are needed. The \fBa.out\fR is probably corrupted.
883 Attempting to link in more shared libraries than system limit
885 Trying to \fBexec\fR an \fBa.out\fR that requires more static shared libraries
886 than is allowed on the current configuration of the system. See \fISystem
887 Administration Guide: IP Services\fR
896 Cannot \fBexec\fR a shared library directly
898 Attempting to \fBexec\fR a shared library directly.
909 Illegal byte sequence. Handle multiple characters as a single character.
918 Operation not applicable
927 Number of symbolic links encountered during path name traversal exceeds
937 Restartable system call
939 Interrupted system call should be restarted.
948 If pipe/FIFO, don't sleep in stream head
950 Streams pipe error (not externally visible).
977 Socket operation on non-socket
983 \fB96 EDESTADDRREQ\fR
986 Destination address required
988 A required address was omitted from an operation on a transport endpoint.
989 Destination address required.
1000 A message sent on a transport provider was larger than the internal message
1001 buffer or some other network limit.
1010 Protocol wrong type for socket
1012 A protocol was specified that does not support the semantics of the socket type
1019 \fB99 ENOPROTOOPT\fR
1022 Protocol not available
1024 A bad option or level was specified when getting or setting options for a
1031 \fB120 EPROTONOSUPPORT\fR
1034 Protocol not supported
1036 The protocol has not been configured into the system or no implementation for
1043 \fB121 ESOCKTNOSUPPORT\fR
1046 Socket type not supported
1048 The support for the socket type has not been configured into the system or no
1049 implementation for it exists.
1055 \fB122 EOPNOTSUPP\fR
1058 Operation not supported on transport endpoint
1060 For example, trying to accept a connection on a datagram transport endpoint.
1066 \fB123 EPFNOSUPPORT\fR
1069 Protocol family not supported
1071 The protocol family has not been configured into the system or no
1072 implementation for it exists. Used for the Internet protocols.
1078 \fB124 EAFNOSUPPORT\fR
1081 Address family not supported by protocol family
1083 An address incompatible with the requested protocol was used.
1089 \fB125 EADDRINUSE\fR
1092 Address already in use
1094 User attempted to use an address already in use, and the protocol does not
1101 \fB126 EADDRNOTAVAIL\fR
1104 Cannot assign requested address
1106 Results from an attempt to create a transport endpoint with an address not on
1107 the current machine.
1118 Operation encountered a dead network.
1124 \fB128 ENETUNREACH\fR
1127 Network is unreachable
1129 Operation was attempted to an unreachable network.
1138 Network dropped connection because of reset
1140 The host you were connected to crashed and rebooted.
1146 \fB130 ECONNABORTED\fR
1149 Software caused connection abort
1151 A connection abort was caused internal to your host machine.
1157 \fB131 ECONNRESET\fR
1160 Connection reset by peer
1162 A connection was forcibly closed by a peer. This normally results from a loss
1163 of the connection on the remote host due to a timeout or a reboot.
1172 No buffer space available
1174 An operation on a transport endpoint or pipe was not performed because the
1175 system lacked sufficient buffer space or because a queue was full.
1184 Transport endpoint is already connected
1186 A connect request was made on an already connected transport endpoint; or, a
1187 \fBsendto\fR(3SOCKET) or \fBsendmsg\fR(3SOCKET) request on a connected
1188 transport endpoint specified a destination when already connected.
1197 Transport endpoint is not connected
1199 A request to send or receive data was disallowed because the transport endpoint
1200 is not connected and (when sending a datagram) no address was supplied.
1209 Cannot send after transport endpoint shutdown
1211 A request to send data was disallowed because the transport endpoint has
1212 already been shut down.
1218 \fB144 ETOOMANYREFS\fR
1221 Too many references: cannot splice
1230 Connection timed out
1232 A \fBconnect\fR(3SOCKET) or \fBsend\fR(3SOCKET) request failed because the
1233 connected party did not properly respond after a period of time; or a
1234 \fBwrite\fR(2) or \fBfsync\fR(3C) request failed because a file is on an
1235 \fBNFS\fR file system mounted with the \fIsoft\fR option.
1241 \fB146 ECONNREFUSED\fR
1246 No connection could be made because the target machine actively refused it.
1247 This usually results from trying to connect to a service that is inactive on
1259 A transport provider operation failed because the destination host was down.
1265 \fB148 EHOSTUNREACH\fR
1270 A transport provider operation was attempted to an unreachable host.
1279 Operation already in progress
1281 An operation was attempted on a non-blocking object that already had an
1282 operation in progress.
1288 \fB150 EINPROGRESS\fR
1291 Operation now in progress
1293 An operation that takes a long time to complete (such as a \fBconnect()\fR) was
1294 attempted on a non-blocking object.
1303 Stale NFS file handle
1307 .SS "Background Process Group"
1310 Any process group that is not the foreground process group of a session that
1311 has established a connection with a controlling terminal.
1312 .SS "Controlling Process"
1315 A session leader that established a connection to a controlling terminal.
1316 .SS "Controlling Terminal"
1319 A terminal that is associated with a session. Each session may have, at most,
1320 one controlling terminal associated with it and a controlling terminal may be
1321 associated with only one session. Certain input sequences from the controlling
1322 terminal cause signals to be sent to process groups in the session associated
1323 with the controlling terminal; see \fBtermio\fR(7I).
1327 Directories organize files into a hierarchical system where directories are the
1328 nodes in the hierarchy. A directory is a file that catalogs the list of files,
1329 including directories (sub-directories), that are directly beneath it in the
1330 hierarchy. Entries in a directory file are called links. A link associates a
1331 file identifier with a filename. By convention, a directory contains at least
1332 two links, \fB\&.\fR (dot) and \fB\&..\fR (dot-dot). The link called dot refers
1333 to the directory itself while dot-dot refers to its parent directory. The root
1334 directory, which is the top-most node of the hierarchy, has itself as its
1335 parent directory. The pathname of the root directory is \fB/\fR and the parent
1336 directory of the root directory is \fB/\fR.
1340 In a stream, the direction from stream head to driver.
1344 In a stream, the driver provides the interface between peripheral hardware and
1345 the stream. A driver can also be a pseudo-driver, such as a multiplexor or log
1346 driver (see \fBlog\fR(7D)), which is not associated with a hardware device.
1347 .SS "Effective User \fBID\fR and Effective Group \fBID\fR"
1350 An active process has an effective user \fBID\fR and an effective group
1351 \fBID\fR that are used to determine file access permissions (see below). The
1352 effective user \fBID\fR and effective group \fBID\fR are equal to the process's
1353 real user \fBID\fR and real group \fBID,\fR respectively, unless the process or
1354 one of its ancestors evolved from a file that had the set-user-ID bit or
1355 set-group-ID bit set (see \fBexec\fR(2)).
1356 .SS "File Access Permissions"
1359 Read, write, and execute/search permissions for a file are granted to a process
1360 if one or more of the following are true:
1365 The effective user ID of the process matches the user ID of the owner of the
1366 file and the appropriate access bit of the "owner" portion (0700) of the file
1373 The effective user ID of the process does not match the user ID of the owner
1374 of the file, but either the effective group ID or one of the supplementary
1375 group IDs of the process match the group ID of the file and the appropriate
1376 access bit of the "group" portion (0070) of the file mode is set.
1382 The effective user ID of the process does not match the user ID of the owner of
1383 the file, and neither the effective group ID nor any of the supplementary group
1384 IDs of the process match the group ID of the file, but the appropriate access
1385 bit of the "other" portion (0007) of the file mode is set.
1391 The read, write, or execute mode bit is not set but the process has the
1392 discretionary file access override privilege for the corresponding mode bit:
1393 {\fBPRIV_FILE_DAC_READ\fR} for the read bit {\fBPRIV_FILE_DAC_WRITE\fR} for the
1394 write bit, {\fBPRIV_FILE_DAC_SEARCH\fR} for the execute bit on directories, and
1395 {\fBPRIV_FILE_DAC_EXECUTE\fR} for the executable bit on plain files.
1399 Otherwise, the corresponding permissions are denied.
1400 .SS "File Descriptor"
1403 A file descriptor is a small integer used to perform \fBI/O\fR on a file. The
1404 value of a file descriptor is from \fB0\fR to (\fBNOFILES\(mi1\fR). A process
1405 may have no more than \fBNOFILES\fR file descriptors open simultaneously. A
1406 file descriptor is returned by calls such as \fBopen\fR(2) or \fBpipe\fR(2).
1407 The file descriptor is used as an argument by calls such as \fBread\fR(2),
1408 \fBwrite\fR(2), \fBioctl\fR(2), and \fBclose\fR(2).
1411 Each file descriptor has a corresponding offset maximum. For regular files that
1412 were opened without setting the \fBO_LARGEFILE\fR flag, the offset maximum is 2
1413 Gbyte \(mi 1 byte (2^31 \(mi1 bytes). For regular files that were opened with
1414 the \fBO_LARGEFILE\fR flag set, the offset maximum is 2^63 \(mi1 bytes.
1418 Names consisting of 1 to \fINAME_MAX\fR characters may be used to name an
1419 ordinary file, special file or directory.
1422 These characters may be selected from the set of all character values excluding
1423 \e0 (null) and the \fBASCII\fR code for \fB/\fR (slash).
1426 Note that it is generally unwise to use \fB*\fR, \fB?\fR, \fB[\fR, or \fB]\fR
1427 as part of file names because of the special meaning attached to these
1428 characters by the shell (see \fBsh\fR(1), \fBcsh\fR(1), and \fBksh\fR(1)).
1429 Although permitted, the use of unprintable characters in file names should be
1433 A file name is sometimes referred to as a pathname component. The
1434 interpretation of a pathname component is dependent on the values of
1435 \fINAME_MAX\fR and \fB_POSIX_NO_TRUNC\fR associated with the path prefix of
1436 that component. If any pathname component is longer than \fINAME_MAX\fR and
1437 \fB_POSIX_NO_TRUNC\fR is in effect for the path prefix of that component (see
1438 \fBfpathconf\fR(2) and \fBlimits.h\fR(3HEAD)), it shall be considered an error
1439 condition in that implementation. Otherwise, the implementation shall use the
1440 first \fINAME_MAX\fR bytes of the pathname component.
1441 .SS "Foreground Process Group"
1444 Each session that has established a connection with a controlling terminal will
1445 distinguish one process group of the session as the foreground process group of
1446 the controlling terminal. This group has certain privileges when accessing its
1447 controlling terminal that are denied to background process groups.
1451 Maximum number of entries in a \fBstruct iovec\fR array.
1455 The braces notation, \fB{LIMIT}\fR, is used to denote a magnitude limitation
1456 imposed by the implementation. This indicates a value which may be defined by
1457 a header file (without the braces), or the actual value may be obtained at
1458 runtime by a call to the configuration inquiry \fBpathconf\fR(2) with the name
1459 argument \fB_PC_LIMIT\fR.
1463 The file mode creation mask of the process used during any create function
1464 calls to turn off permission bits in the \fImode\fR argument supplied. Bit
1465 positions that are set in \fBumask(\fR\fIcmask\fR\fB)\fR are cleared in the
1466 mode of the created file.
1470 In a stream, one or more blocks of data or information, with associated STREAMS
1471 control structures. Messages can be of several defined types, which identify
1472 the message contents. Messages are the only means of transferring data and
1473 communicating within a stream.
1477 In a stream, a linked list of messages awaiting processing by a module or
1479 .SS "Message Queue Identifier"
1482 A message queue identifier (\fBmsqid\fR) is a unique positive integer created
1483 by a \fBmsgget\fR(2) call. Each \fBmsqid\fR has a message queue and a data
1484 structure associated with it. The data structure is referred to as
1485 \fBmsqid_ds\fR and contains the following members:
1489 struct ipc_perm msg_perm;
1490 struct msg *msg_first;
1491 struct msg *msg_last;
1505 The following are descriptions of the \fBmsqid_ds\fR structure members:
1508 The \fBmsg_perm\fR member is an \fBipc_perm\fR structure that specifies the
1509 message operation permission (see below). This structure includes the following
1514 uid_t cuid; /* creator user id */
1515 gid_t cgid; /* creator group id */
1516 uid_t uid; /* user id */
1517 gid_t gid; /* group id */
1518 mode_t mode; /* r/w permission */
1519 ulong_t seq; /* slot usage sequence # */
1520 key_t key; /* key */
1526 The \fB*msg_first\fR member is a pointer to the first message on the queue.
1529 The \fB*msg_last\fR member is a pointer to the last message on the queue.
1532 The \fBmsg_cbytes\fR member is the current number of bytes on the queue.
1535 The \fBmsg_qnum\fR member is the number of messages currently on the queue.
1538 The \fBmsg_qbytes\fR member is the maximum number of bytes allowed on the
1542 The \fBmsg_lspid\fR member is the process \fBID\fR of the last process that
1543 performed a \fBmsgsnd()\fR operation.
1546 The \fBmsg_lrpid\fR member is the process id of the last process that performed
1547 a \fBmsgrcv()\fR operation.
1550 The \fBmsg_stime\fR member is the time of the last \fBmsgsnd()\fR operation.
1553 The \fBmsg_rtime\fR member is the time of the last \fBmsgrcv()\fR operation.
1556 The \fBmsg_ctime\fR member is the time of the last \fBmsgctl()\fR operation
1557 that changed a member of the above structure.
1558 .SS "Message Operation Permissions"
1561 In the \fBmsgctl\fR(2), \fBmsgget\fR(2), \fBmsgrcv\fR(2), and \fBmsgsnd\fR(2)
1562 function descriptions, the permission required for an operation is given as
1563 {\fItoken\fR}, where \fItoken\fR is the type of permission needed, interpreted
1571 00020 WRITE by group
1572 00004 READ by others
1573 00002 WRITE by others
1579 Read and write permissions for a \fBmsqid\fR are granted to a process if one or
1580 more of the following are true:
1585 The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
1586 present in the effective set.
1592 The effective user \fBID\fR of the process matches \fBmsg_perm.cuid\fR or
1593 \fBmsg_perm.uid\fR in the data structure associated with \fBmsqid\fR and the
1594 appropriate bit of the "user" portion (0600) of \fBmsg_perm.mode\fR is set.
1600 Any group ID in the process credentials from the set (\fBcr_gid\fR,
1601 \fBcr_groups\fR) matches \fBmsg_perm.cgid\fR or \fBmsg_perm.gid\fR and the
1602 appropriate bit of the "group" portion (060) of \fBmsg_perm.mode\fR is set.
1608 The appropriate bit of the "other" portion (006) of \fBmsg_perm.mode\fR is
1613 Otherwise, the corresponding permissions are denied.
1617 A module is an entity containing processing routines for input and output data.
1618 It always exists in the middle of a stream, between the stream's head and a
1619 driver. A module is the STREAMS counterpart to the commands in a shell pipeline
1620 except that a module contains a pair of functions which allow independent
1621 bidirectional (downstream and upstream) data flow and processing.
1625 A multiplexor is a driver that allows streams associated with several user
1626 processes to be connected to a single driver, or several drivers to be
1627 connected to a single user process. STREAMS does not provide a general
1628 multiplexing driver, but does provide the facilities for constructing them and
1629 for connecting multiplexed configurations of streams.
1630 .SS "Offset Maximum"
1633 An offset maximum is an attribute of an open file description representing the
1634 largest value that can be used as a file offset.
1635 .SS "Orphaned Process Group"
1638 A process group in which the parent of every member in the group is either
1639 itself a member of the group, or is not a member of the process group's
1644 A path name is a null-terminated character string starting with an optional
1645 slash (\fB/\fR), followed by zero or more directory names separated by slashes,
1646 optionally followed by a file name.
1649 If a path name begins with a slash, the path search begins at the root
1650 directory. Otherwise, the search begins from the current working directory.
1653 A slash by itself names the root directory.
1656 Unless specifically stated otherwise, the null path name is treated as if it
1657 named a non-existent file.
1658 .SS "Privileged User"
1661 Solaris software implements a set of privileges that provide fine-grained
1662 control over the actions of processes. The possession of of a certain privilege
1663 allows a process to perform a specific set of restricted operations. Prior to
1664 the Solaris 10 release, a process running with uid 0 was granted all
1665 privileges. See \fBprivileges\fR(5) for the semantics and the degree of
1666 backward compatibility awarded to processes with an effective uid of 0.
1667 .SS "Process \fBID\fR"
1670 Each process in the system is uniquely identified during its lifetime by a
1671 positive integer called a process ID. A process ID cannot be reused by the
1672 system until the process lifetime, process group lifetime, and session lifetime
1673 ends for any process ID, process group ID, and session ID equal to that process
1674 ID. There are threads within a process with thread IDs \fBthread_t\fR and
1675 \fBLWPID_t\fR. These threads are not visible to the outside process.
1676 .SS "Parent Process \fBID\fR"
1679 A new process is created by a currently active process (see \fBfork\fR(2)). The
1680 parent process \fBID\fR of a process is the process \fBID\fR of its creator.
1684 Having appropriate privilege means having the capability to override system
1689 Each process in the system is a member of a process group that is identified by
1690 a process group ID. Any process that is not a process group leader may create
1691 a new process group and become its leader. Any process that is not a process
1692 group leader may join an existing process group that shares the same session
1693 as the process. A newly created process joins the process group of its parent.
1694 .SS "Process Group Leader"
1697 A process group leader is a process whose process \fBID\fR is the same as its
1699 .SS "Process Group \fBID\fR"
1702 Each active process is a member of a process group and is identified by a
1703 positive integer called the process group ID. This \fBID\fR is the process
1704 \fBID\fR of the group leader. This grouping permits the signaling of related
1705 processes (see \fBkill\fR(2)).
1706 .SS "Process Lifetime"
1709 A process lifetime begins when the process is forked and ends after it exits,
1710 when its termination has been acknowledged by its parent process. See
1712 .SS "Process Group Lifetime"
1715 A process group lifetime begins when the process group is created by its
1716 process group leader, and ends when the lifetime of the last process in the
1717 group ends or when the last process in the group leaves the group.
1718 .SS "Processor Set \fBID\fR"
1721 The processors in a system may be divided into subsets, known as processor
1722 sets. A process bound to one of these sets will run only on processors in that
1723 set, and the processors in the set will normally run only processes that have
1724 been bound to the set. Each active processor set is identified by a positive
1725 integer. See \fBpset_create\fR(2).
1729 In a stream, the message queue in a module or driver containing messages moving
1731 .SS "Real User \fBID\fR and Real Group \fBID\fR"
1734 Each user allowed on the system is identified by a positive integer (\fB0\fR
1735 to \fBMAXUID\fR) called a real user \fBID.\fR
1738 Each user is also a member of a group. The group is identified by a positive
1739 integer called the real group \fBID.\fR
1742 An active process has a real user \fBID\fR and real group \fBID\fR that are set
1743 to the real user \fBID\fR and real group \fBID,\fR respectively, of the user
1744 responsible for the creation of the process.
1745 .SS "Root Directory and Current Working Directory"
1748 Each process has associated with it a concept of a root directory and a current
1749 working directory for the purpose of resolving path name searches. The root
1750 directory of a process need not be the root directory of the root file system.
1751 .SS "Saved Resource Limits"
1754 Saved resource limits is an attribute of a process that provides some
1755 flexibility in the handling of unrepresentable resource limits, as described in
1756 the \fBexec\fR family of functions and \fBsetrlimit\fR(2).
1757 .SS "Saved User \fBID\fR and Saved Group \fBID\fR"
1760 The saved user \fBID\fR and saved group \fBID\fR are the values of the
1761 effective user \fBID\fR and effective group \fBID\fR just after an \fBexec\fR
1762 of a file whose set user or set group file mode bit has been set (see
1764 .SS "Semaphore Identifier"
1767 A semaphore identifier (\fBsemid\fR) is a unique positive integer created by a
1768 \fBsemget\fR(2) call. Each \fBsemid\fR has a set of semaphores and a data
1769 structure associated with it. The data structure is referred to as
1770 \fBsemid_ds\fR and contains the following members:
1774 struct ipc_perm sem_perm; /* operation permission struct */
1775 struct sem *sem_base; /* ptr to first semaphore in set */
1776 ushort_t sem_nsems; /* number of sems in set */
1777 time_t sem_otime; /* last operation time */
1778 time_t sem_ctime; /* last change time */
1779 /* Times measured in secs since */
1780 /* 00:00:00 GMT, Jan. 1, 1970 */
1786 The following are descriptions of the \fBsemid_ds\fR structure members:
1789 The \fBsem_perm\fR member is an \fBipc_perm\fR structure that specifies the
1790 semaphore operation permission (see below). This structure includes the
1795 uid_t uid; /* user id */
1796 gid_t gid; /* group id */
1797 uid_t cuid; /* creator user id */
1798 gid_t cgid; /* creator group id */
1799 mode_t mode; /* r/a permission */
1800 ulong_t seq; /* slot usage sequence number */
1801 key_t key; /* key */
1807 The \fBsem_nsems\fR member is equal to the number of semaphores in the set.
1808 Each semaphore in the set is referenced by a nonnegative integer referred to as
1809 a \fBsem_num\fR. \fBsem_num\fR values run sequentially from \fB0\fR to the
1810 value of \fBsem_nsems\fR minus 1.
1813 The \fBsem_otime\fR member is the time of the last \fBsemop\fR(2) operation.
1816 The \fBsem_ctime\fR member is the time of the last \fBsemctl\fR(2) operation
1817 that changed a member of the above structure.
1820 A semaphore is a data structure called \fBsem\fR that contains the following
1825 ushort_t semval; /* semaphore value */
1826 pid_t sempid; /* pid of last operation */
1827 ushort_t semncnt; /* # awaiting semval > cval */
1828 ushort_t semzcnt; /* # awaiting semval = 0 */
1834 The following are descriptions of the \fBsem\fR structure members:
1837 The \fBsemval\fR member is a non-negative integer that is the actual value of
1841 The \fBsempid\fR member is equal to the process \fBID\fR of the last process
1842 that performed a semaphore operation on this semaphore.
1845 The \fBsemncnt\fR member is a count of the number of processes that are
1846 currently suspended awaiting this semaphore's \fBsemval\fR to become greater
1847 than its current value.
1850 The \fBsemzcnt\fR member is a count of the number of processes that are
1851 currently suspended awaiting this semaphore's \fBsemval\fR to become \fB0\fR.
1852 .SS "Semaphore Operation Permissions"
1855 In the \fBsemop\fR(2) and \fBsemctl\fR(2) function descriptions, the permission
1856 required for an operation is given as {\fItoken\fR}, where \fItoken\fR is the
1857 type of permission needed interpreted as follows:
1861 \fB00400 READ by user
1864 00020 ALTER by group
1865 00004 READ by others
1866 00002 ALTER by others\fR
1872 Read and alter permissions for a \fBsemid\fR are granted to a process if one or
1873 more of the following are true:
1878 The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
1879 present in the effective set.
1885 The effective user \fBID\fR of the process matches \fBsem_perm.cuid\fR or
1886 \fBsem_perm.uid\fR in the data structure associated with \fBsemid\fR and the
1887 appropriate bit of the "user" portion (0600) of \fBsem_perm.mode\fR is set.
1893 The effective group \fBID\fR of the process matches \fBsem_perm.cgid\fR or
1894 \fBsem_perm.gid\fR and the appropriate bit of the "group" portion (060) of
1895 \fBsem_perm.mode\fR is set.
1901 The appropriate bit of the "other" portion (06) of \fBsem_perm.mode\fR is set.
1905 Otherwise, the corresponding permissions are denied.
1909 A session is a group of processes identified by a common \fBID\fR called a
1910 session ID, capable of establishing a connection with a controlling terminal.
1911 Any process that is not a process group leader may create a new session and
1912 process group, becoming the session leader of the session and process group
1913 leader of the process group. A newly created process joins the session of its
1915 .SS "Session \fBID\fR"
1918 Each session in the system is uniquely identified during its lifetime by a
1919 positive integer called a session ID, the process \fBID\fR of its session
1921 .SS "Session Leader"
1924 A session leader is a process whose session \fBID\fR is the same as its
1925 process and process group ID.
1926 .SS "Session Lifetime"
1929 A session lifetime begins when the session is created by its session leader,
1930 and ends when the lifetime of the last process that is a member of the session
1931 ends, or when the last process that is a member in the session leaves the
1933 .SS "Shared Memory Identifier"
1936 A shared memory identifier (\fBshmid\fR) is a unique positive integer created
1937 by a \fBshmget\fR(2) call. Each \fBshmid\fR has a segment of memory (referred
1938 to as a shared memory segment) and a data structure associated with it. (Note
1939 that these shared memory segments must be explicitly removed by the user after
1940 the last reference to them is removed.) The data structure is referred to as
1941 \fBshmid_ds\fR and contains the following members:
1945 struct ipc_perm shm_perm; /* operation permission struct */
1946 size_t shm_segsz; /* size of segment */
1947 struct anon_map *shm_amp; /* ptr to region structure */
1948 char pad[4]; /* for swap compatibility */
1949 pid_t shm_lpid; /* pid of last operation */
1950 pid_t shm_cpid; /* creator pid */
1951 shmatt_t shm_nattch; /* number of current attaches */
1952 ulong_t shm_cnattch; /* used only for shminfo */
1953 time_t shm_atime; /* last attach time */
1954 time_t shm_dtime; /* last detach time */
1955 time_t shm_ctime; /* last change time */
1956 /* Times measured in secs since */
1957 /* 00:00:00 GMT, Jan. 1, 1970 */
1963 The following are descriptions of the \fBshmid_ds\fR structure members:
1966 The \fBshm_perm\fR member is an \fBipc_perm\fR structure that specifies the
1967 shared memory operation permission (see below). This structure includes the
1972 uid_t cuid; /* creator user id */
1973 gid_t cgid; /* creator group id */
1974 uid_t uid; /* user id */
1975 gid_t gid; /* group id */
1976 mode_t mode; /* r/w permission */
1977 ulong_t seq; /* slot usage sequence # */
1978 key_t key; /* key */
1984 The \fBshm_segsz\fR member specifies the size of the shared memory segment in
1988 The \fBshm_cpid\fR member is the process \fBID\fR of the process that created
1989 the shared memory identifier.
1992 The \fBshm_lpid\fR member is the process \fBID\fR of the last process that
1993 performed a \fBshmat()\fR or \fBshmdt()\fR operation (see \fBshmop\fR(2)).
1996 The \fBshm_nattch\fR member is the number of processes that currently have this
2000 The \fBshm_atime\fR member is the time of the last \fBshmat()\fR operation (see
2004 The \fBshm_dtime\fR member is the time of the last \fBshmdt()\fR operation (see
2008 The \fBshm_ctime\fR member is the time of the last \fBshmctl\fR(2) operation
2009 that changed one of the members of the above structure.
2010 .SS "Shared Memory Operation Permissions"
2013 In the \fBshmctl\fR(2), \fBshmat()\fR, and \fBshmdt()\fR (see \fBshmop\fR(2))
2014 function descriptions, the permission required for an operation is given as
2015 {\fItoken\fR}, where \fItoken\fR is the type of permission needed interpreted
2023 00020 WRITE by group
2024 00004 READ by others
2025 00002 WRITE by others
2031 Read and write permissions for a \fBshmid\fR are granted to a process if one or
2032 more of the following are true:
2037 The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
2038 present in the effective set.
2044 The effective user \fBID\fR of the process matches \fBshm_perm.cuid\fR or
2045 \fBshm_perm.uid\fR in the data structure associated with \fBshmid\fR and the
2046 appropriate bit of the "user" portion (0600) of \fBshm_perm.mode\fR is set.
2052 The effective group \fBID\fR of the process matches \fBshm_perm.cgid\fR or
2053 \fBshm_perm.gid\fR and the appropriate bit of the "group" portion (060) of
2054 \fBshm_perm.mode\fR is set.
2060 The appropriate bit of the "other" portion (06) of \fBshm_perm.mode\fR is set.
2064 Otherwise, the corresponding permissions are denied.
2065 .SS "Special Processes"
2068 The process with \fBID\fR 0 and the process with \fBID\fR 1 are special
2069 processes referred to as proc0 and proc1; see \fBkill\fR(2). proc0 is the
2070 process scheduler. proc1 is the initialization process (\fIinit\fR); proc1 is
2071 the ancestor of every other process in the system and is used to control the
2076 A set of kernel mechanisms that support the development of network services and
2077 data communication drivers. It defines interface standards for character
2078 input/output within the kernel and between the kernel and user level processes.
2079 The STREAMS mechanism is composed of utility routines, kernel facilities and a
2080 set of data structures.
2084 A stream is a full-duplex data path within the kernel between a user process
2085 and driver routines. The primary components are a stream head, a driver, and
2086 zero or more modules between the stream head and driver. A stream is analogous
2087 to a shell pipeline, except that data flow and processing are bidirectional.
2091 In a stream, the stream head is the end of the stream that provides the
2092 interface between the stream and a user process. The principal functions of the
2093 stream head are processing STREAMS-related system calls and passing data and
2094 information between a user process and the stream.
2098 In a stream, the direction from driver to stream head.
2102 In a stream, the message queue in a module or driver containing messages moving
2107 Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to
2108 reproduce portions of its copyrighted documentation. Original documentation
2109 from The Open Group can be obtained online at
2110 http://www.opengroup.org/bookstore/\&.
2113 The Institute of Electrical and Electronics Engineers and The Open Group, have
2114 given us permission to reprint portions of their documentation.
2117 In the following statement, the phrase ``this text'' refers to portions of the
2118 system documentation.
2121 Portions of this text are reprinted and reproduced in electronic form in the
2122 SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for
2123 Information Technology -- Portable Operating System Interface (POSIX), The Open
2124 Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
2125 Electrical and Electronics Engineers, Inc and The Open Group. In the event of
2126 any discrepancy between these versions and the original IEEE and The Open Group
2127 Standard, the original IEEE and The Open Group Standard is the referee
2128 document. The original Standard can be obtained online at
2129 http://www.opengroup.org/unix/online.html\&.
2132 This notice shall appear on any product containing this material.
2136 \fBstandards\fR(5), \fBthreads\fR(5)