8815 mega_sas: variable set but not used
[unleashed.git] / usr / src / man / man2 / Intro.2
blob6194a6a260fc6be3a4bdfdada69edaaf4aea4be8
1 '\" te
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"
8 .SH NAME
9 Intro, intro \- introduction to system calls and error numbers
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB#include <errno.h>\fR
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
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
22 system call code.
23 .sp
24 .LP
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.
31 .sp
32 .LP
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.
38 .sp
39 .LP
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.
51 .sp
52 .LP
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
55 <\fBerrno.h\fR>.
56 .sp
57 .ne 2
58 .na
59 \fB1 EPERM\fR
60 .ad
61 .RS 23n
62 Lacking appropriate privileges
63 .sp
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.
68 .sp
69 The manual pages for individual functions document which privileges are needed
70 to override the restriction.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB2 ENOENT\fR
77 .ad
78 .RS 23n
79 No such file or directory
80 .sp
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.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB3 ESRCH\fR
89 .ad
90 .RS 23n
91 No such process, LWP, or thread
92 .sp
93 No process can be found in the system that corresponds to the specified
94 \fBPID,\fR \fBLWPID_t\fR, or \fBthread_t\fR.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB4 EINTR\fR
102 .RS 23n
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).
115 .ne 2
117 \fB5 EIO\fR
119 .RS 23n
120 I/O error
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.
127 .ne 2
129 \fB6 ENXIO\fR
131 .RS 23n
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.
140 .ne 2
142 \fB7 E2BIG\fR
144 .RS 23n
145 Arg list too long
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.
154 .ne 2
156 \fB8 ENOEXEC\fR
158 .RS 23n
159 Exec format error
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)).
166 .ne 2
168 \fB9 EBADF\fR
170 .RS 23n
171 Bad file number
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).
179 .ne 2
181 \fB10 ECHILD\fR
183 .RS 23n
184 No child processes
186 A \fBwait\fR(3C) function call was executed by a process that had no existing
187 or unwaited-for child processes.
191 .ne 2
193 \fB11 EAGAIN\fR
195 .RS 23n
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.
204 .ne 2
206 \fB12 ENOMEM\fR
208 .RS 23n
209 Not enough 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)
217 function.
221 .ne 2
223 \fB13 EACCES\fR
225 .RS 23n
226 Permission denied
228 An attempt was made to access a file in a way forbidden by the protection
229 system.
231 The manual pages for individual functions document which privileges are needed
232 to override the protection system.
236 .ne 2
238 \fB14 EFAULT\fR
240 .RS 23n
241 Bad address
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.
252 .ne 2
254 \fB15 ENOTBLK\fR
256 .RS 23n
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).
264 .ne 2
266 \fB16 EBUSY\fR
268 .RS 23n
269 Device busy
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.
281 .ne 2
283 \fB17 EEXIST\fR
285 .RS 23n
286 File exists
288 An existing file was mentioned in an inappropriate context (for example, call
289 to the \fBlink\fR(2) function).
293 .ne 2
295 \fB18 EXDEV\fR
297 .RS 23n
298 Cross-device link
300 A hard link to a file on another device was attempted.
304 .ne 2
306 \fB19 ENODEV\fR
308 .RS 23n
309 No such device
311 An attempt was made to apply an inappropriate operation to a device (for
312 example, read a write-only device).
316 .ne 2
318 \fB20 ENOTDIR\fR
320 .RS 23n
321 Not a directory
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).
328 .ne 2
330 \fB21 EISDIR\fR
332 .RS 23n
333 Is a directory
335 An attempt was made to write on a directory.
339 .ne 2
341 \fB22 EINVAL\fR
343 .RS 23n
344 Invalid argument
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.
353 .ne 2
355 \fB23 ENFILE\fR
357 .RS 23n
358 File table overflow
360 The system file table is full (that is,  \fBSYS_OPEN\fR files are open, and
361 temporarily no more files can be opened).
365 .ne 2
367 \fB24 EMFILE\fR
369 .RS 23n
370 Too many open files
372 No process may have more than  \fBOPEN_MAX\fR file descriptors open at a time.
376 .ne 2
378 \fB25 ENOTTY\fR
380 .RS 23n
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.
388 .ne 2
390 \fB26 ETXTBSY\fR
392 .RS 23n
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
401 .ne 2
403 \fB27 EFBIG\fR
405 .RS 23n
406 File too large
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
412 below.
416 .ne 2
418 \fB28 ENOSPC\fR
420 .RS 23n
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.
430 .ne 2
432 \fB29 ESPIPE\fR
434 .RS 23n
435 Illegal seek
437 A call to the  \fBlseek\fR(2) function was issued to a pipe.
441 .ne 2
443 \fB30 EROFS\fR
445 .RS 23n
446 Read-only file system
448 An attempt to modify a file or directory was made on a device mounted
449 read-only.
453 .ne 2
455 \fB31 EMLINK\fR
457 .RS 23n
458 Too many links
460 An attempt to make more than the maximum number of links,  \fBLINK_MAX\fR, to a
461 file.
465 .ne 2
467 \fB32 EPIPE\fR
469 .RS 23n
470 Broken pipe
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
474 ignored.
478 .ne 2
480 \fB33 EDOM\fR
482 .RS 23n
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
486 function.
490 .ne 2
492 \fB34 ERANGE\fR
494 .RS 23n
495 Math result not representable
497 The value of a function in the math package (3M) is not representable within
498 machine precision.
502 .ne 2
504 \fB35 ENOMSG\fR
506 .RS 23n
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)).
514 .ne 2
516 \fB36 EIDRM\fR
518 .RS 23n
519 Identifier removed
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)).
527 .ne 2
529 \fB37 ECHRNG\fR
531 .RS 23n
532 Channel number out of range
536 .ne 2
538 \fB38 EL2NSYNC\fR
540 .RS 23n
541 Level 2 not synchronized
545 .ne 2
547 \fB39 EL3HLT\fR
549 .RS 23n
550 Level 3 halted
554 .ne 2
556 \fB40 EL3RST\fR
558 .RS 23n
559 Level 3 reset
563 .ne 2
565 \fB41 ELNRNG\fR
567 .RS 23n
568 Link number out of range
572 .ne 2
574 \fB42 EUNATCH\fR
576 .RS 23n
577 Protocol driver not attached
581 .ne 2
583 \fB43 ENOCSI\fR
585 .RS 23n
586 No CSI structure available
590 .ne 2
592 \fB44 EL2HLT\fR
594 .RS 23n
595 Level 2 halted
599 .ne 2
601 \fB45 EDEADLK\fR
603 .RS 23n
604 Deadlock condition
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,
608 and r/w locks.
612 .ne 2
614 \fB46 ENOLCK\fR
616 .RS 23n
617 No record locks available
619 There are no more locks available. The system lock table is full (see
620 \fBfcntl\fR(2)).
624 .ne 2
626 \fB47 ECANCELED\fR
628 .RS 23n
629 Operation canceled
631 The associated asynchronous operation was canceled before completion.
635 .ne 2
637 \fB48 ENOTSUP\fR
639 .RS 23n
640 Not supported
642 This version of the system does not support this feature. Future versions of
643 the system may provide support.
647 .ne 2
649 \fB49 EDQUOT\fR
651 .RS 23n
652 Disc quota exceeded
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.
661 .ne 2
663 \fB58-59\fR
665 .RS 23n
666 Reserved
670 .ne 2
672 \fB60 ENOSTR\fR
674 .RS 23n
675 Device not a stream
677 A \fBputmsg\fR(2) or \fBgetmsg\fR(2) call was attempted on a file descriptor
678 that is not a STREAMS device.
682 .ne 2
684 \fB61 ENODATA\fR
686 .RS 23n
687 No data available
691 .ne 2
693 \fB62 ETIME\fR
695 .RS 23n
696 Timer expired
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).
707 .ne 2
709 \fB63 ENOSR\fR
711 .RS 23n
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.
720 .ne 2
722 \fB65 ENOPKG\fR
724 .RS 23n
725 Package not installed
727 This error occurs when users attempt to use a call from a package which has not
728 been installed.
732 .ne 2
734 \fB71 EPROTO\fR
736 .RS 23n
737 Protocol error
739 Some protocol error occurred.  This error is device-specific, but is generally
740 not related to a hardware failure.
744 .ne 2
746 \fB77 EBADMSG\fR
748 .RS 23n
749 Not a data message
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:
755 .ne 2
757 \fB\fBread()\fR:\fR
759 .RS 13n
760 control information or passed file descriptor.
764 .ne 2
766 \fB\fBgetmsg()\fR:\fR
768 .RS 13n
769 passed file descriptor.
773 .ne 2
775 \fB\fBioctl()\fR:\fR
777 .RS 13n
778 control or data information.
784 .ne 2
786 \fB78 ENAMETOOLONG\fR
788 .RS 23n
789 File name too long
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).
797 .ne 2
799 \fB79 EOVERFLOW\fR
801 .RS 23n
802 Value too large for defined data type.
806 .ne 2
808 \fB80 ENOTUNIQ\fR
810 .RS 23n
811 Name not unique on network
813 Given log name not unique.
817 .ne 2
819 \fB81 EBADFD\fR
821 .RS 23n
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.
829 .ne 2
831 \fB82 EREMCHG\fR
833 .RS 23n
834 Remote address changed
838 .ne 2
840 \fB83 ELIBACC\fR
842 .RS 23n
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
847 to use it.
851 .ne 2
853 \fB84 ELIBBAD\fR
855 .RS 23n
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.
864 .ne 2
866 \fB85 ELIBSCN\fR
868 .RS 23n
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.
878 .ne 2
880 \fB86 ELIBMAX\fR
882 .RS 23n
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
891 .ne 2
893 \fB87 ELIBEXEC\fR
895 .RS 23n
896 Cannot \fBexec\fR a shared library directly
898 Attempting to \fBexec\fR a shared library directly.
902 .ne 2
904 \fB88 EILSEQ\fR
906 .RS 23n
907 Error 88
909 Illegal byte sequence. Handle multiple characters as a single character.
913 .ne 2
915 \fB89 ENOSYS\fR
917 .RS 23n
918 Operation not applicable
922 .ne 2
924 \fB90 ELOOP\fR
926 .RS 23n
927 Number of symbolic links encountered during path name traversal exceeds
928 \fBMAXSYMLINKS\fR
932 .ne 2
934 \fB91 ESTART\fR
936 .RS 23n
937 Restartable system call
939 Interrupted system call should be restarted.
943 .ne 2
945 \fB92 ESTRPIPE\fR
947 .RS 23n
948 If pipe/FIFO, don't sleep in stream head
950 Streams pipe error (not externally visible).
954 .ne 2
956 \fB93 ENOTEMPTY\fR
958 .RS 23n
959 Directory not empty
963 .ne 2
965 \fB94 EUSERS\fR
967 .RS 23n
968 Too many users
972 .ne 2
974 \fB95 ENOTSOCK\fR
976 .RS 23n
977 Socket operation on non-socket
981 .ne 2
983 \fB96 EDESTADDRREQ\fR
985 .RS 23n
986 Destination address required
988 A required address was omitted from an operation on a transport endpoint.
989 Destination address required.
993 .ne 2
995 \fB97 EMGSIZE\fR
997 .RS 23n
998 Message too long
1000 A message sent on a transport provider was larger than the internal message
1001 buffer or some other network limit.
1005 .ne 2
1007 \fB98 EPROTOTYPE\fR
1009 .RS 23n
1010 Protocol wrong type for socket
1012 A protocol was specified that does not support the semantics of the socket type
1013 requested.
1017 .ne 2
1019 \fB99 ENOPROTOOPT\fR
1021 .RS 23n
1022 Protocol not available
1024 A bad option or level was specified when getting or setting options for a
1025 protocol.
1029 .ne 2
1031 \fB120 EPROTONOSUPPORT\fR
1033 .RS 23n
1034 Protocol not supported
1036 The protocol has not been configured into the system or no implementation for
1037 it exists.
1041 .ne 2
1043 \fB121 ESOCKTNOSUPPORT\fR
1045 .RS 23n
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.
1053 .ne 2
1055 \fB122 EOPNOTSUPP\fR
1057 .RS 23n
1058 Operation not supported on transport endpoint
1060 For example, trying to accept a connection on a datagram transport endpoint.
1064 .ne 2
1066 \fB123 EPFNOSUPPORT\fR
1068 .RS 23n
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.
1076 .ne 2
1078 \fB124 EAFNOSUPPORT\fR
1080 .RS 23n
1081 Address family not supported by protocol family
1083 An address incompatible with the requested protocol was used.
1087 .ne 2
1089 \fB125 EADDRINUSE\fR
1091 .RS 23n
1092 Address already in use
1094 User attempted to use an address already in use, and the protocol does not
1095 allow this.
1099 .ne 2
1101 \fB126 EADDRNOTAVAIL\fR
1103 .RS 23n
1104 Cannot assign requested address
1106 Results from an attempt to create a transport endpoint with an address not on
1107 the current machine.
1111 .ne 2
1113 \fB127 ENETDOWN\fR
1115 .RS 23n
1116 Network is down
1118 Operation encountered a dead network.
1122 .ne 2
1124 \fB128 ENETUNREACH\fR
1126 .RS 23n
1127 Network is unreachable
1129 Operation was attempted to an unreachable network.
1133 .ne 2
1135 \fB129 ENETRESET\fR
1137 .RS 23n
1138 Network dropped connection because of reset
1140 The host you were connected to crashed and rebooted.
1144 .ne 2
1146 \fB130 ECONNABORTED\fR
1148 .RS 23n
1149 Software caused connection abort
1151 A connection abort was caused internal to your host machine.
1155 .ne 2
1157 \fB131 ECONNRESET\fR
1159 .RS 23n
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.
1167 .ne 2
1169 \fB132 ENOBUFS\fR
1171 .RS 23n
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.
1179 .ne 2
1181 \fB133 EISCONN\fR
1183 .RS 23n
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.
1192 .ne 2
1194 \fB134 ENOTCONN\fR
1196 .RS 23n
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.
1204 .ne 2
1206 \fB143 ESHUTDOWN\fR
1208 .RS 23n
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.
1216 .ne 2
1218 \fB144 ETOOMANYREFS\fR
1220 .RS 23n
1221 Too many references: cannot splice
1225 .ne 2
1227 \fB145 ETIMEDOUT\fR
1229 .RS 23n
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.
1239 .ne 2
1241 \fB146 ECONNREFUSED\fR
1243 .RS 23n
1244 Connection refused
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
1248 the remote host.
1252 .ne 2
1254 \fB147 EHOSTDOWN\fR
1256 .RS 23n
1257 Host is down
1259 A transport provider operation failed because the destination host was down.
1263 .ne 2
1265 \fB148 EHOSTUNREACH\fR
1267 .RS 23n
1268 No route to host
1270 A transport provider operation was attempted to an unreachable host.
1274 .ne 2
1276 \fB149 EALREADY\fR
1278 .RS 23n
1279 Operation already in progress
1281 An operation was attempted on a non-blocking object that already had an
1282 operation in progress.
1286 .ne 2
1288 \fB150 EINPROGRESS\fR
1290 .RS 23n
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.
1298 .ne 2
1300 \fB151 ESTALE\fR
1302 .RS 23n
1303 Stale NFS file handle
1306 .SH DEFINITIONS
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).
1324 .SS "Directory"
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.
1337 .SS "Downstream"
1340 In a stream, the direction from stream head to driver.
1341 .SS "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:
1361 .RS +4
1363 .ie t \(bu
1364 .el o
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
1367 mode is set.
1369 .RS +4
1371 .ie t \(bu
1372 .el o
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.
1378 .RS +4
1380 .ie t \(bu
1381 .el o
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.
1387 .RS +4
1389 .ie t \(bu
1390 .el o
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.
1415 .SS "File Name"
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
1430 avoided.
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.
1448 .SS "{IOV_MAX}"
1451 Maximum number of entries in a \fBstruct iovec\fR array.
1452 .SS "{LIMIT}"
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.
1460 .SS "Masks"
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.
1467 .SS "Message"
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.
1474 .SS "Message Queue"
1477 In a stream, a linked list of messages awaiting processing by a module or
1478 driver.
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:
1487 .in +2
1489 struct     ipc_perm msg_perm;
1490 struct     msg *msg_first;
1491 struct     msg *msg_last;
1492 ulong_t    msg_cbytes;
1493 ulong_t    msg_qnum;
1494 ulong_t    msg_qbytes;
1495 pid_t      msg_lspid;
1496 pid_t      msg_lrpid;
1497 time_t     msg_stime;
1498 time_t     msg_rtime;
1499 time_t     msg_ctime;
1501 .in -2
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
1510 members:
1512 .in +2
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 */
1522 .in -2
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
1539 queue.
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
1564 as follows:
1566 .in +2
1568 00400   READ by user
1569 00200   WRITE by user
1570 00040   READ by group
1571 00020   WRITE by group
1572 00004   READ by others
1573 00002   WRITE by others
1575 .in -2
1579 Read and write permissions for a \fBmsqid\fR are granted to a process if one or
1580 more of the following are true:
1581 .RS +4
1583 .ie t \(bu
1584 .el o
1585 The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
1586 present in the effective set.
1588 .RS +4
1590 .ie t \(bu
1591 .el o
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.
1596 .RS +4
1598 .ie t \(bu
1599 .el o
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.
1604 .RS +4
1606 .ie t \(bu
1607 .el o
1608 The appropriate bit of the "other" portion (006) of \fBmsg_perm.mode\fR is
1609 set."
1613 Otherwise, the corresponding permissions are denied.
1614 .SS "Module"
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.
1622 .SS "Multiplexor"
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
1640 session.
1641 .SS "Path Name"
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.
1681 .SS "Privilege"
1684 Having appropriate privilege means having the capability to override system
1685 restrictions.
1686 .SS "Process Group"
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
1698 process group ID.
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
1711 \fBwait\fR(3C).
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).
1726 .SS "Read Queue"
1729 In a stream, the message queue in a module or driver containing messages moving
1730 upstream.
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
1763 \fBexec\fR(2)).
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:
1772 .in +2
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 */
1782 .in -2
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
1791 following members:
1793 .in +2
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 */
1803 .in -2
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
1821 members:
1823 .in +2
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 */
1830 .in -2
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
1838 the semaphore.
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:
1859 .in +2
1861 \fB00400          READ by user
1862 00200   ALTER by user
1863 00040   READ by group
1864 00020   ALTER by group
1865 00004   READ by others
1866 00002   ALTER by others\fR
1868 .in -2
1872 Read and alter permissions for a \fBsemid\fR are granted to a process if one or
1873 more of the following are true:
1874 .RS +4
1876 .ie t \(bu
1877 .el o
1878 The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
1879 present in the effective set.
1881 .RS +4
1883 .ie t \(bu
1884 .el o
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.
1889 .RS +4
1891 .ie t \(bu
1892 .el o
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.
1897 .RS +4
1899 .ie t \(bu
1900 .el o
1901 The appropriate bit of the "other" portion (06) of \fBsem_perm.mode\fR is set.
1905 Otherwise, the corresponding permissions are denied.
1906 .SS "Session"
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
1914 creator.
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
1920 leader.
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
1932 session.
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:
1943 .in +2
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 */
1959 .in -2
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
1968 following members:
1970 .in +2
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 */
1980 .in -2
1984 The \fBshm_segsz\fR member specifies the size of the shared memory segment in
1985 bytes.
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
1997 segment attached.
2000 The \fBshm_atime\fR member is the time of the last \fBshmat()\fR operation (see
2001 \fBshmop\fR(2)).
2004 The \fBshm_dtime\fR member is the time of the last \fBshmdt()\fR operation (see
2005 \fBshmop\fR(2)).
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
2016 as follows:
2018 .in +2
2020 00400   READ by user
2021 00200   WRITE by user
2022 00040   READ by group
2023 00020   WRITE by group
2024 00004   READ by others
2025 00002   WRITE by others
2027 .in -2
2031 Read and write permissions for a \fBshmid\fR are granted to a process if one or
2032 more of the following are true:
2033 .RS +4
2035 .ie t \(bu
2036 .el o
2037 The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
2038 present in the effective set.
2040 .RS +4
2042 .ie t \(bu
2043 .el o
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.
2048 .RS +4
2050 .ie t \(bu
2051 .el o
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.
2056 .RS +4
2058 .ie t \(bu
2059 .el o
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
2072 process structure.
2073 .SS "\fBSTREAMS\fR"
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.
2081 .SS "Stream"
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.
2088 .SS "Stream Head"
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.
2095 .SS "Upstream"
2098 In a stream, the direction from driver to stream head.
2099 .SS "Write Queue"
2102 In a stream, the message queue in a module or driver containing messages moving
2103 downstream.
2104 .SH ACKNOWLEDGMENTS
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.
2133 .SH SEE ALSO
2136 \fBstandards\fR(5), \fBthreads\fR(5)