|
|
1.1 ! root 1: .TH INTRO 2 ! 2: .de {n ! 3: .HP ! 4: \\$1 \\$2 \\$3 ! 5: .br ! 6: .. ! 7: .SH NAME ! 8: intro \- introduction to system calls and error numbers ! 9: .SH SYNOPSIS ! 10: .B #include \|<errno.h> ! 11: .SH DESCRIPTION ! 12: This section ! 13: describes all of the system calls. ! 14: Most of these calls have one or more error returns. ! 15: An error condition is indicated by an otherwise ! 16: impossible returned value. ! 17: This is almost always \-1; ! 18: the individual descriptions specify the details. ! 19: An error number is also made available ! 20: in the external variable ! 21: .IR errno . ! 22: .I Errno\^ ! 23: is not cleared on successful calls, so it should be tested only ! 24: after an error has been indicated. ! 25: .PP ! 26: Each system call description attempts to ! 27: list all possible error numbers. ! 28: The following is a complete list of the error numbers and ! 29: their names as defined in ! 30: .BR <errno.h> . ! 31: .{n 1 \s-1EPERM\s+1 "Not owner" ! 32: Typically this error indicates ! 33: an attempt to modify a file in some way forbidden ! 34: except to its owner or super-user. ! 35: It is also returned for attempts ! 36: by ordinary users to do things ! 37: allowed only to the super-user. ! 38: .{n 2 \s-1ENOENT\s+1 "No such file or directory" ! 39: This error occurs when a file name is specified ! 40: and the file should exist but doesn't, or when one ! 41: of the directories in a path name does not exist. ! 42: .{n 3 \s-1ESRCH\s+1 "No such process" ! 43: No process can be found corresponding to that specified by ! 44: .I pid\^ ! 45: in ! 46: .I kill\^ ! 47: or ! 48: .IR ptrace . ! 49: .{n 4 \s-1EINTR\s+1 "Interrupted system call" ! 50: An asynchronous signal (such as interrupt or quit), ! 51: which the user has elected to catch, ! 52: occurred during a system call. ! 53: If execution is resumed ! 54: after processing the signal, ! 55: it will appear as if the interrupted system call ! 56: returned this error condition. ! 57: .{n 5 \s-1EIO\s+1 "I/O error" ! 58: Some physical I/O error has occurred. ! 59: This error may in some cases occur ! 60: on a call following the one to which it actually applies. ! 61: .{n 6 \s-1ENXIO\s+1 "No such device or address" ! 62: I/O on a special file refers to a subdevice which does not ! 63: exist, ! 64: or beyond the limits of the device. ! 65: It may also occur when, for example, a tape drive ! 66: is not on-line or no disk pack is loaded on a drive. ! 67: .{n 7 \s-1E2BIG\s+1 "Arg list too long" ! 68: An argument list longer than 5,120 bytes ! 69: is presented to a member of the ! 70: .I exec\^ ! 71: family. ! 72: .{n 8 \s-1ENOEXEC\s+1 "Exec format error" ! 73: A request is made to execute a file ! 74: which, although it has the appropriate permissions, ! 75: does not start with a valid magic number (see ! 76: .IR a.out (4)). ! 77: .{n 9 \s-1EBADF\s+1 "Bad file number" ! 78: Either a file descriptor refers to no ! 79: open file, ! 80: or a read (respectively, write) request is made to ! 81: a file which is open only for writing (respectively, reading). ! 82: .{n 10 \s-1ECHILD\s+1 "No child processes" ! 83: A ! 84: .I wait ! 85: was executed by a process that had no existing or unwaited-for child processes. ! 86: .{n 11 \s-1EAGAIN\s+1 "No more processes" ! 87: A ! 88: .I fork ! 89: failed because the system's process table is full ! 90: or the user is not allowed to create any more ! 91: processes. ! 92: .{n 12 \s-1ENOMEM\s+1 "Not enough space" ! 93: During an ! 94: .IR exec , ! 95: .IR brk , ! 96: or ! 97: .IR sbrk , ! 98: a program asks for more space than the system is able to supply. ! 99: This is not a temporary condition; the maximum space size ! 100: is a system parameter. ! 101: The error may also occur if the arrangement ! 102: of text, data, and stack segments ! 103: requires too many segmentation registers, or ! 104: if there is not enough swap space during a ! 105: .IR fork . ! 106: .{n 13 \s-1EACCES\s+1 "Permission denied" ! 107: An attempt was made to access a file in a way forbidden ! 108: by the protection system. ! 109: .{n 14 \s-1EFAULT\s+1 "Bad address" ! 110: The system encountered a hardware fault in attempting to ! 111: use an argument of a system call. ! 112: .{n 15 \s-1ENOTBLK\s+1 "Block device required" ! 113: A non-block file was mentioned where a block device was required, ! 114: e.g., in ! 115: .IR mount . ! 116: .{n 16 \s-1EBUSY\s+1 "Device or resource busy" ! 117: An attempt was made to mount a device that was already mounted or ! 118: an attempt was made to dismount a device ! 119: on which there is an active file ! 120: (open file, current directory, mounted-on file, active text segment). ! 121: It will also occur if an attempt is made to enable accounting when it is ! 122: already enabled. ! 123: The device or resource is currently unavailable. ! 124: .{n 17 \s-1EEXIST\s+1 "File exists" ! 125: An existing file was mentioned in an inappropriate context, ! 126: e.g., ! 127: .IR link . ! 128: .{n 18 \s-1EXDEV\s+1 "Cross-device link" ! 129: A link to a file on another device ! 130: was attempted. ! 131: .{n 19 \s-1ENODEV\s+1 "No such device" ! 132: An attempt was made to apply an inappropriate ! 133: system call to a device; ! 134: e.g., read a write-only device. ! 135: .{n 20 \s-1ENOTDIR\s+1 "Not a directory" ! 136: A non-directory was specified where a directory ! 137: is required, ! 138: for example in a path prefix or ! 139: as an argument to ! 140: .IR chdir (2). ! 141: .{n 21 \s-1EISDIR\s+1 "Is a directory" ! 142: An attempt was made to write on a directory. ! 143: .{n 22 \s-1EINVAL\s+1 "Invalid argument" ! 144: Some invalid argument (e.g., dismounting a non-mounted device; ! 145: mentioning an undefined signal in ! 146: .IR signal , ! 147: or ! 148: .IR kill ; ! 149: reading or writing a file for which ! 150: .I lseek\^ ! 151: has generated a negative pointer). ! 152: Also set by the math functions described in the (3M) entries ! 153: of this manual. ! 154: .{n 23 \s-1ENFILE\s+1 "File table overflow" ! 155: The system file table is full, ! 156: and temporarily no more ! 157: .I opens\^ ! 158: can be accepted. ! 159: .{n 24 \s-1EMFILE\s+1 "Too many open files" ! 160: No process may have more than 20 file descriptors open at a time. ! 161: .{n 25 \s-1ENOTTY\s+1 "Not a character device" ! 162: An attempt was made to \f2ioctl\fR(2) a file that ! 163: is not a special character device. ! 164: .{n 26 \s-1ETXTBSY\s+1 "Text file busy" ! 165: An attempt was made to execute a pure-procedure ! 166: program that is currently open for writing. ! 167: Also an attempt to open for writing a pure-procedure ! 168: program that is being executed. ! 169: .{n 27 \s-1EFBIG\s+1 "File too large" ! 170: The size of a file exceeded the maximum ! 171: file size (1,082,201,088 bytes) or ! 172: .SM ULIMIT\*S; ! 173: see ! 174: .IR ulimit (2). ! 175: .{n 28 \s-1ENOSPC\s+1 "No space left on device" ! 176: During a ! 177: .I write\^ ! 178: to an ordinary file, ! 179: there is no free space left on the device. ! 180: .{n 29 \s-1ESPIPE\s+1 "Illegal seek" ! 181: An ! 182: .I lseek\^ ! 183: was issued to a pipe. ! 184: .{n 30 \s-1EROFS\s+1 "Read-only file system" ! 185: An attempt to modify a file or directory ! 186: was made ! 187: on a device mounted read-only. ! 188: .{n 31 \s-1EMLINK\s+1 "Too many links" ! 189: An attempt to make more than the maximum number of links (1000) to a file. ! 190: .{n 32 \s-1EPIPE\s+1 "Broken pipe" ! 191: A write on a pipe for which there is no process ! 192: to read the data. ! 193: This condition normally generates a signal; ! 194: the error is returned if the signal is ignored. ! 195: .{n 33 \s-1EDOM\s+1 "Math argument" ! 196: The argument of a function in the math package (3M) ! 197: is out of the domain of the function. ! 198: .{n 34 \s-1ERANGE\s+1 "Result too large" ! 199: The value of a function in the math package (3M) ! 200: is not representable within machine precision. ! 201: .{n 35 \s-1EWOULDBLOCK\s+1 "Operation would block" ! 202: An operation which would cause a process to block was attempted ! 203: on a object in non-blocking mode (see \fIioctl\fP (2)). ! 204: .{n 36 \s-1EINPROGRESS\s+1 "Operation now in progress" ! 205: An operation which takes a long time to complete (such as ! 206: a \fIconnect\fP (2)) was attempted on a non-blocking object (see ! 207: \fIioctl\fP (2)). ! 208: .{n 37 \s-1EALREADY\s+1 "Operation already in progress" ! 209: An operation was attempted on a non-blocking object which already ! 210: had an operation in progress. ! 211: .{n 38 \s-1ENOTSOCK\s+1 "Socket operation on non-socket" ! 212: Self-explanatory. ! 213: .{n 39 \s-1EDESTADDRREQ\s+1 "Destination address required" ! 214: A required address was omitted from an operation on a socket. ! 215: .{n 40 \s-1EMSGSIZE\s+1 "Message too long" ! 216: A message sent on a socket was larger than the internal message buffer. ! 217: .{n 41 \s-1EPROTOTYPE\s+1 "Protocol wrong type for socket" ! 218: A protocol was specified which does not support the semantics of the ! 219: socket type requested. For example you cannot use the ARPA Internet ! 220: UDP protocol with type SOCK_STREAM. ! 221: .{n 42 \s-1ENOPROTOOPT\s+1 "Bad protocol option" ! 222: A bad option was specified in a ! 223: .IR getsockopt (2) ! 224: or ! 225: .IR setsockopt (2) ! 226: call. ! 227: .{n 43 \s-1EPROTONOSUPPORT\s+1 "Protocol not supported" ! 228: The protocol has not been configured into the ! 229: system or no implementation for it exists. ! 230: .{n 44 \s-1ESOCKTNOSUPPORT\s+1 "Socket type not supported" ! 231: The support for the socket type has not been configured into the ! 232: system or no implementation for it exists. ! 233: .{n 45 \s-1EOPNOTSUPP\s+1 "Operation not supported on socket" ! 234: For example, trying to \fIaccept\fP a connection on a datagram socket. ! 235: .{n 46 \s-1EPFNOSUPPORT\s+1 "Protocol family not supported" ! 236: The protocol family has not been configured into the ! 237: system or no implementation for it exists. ! 238: .{n 47 \s-1EAFNOSUPPORT\s+1 "Address family not supported by protocol family" ! 239: An address incompatible with the requested protocol was used. ! 240: For example, you shouldn't necessarily expect to be able to use PUP ! 241: Internet addresses with ARPA Internet protocols. ! 242: .{n 48 \s-1EADDRINUSE\s+1 "Address already in use" ! 243: Only one usage of each address is normally permitted. ! 244: .{n 49 \s-1EADDRNOTAVAIL\s+1 "Can't assign requested address" ! 245: Normally results from an attempt to create a socket with an ! 246: address not on this machine. ! 247: .{n 50 \s-1ENETDOWN\s+1 "Network is down" ! 248: A socket operation encountered a dead network. ! 249: .{n 51 \s-1ENETUNREACH\s+1 "Network is unreachable" ! 250: A socket operation was attempted to an unreachable network. ! 251: .{n 52 \s-1ENETRESET\s+1 "Network dropped connection on reset" ! 252: The host you were connected to crashed and rebooted. ! 253: .{n 53 \s-1ECONNABORTED\s+1 "Software caused connection abort" ! 254: A connection abort was caused internal to your host machine. ! 255: .{n 54 \s-1ECONNRESET\s+1 "Connection reset by peer" ! 256: A connection was forcibly closed by a peer. This normally ! 257: results from the peer executing a \fIshutdown\fP (2) call. ! 258: .{n 55 \s-1ENOBUFS\s+1 "No buffer space available" ! 259: An operation on a socket or pipe was not performed because ! 260: the system lacked sufficient buffer space. ! 261: .{n 56 \s-1EISCONN\s+1 "Socket is already connected" ! 262: A ! 263: .I connect ! 264: request was made on an already connected socket; or, ! 265: a ! 266: .I sendto ! 267: or ! 268: .I sendmsg ! 269: request on a connected socket specified a destination ! 270: other than the connected party. ! 271: .{n 57 \s-1ENOTCONN\s+1 "Socket is not connected" ! 272: An request to send or receive data was disallowed because ! 273: the socket is not connected. ! 274: .{n 58 \s-1ESHUTDOWN\s+1 "Can't send after socket shutdown" ! 275: A request to send data was disallowed because the socket ! 276: had already been shut down with a previous ! 277: .IR shutdown (2) ! 278: call. ! 279: .{n 59 \fIunused\fP ! 280: .{n 60 \s-1ETIMEDOUT\s+1 "Connection timed out" ! 281: A ! 282: .I connect ! 283: request failed because the connected party did not ! 284: properly respond after a period of time. (The timeout ! 285: period is dependent on the communication protocol.) ! 286: .{n 61 \s-1ECONNREFUSED\s+1 "Connection refused" ! 287: No connection could be made because the target machine actively ! 288: refused it. This usually results from trying to connect ! 289: to a service which is inactive on the foreign host. ! 290: .{n 62 \s-1ELOOP\s+1 "Too many levels of symbolic links" ! 291: A path name lookup involved more than 8 symbolic links. ! 292: .{n 63 \s-1ENAMETOOLONG\s+1 "File name too long" ! 293: A component of a path name exceeded 255 characters, or an entire ! 294: path name exceeded 1023 characters. ! 295: .{n 64 \s-1EHOSTDOWN\s+1 "Host is down" ! 296: The host machine is not up. ! 297: .{n 65 \s-1EHOSTUNREACH\s+1 "No route to host" ! 298: The host machine cannot be reached. ! 299: .{n 66 \s-1ENOTEMPTY\s+1 "Directory not empty" ! 300: A directory with entries other than \*(lq.\*(rq and \*(lq..\*(rq ! 301: was supplied to a remove directory or rename call. ! 302: .{n 67 \fIunused\fP ! 303: .{n 68 \s-1EUSERS\s+1 "Too many users" ! 304: The quota table is full. ! 305: .{n 69 \s-1EDQUOT\s+1 "Disc quota exceeded" ! 306: A process has exceeded its disk quota. ! 307: .{n 70 \s-1ENOMSG\s+1 "No message of desired type" ! 308: An attempt was made to receive a message of a type ! 309: that does not exist on the specified message queue; see ! 310: .IR msgop (2). ! 311: .{n 71 \s-1EIDRM\s+1 "Identifier Removed" ! 312: This error is returned to processes that resume execution due to the removal ! 313: of an identifier from the file system's name space (see ! 314: .IR msgctl "(2), " semctl "(2), and " shmctl (2)). ! 315: .SH "DEFINITIONS" ! 316: .SS "Process \s-1ID\s+1" ! 317: Each active process in the system is uniquely identified by a ! 318: positive integer called a process ! 319: .SM ID\*S. ! 320: The range of this ! 321: .SM ID ! 322: is from 1 to 30,000. ! 323: .SS "Parent Process \s-1ID\s+1" ! 324: A new process is created by a currently active ! 325: process; see ! 326: .IR fork (2). ! 327: The parent process ! 328: .SM ID ! 329: of a process is the process ! 330: .SM ID ! 331: of its creator. ! 332: .SS "Process Group \s-1ID\s+1" ! 333: Each active process is a member of a process group that is ! 334: identified by a positive integer called the process group ! 335: .SM ID\*S. ! 336: This ! 337: .SM ID ! 338: is the process ! 339: .SM ID ! 340: of the group leader. ! 341: This grouping permits the signaling of related processes; see ! 342: .IR kill (2). ! 343: .SS "Tty Group \s-1ID\s+1" ! 344: Each active process can be a member of a terminal group that ! 345: is identified by a positive integer called the tty group ! 346: .SM ID\*S. ! 347: This grouping is used to terminate a group of related processes upon termination ! 348: of one of the processes in the group; see ! 349: .IR exit (2) ! 350: and ! 351: .IR signal (2). ! 352: .SS "Real User \s-1ID\s+1 and Real Group \s-1ID\s+1" ! 353: Each user allowed on the system is ! 354: identified by a positive integer called a real user ! 355: .SM ID\*S. ! 356: .PP ! 357: Each user is also a member of a group. ! 358: The group is identified by a positive integer called the real group ! 359: .SM ID\*S. ! 360: .PP ! 361: An active process has a real user ! 362: .SM ID ! 363: and real group ! 364: .SM ID ! 365: that are set to the real user ! 366: .SM ID ! 367: and real group ! 368: .SM ID\*S, ! 369: respectively, of the user responsible for the creation of the process. ! 370: .SS "Effective User \s-1ID\s+1 and Effective Group \s-1ID\s+1" ! 371: An active process has an effective user ! 372: .SM ID ! 373: and an effective group ! 374: .SM ID ! 375: that are used to determine file access permissions (see below). ! 376: The effective ! 377: user ! 378: .SM ID ! 379: and effective group ! 380: .SM ID ! 381: are equal to the process's real user ! 382: .SM ID ! 383: and real group ! 384: .SM ID ! 385: respectively, unless the process ! 386: or one of its ancestors evolved from a file that had the set-user-\s-1ID\s+1 ! 387: bit or set-group ! 388: .SM ID ! 389: bit set; see ! 390: .IR exec (2). ! 391: .SS Super-user ! 392: A process is recognized as a ! 393: .I super-user\^ ! 394: process and is granted special privileges if its effective user ! 395: .SM ID ! 396: is 0. ! 397: .SS "Special Processes" ! 398: The processes with a process ! 399: .SM ID ! 400: of 0 and a process ! 401: .SM ID ! 402: of 1 are special processes and are referred to as ! 403: .IR proc0 " and " proc1. ! 404: .PP ! 405: .I Proc0\^ ! 406: is the scheduler. ! 407: .I Proc1\^ ! 408: is the initialization process ! 409: .RI ( init ). ! 410: Proc1 is the ancestor of every other ! 411: process in the system and is used to control the process structure. ! 412: .SS File Descriptor ! 413: A file descriptor is a small integer used ! 414: to do \s-1I/O\s+1 on a file. ! 415: The value of a file descriptor is from ! 416: 0 to 19. ! 417: A process may have no more than 20 file descriptors (0-19) ! 418: open simultaneously. ! 419: A file descriptor is returned by system calls such as ! 420: \f2open\fR(2), ! 421: or \f2pipe\fR(2). ! 422: The file descriptor is used as an ! 423: argument by calls such as ! 424: \f2read\fR(2), ! 425: \f2write\fR(2), ! 426: \f2ioctl\fR(2), ! 427: and ! 428: \f2close\fR(2). ! 429: .SS "File Name" ! 430: Names consisting of 1 to 14 characters may be used to name an ordinary file, ! 431: special file or directory. ! 432: .PP ! 433: These characters may be selected from the set of all character values ! 434: excluding \e0 (null) and the ! 435: .SM ASCII ! 436: code for ! 437: .B / ! 438: (slash). ! 439: .PP ! 440: Note that it is generally unwise to use ! 441: .BR "*" , ! 442: .BR "?" , ! 443: .BR "[" , ! 444: or ! 445: .B "]" ! 446: as part of file names because of the special meaning attached to these ! 447: characters by the shell. ! 448: See ! 449: .IR sh (1). ! 450: Although permitted, it is advisable to avoid the use of unprintable ! 451: characters in file names. ! 452: .SS "Path Name and Path Prefix" ! 453: A path name is a null-terminated character string ! 454: starting with an optional slash ! 455: .RB ( / ), ! 456: followed by ! 457: zero or more directory names separated by slashes, optionally followed ! 458: by a file name. ! 459: .PP ! 460: More precisely, a path name is a null-terminated character string ! 461: constructed as follows: ! 462: .PP ! 463: .RS ! 464: <path-name>::=<file-name>\(bv<path-prefix><file-name>|/ ! 465: .br ! 466: <path-prefix>::=<rtprefix>\(bv/<rtprefix> ! 467: .br ! 468: <rtprefix>::=<dirname>/\(bv<rtprefix><dirname>/ ! 469: .RE ! 470: .PP ! 471: where <file-name> is a string of 1 to 14 ! 472: characters other than the ! 473: .SM ASCII ! 474: slash and null, and ! 475: <dirname> is a string of 1 to 14 characters ! 476: (other than the ! 477: .SM ASCII ! 478: slash and null) ! 479: that names a directory. ! 480: .PP ! 481: If a path name begins with a slash, the path search begins at the ! 482: .I root\^ ! 483: directory. ! 484: Otherwise, the search begins from the current working directory. ! 485: .PP ! 486: A slash by itself names the root directory. ! 487: .PP ! 488: Unless specifically stated otherwise, ! 489: the null path name is treated as if it named ! 490: a non-existent file. ! 491: .SS Directory ! 492: .PP ! 493: Directory entries are called links. ! 494: By convention, a directory contains at least two links, ! 495: .B . ! 496: and ! 497: .BR .. , ! 498: referred to as ! 499: .I dot\^ ! 500: and ! 501: .I dot-dot\^ ! 502: respectively. ! 503: Dot refers to the directory itself and dot-dot refers to its parent ! 504: directory. ! 505: .SS "Root Directory and Current Working Directory" ! 506: Each process has associated with it a concept of a root directory and ! 507: a current working directory for the purpose of resolving path name searches. ! 508: The root directory of a process need not be the root directory of the root ! 509: file system. ! 510: .SS "File Access Permissions" ! 511: .PP ! 512: Read, write, and execute/search permissions on a file are ! 513: granted to a process if one or more of the following are true: ! 514: .IP ! 515: The effective user ! 516: .SM ID ! 517: of the process ! 518: is super-user. ! 519: .IP ! 520: The effective user ! 521: .SM ID ! 522: of the process ! 523: matches the user ! 524: .SM ID ! 525: of the owner of the file ! 526: and the appropriate access bit of the ! 527: ``owner'' portion (0700) of the file mode is set. ! 528: .IP ! 529: The effective user ! 530: .SM ID ! 531: of the process ! 532: does not match the user ! 533: .SM ID ! 534: of the owner of the file, ! 535: and the effective group ! 536: .SM ID ! 537: of the process ! 538: matches the group of the file and ! 539: the appropriate access bit of the ``group'' portion ! 540: (070) of the file mode is set. ! 541: .IP ! 542: The effective user ! 543: .SM ID ! 544: of the process ! 545: does not match the user ! 546: .SM ID ! 547: of the owner of the file, ! 548: and the effective group ! 549: .SM ID ! 550: of the process ! 551: does not match the group ! 552: .SM ID ! 553: of the file, ! 554: and the appropriate access bit of the ``other'' portion (07) of the ! 555: file mode is set. ! 556: .PP ! 557: Otherwise, the corresponding permissions are denied. ! 558: .SS "Message Queue Identifier" ! 559: A message queue identifier (msqid) is a unique positive integer created by a ! 560: .IR msgget (2) ! 561: system call. ! 562: Each msqid has a message queue and a data structure associated with it. ! 563: The data structure is referred to as ! 564: .I msqid_ds ! 565: and contains the following members: ! 566: .PP ! 567: .RS ! 568: .ta 8n 28n ! 569: .nf ! 570: struct ipc_perm msg_perm; /\(** operation permission struct \(**/ ! 571: ushort msg_cbytes; /\(** current number of bytes on q \(**/ ! 572: ushort msg_qnum; /\(** number of msgs on q \(**/ ! 573: ushort msg_qbytes; /\(** max number of bytes on q \(**/ ! 574: ushort msg_lspid; /\(** pid of last msgsnd operation \(**/ ! 575: ushort msg_lrpid; /\(** pid of last msgrcv operation \(**/ ! 576: time_t msg_stime; /\(** last msgsnd time \(**/ ! 577: time_t msg_rtime; /\(** last msgrcv time \(**/ ! 578: time_t msg_ctime; /\(** last change time \(**/ ! 579: /\(** Times measured in secs since \(**/ ! 580: /\(** 00:00:00 \s-1GMT\s+1, Jan. 1, 1970 \(**/ ! 581: .fi ! 582: .RE ! 583: .PP ! 584: .B Msg_perm ! 585: is an ipc_perm structure that ! 586: specifies the message operation permission (see below). ! 587: This structure includes the following members: ! 588: .PP ! 589: .RS ! 590: .ta 8n 20n ! 591: .nf ! 592: ushort cuid; /\(** creator user id \(**/ ! 593: ushort cgid; /\(** creator group id \(**/ ! 594: ushort uid; /\(** user id \(**/ ! 595: ushort gid; /\(** group id \(**/ ! 596: ushort mode; /\(** r/w permission \(**/ ! 597: .PP ! 598: .fi ! 599: .RE ! 600: .B Msg_cbytes ! 601: is the current number of bytes on the queue. ! 602: .B Msg_qnum ! 603: is the number of messages currently on the queue. ! 604: .B Msg_qbytes ! 605: is the maximum number of bytes allowed on the queue. ! 606: .B Msg_lspid ! 607: is the process id of the last process that performed a ! 608: .IR msgsnd " operation." ! 609: .B Msg_lrpid ! 610: is the process id of the last process that performed a ! 611: .IR msgrcv " operation." ! 612: .B Msg_stime ! 613: is the time of the last ! 614: .I msgsnd ! 615: operation, ! 616: .B msg_rtime ! 617: is the time of the last ! 618: .I msgrcv ! 619: operation, and ! 620: .B msg_ctime ! 621: is the time of the last ! 622: .IR msgctl (2) ! 623: operation that changed a member of the above structure. ! 624: .SS "Message Operation Permissions" ! 625: In the ! 626: .IR msgop "(2) and " msgctl (2) ! 627: system call descriptions, the permission required ! 628: for an operation is given as "{token}", where "token" is the type ! 629: of permission needed interpreted as follows: ! 630: .PP ! 631: .RS 0.75i ! 632: .PD 0 ! 633: .TP 1.50i ! 634: 00400 ! 635: Read by user ! 636: .TP ! 637: 00200 ! 638: Write by user ! 639: .TP ! 640: 00060 ! 641: Read, Write by group ! 642: .TP ! 643: 00006 ! 644: Read, Write by others ! 645: .RE ! 646: .PD ! 647: .PP ! 648: Read and Write permissions on a msqid are ! 649: granted to a process if one or more of the following are true: ! 650: .IP ! 651: The effective user ! 652: .SM ID ! 653: of the process ! 654: is super-user. ! 655: .IP ! 656: The effective user ! 657: .SM ID ! 658: of the process ! 659: matches ! 660: .B msg_perm.[c]uid ! 661: in the data structure associated with ! 662: .I msqid ! 663: and the appropriate bit of the ! 664: ``user'' portion (0600) of ! 665: .B msg_perm.mode ! 666: is set. ! 667: .IP ! 668: The effective user ! 669: .SM ID ! 670: of the process ! 671: does not match ! 672: .B msg_perm.[c]uid ! 673: and the effective group ! 674: .SM ID ! 675: of the process ! 676: matches ! 677: .B msg_perm.[c]gid ! 678: and the appropriate bit of the ``group'' portion ! 679: (060) of ! 680: .B msg_perm.mode ! 681: is set. ! 682: .IP ! 683: The effective user ! 684: .SM ID ! 685: of the process ! 686: does not match ! 687: .B msg_perm.[c]uid ! 688: and the effective group ! 689: .SM ID ! 690: of the process ! 691: does not match ! 692: .B msg_perm.[c]gid ! 693: and the appropriate bit of the ``other'' portion (06) of ! 694: .B msg_perm.mode ! 695: is set. ! 696: .PP ! 697: Otherwise, the corresponding permissions are denied. ! 698: .SS "Semaphore Identifier" ! 699: A semaphore identifier (semid) is a unique positive integer created by a ! 700: .IR semget (2) ! 701: system call. ! 702: Each semid has a set of semaphores and a data structure associated with it. ! 703: The data structure is referred to as ! 704: .I semid_ds ! 705: and contains the following members: ! 706: .PP ! 707: .RS ! 708: .ta 8n 28n ! 709: .nf ! 710: struct ipc_perm sem_perm; /\(** operation permission struct \(**/ ! 711: ushort sem_nsems; /\(** number of sems in set \(**/ ! 712: time_t sem_otime; /\(** last operation time \(**/ ! 713: time_t sem_ctime; /\(** last change time \(**/ ! 714: /\(** Times measured in secs since \(**/ ! 715: /\(** 00:00:00 \s-1GMT\s+1, Jan. 1, 1970 \(**/ ! 716: .fi ! 717: .RE ! 718: .PP ! 719: .B Sem_perm ! 720: is an ipc_perm structure that ! 721: specifies the semaphore operation permission (see below). ! 722: This structure includes the following members: ! 723: .PP ! 724: .RS ! 725: .ta 8n 20n ! 726: .nf ! 727: ushort cuid; /\(** creator user id \(**/ ! 728: ushort cgid; /\(** creator group id \(**/ ! 729: ushort uid; /\(** user id \(**/ ! 730: ushort gid; /\(** group id \(**/ ! 731: ushort mode; /\(** r/a permission \(**/ ! 732: .PP ! 733: .fi ! 734: .RE ! 735: The value of ! 736: .B sem_nsems ! 737: is equal to the number of semaphores in the set. ! 738: Each semaphore in the set is referenced by a positive integer ! 739: referred to as a ! 740: .IR sem_num . ! 741: Sem_num values run sequentially from 0 to the value of sem_nsems minus 1. ! 742: .B Sem_otime ! 743: is the time of the last ! 744: .IR semop (2) ! 745: operation, and ! 746: .B sem_ctime ! 747: is the time of the last ! 748: .IR semctl (2) ! 749: operation that changed a member of the above structure. ! 750: .PP ! 751: A semaphore is a data structure that contains the following members: ! 752: .PP ! 753: .RS ! 754: .ta 8n 20n ! 755: .nf ! 756: ushort semval; /\(** semaphore value \(**/ ! 757: short sempid; /\(** pid of last operation \(**/ ! 758: ushort semncnt; /\(** # awaiting semval > cval \(**/ ! 759: ushort semzcnt; /\(** # awaiting semval = 0 \(**/ ! 760: .fi ! 761: .RE ! 762: .PP ! 763: .B Semval ! 764: is a non-negative integer. ! 765: .B Sempid ! 766: is equal to the process ! 767: .SM ID ! 768: of the last process that performed a semaphore operation on this semaphore. ! 769: .B Semncnt ! 770: is a count of the number of processes that are currently suspended ! 771: awaiting this semaphore's semval to become greater than its current value. ! 772: .B Semzcnt ! 773: is a count of the number of processes that are currently suspended ! 774: awaiting this semaphore's semval to become zero. ! 775: .SS "Semaphore Operation Permissions" ! 776: In the ! 777: .IR semop "(2) and " semctl (2) ! 778: system call descriptions, the permission required ! 779: for an operation is given as "{token}", where "token" is the type ! 780: of permission needed interpreted as follows: ! 781: .PP ! 782: .RS 0.75i ! 783: .PD 0 ! 784: .TP 1.50i ! 785: 00400 ! 786: Read by user ! 787: .TP ! 788: 00200 ! 789: Alter by user ! 790: .TP ! 791: 00060 ! 792: Read, Alter by group ! 793: .TP ! 794: 00006 ! 795: Read, Alter by others ! 796: .RE ! 797: .PD ! 798: .PP ! 799: Read and Alter permissions on a semid are ! 800: granted to a process if one or more of the following are true: ! 801: .IP ! 802: The effective user ! 803: .SM ID ! 804: of the process ! 805: is super-user. ! 806: .IP ! 807: The effective user ! 808: .SM ID ! 809: of the process ! 810: matches ! 811: .B sem_perm.[c]uid ! 812: in the data structure associated with ! 813: .I semid ! 814: and the appropriate bit of the ! 815: ``user'' portion (0600) of ! 816: .B sem_perm.mode ! 817: is set. ! 818: .IP ! 819: The effective user ! 820: .SM ID ! 821: of the process ! 822: does not match ! 823: .B sem_perm.[c]uid ! 824: and the effective group ! 825: .SM ID ! 826: of the process ! 827: matches ! 828: .B sem_perm.[c]gid ! 829: and the appropriate bit of the ``group'' portion ! 830: (060) of ! 831: .B sem_perm.mode ! 832: is set. ! 833: .IP ! 834: The effective user ! 835: .SM ID ! 836: of the process ! 837: does not match ! 838: .B sem_perm.[c]uid ! 839: and the effective group ! 840: .SM ID ! 841: of the process ! 842: does not match ! 843: .B sem_perm.[c]gid ! 844: and the appropriate bit of the ``other'' portion (06) of ! 845: .B sem_perm.mode ! 846: is set. ! 847: .PP ! 848: Otherwise, the corresponding permissions are denied. ! 849: .SS "Shared Memory Identifier" ! 850: A shared memory identifier (shmid) is a unique positive integer created by a ! 851: .IR shmget (2) ! 852: system call. ! 853: Each shmid has a segment of memory (referred to as a shared memory segment) ! 854: and a data structure associated with it. ! 855: The data structure is referred to as ! 856: .I shmid_ds ! 857: and contains the following members: ! 858: .PP ! 859: .RS ! 860: .ta 8n 28n ! 861: .nf ! 862: struct ipc_perm shm_perm; /\(** operation permission struct \(**/ ! 863: int shm_segsz; /\(** size of segment \(**/ ! 864: struct proc *shm_perm; /\(** address of linked proc \(**/ ! 865: short shm_pidx; /\(** index of this segment \(**/ ! 866: ushort shm_cpid; /\(** creator pid \(**/ ! 867: ushort shm_lpid; /\(** pid of last operation \(**/ ! 868: short shm_cnattch; /\(** number of loaded attaches \(**/ ! 869: short shm_nattch; /\(** number of current attaches \(**/ ! 870: time_t shm_atime; /\(** last attach time \(**/ ! 871: time_t shm_dtime; /\(** last detach time \(**/ ! 872: time_t shm_ctime; /\(** last change time \(**/ ! 873: /\(** Times measured in secs since \(**/ ! 874: /\(** 00:00:00 \s-1GMT\s+1, Jan. 1, 1970 \(**/ ! 875: .fi ! 876: .RE ! 877: .PP ! 878: .B Shm_perm ! 879: is an ipc_perm structure that ! 880: specifies the shared memory operation permission (see below). ! 881: This structure includes the following members: ! 882: .PP ! 883: .RS ! 884: .ta 8n 20n ! 885: .nf ! 886: ushort cuid; /\(** creator user id \(**/ ! 887: ushort cgid; /\(** creator group id \(**/ ! 888: ushort uid; /\(** user id \(**/ ! 889: ushort gid; /\(** group id \(**/ ! 890: ushort mode; /\(** r/w permission \(**/ ! 891: .PP ! 892: .fi ! 893: .RE ! 894: .B Shm_segsz ! 895: specifies the size of the shared memory segment. ! 896: .B Shm_proc ! 897: is the address of the first process linked to this segment. ! 898: .B Shm_pidx ! 899: is the index of this shared memory segment in the shared memory table belonging ! 900: to that process. ! 901: .B Shm_cpid ! 902: is the process id of the process that created the shared memory identifier. ! 903: .B Shm_lpid ! 904: is the process id of the last process that performed a ! 905: .IR shmop "(2) operation." ! 906: .B Shm_cnattch ! 907: is the number of in-core processes attached to this segment. ! 908: .B Shm_nattch ! 909: is the number of processes that currently have this segment attached. ! 910: .B Shm_atime ! 911: is the time of the last ! 912: .I shmat ! 913: operation, ! 914: .B shm_dtime ! 915: is the time of the last ! 916: .I shmdt ! 917: operation, ! 918: and ! 919: .B shm_ctime ! 920: is the time of the last ! 921: .IR shmctl (2) ! 922: operation that changed one of the members of the above structure. ! 923: .SS "Shared Memory Operation Permissions" ! 924: In the ! 925: .IR shmop "(2) and " shmctl (2) ! 926: system call descriptions, the permission required ! 927: for an operation is given as "{token}", where "token" is the type ! 928: of permission needed interpreted as follows: ! 929: .PP ! 930: .RS 0.75i ! 931: .PD 0 ! 932: .TP 1.50i ! 933: 00400 ! 934: Read by user ! 935: .TP ! 936: 00200 ! 937: Write by user ! 938: .TP ! 939: 00060 ! 940: Read, Write by group ! 941: .TP ! 942: 00006 ! 943: Read, Write by others ! 944: .RE ! 945: .PD ! 946: .PP ! 947: Read and Write permissions on a shmid are ! 948: granted to a process if one or more of the following are true: ! 949: .IP ! 950: The effective user ! 951: .SM ID ! 952: of the process ! 953: is super-user. ! 954: .IP ! 955: The effective user ! 956: .SM ID ! 957: of the process ! 958: matches ! 959: .B shm_perm.[c]uid ! 960: in the data structure associated with ! 961: .I shmid ! 962: and the appropriate bit of the ! 963: ``user'' portion (0600) of ! 964: .B shm_perm.mode ! 965: is set. ! 966: .IP ! 967: The effective user ! 968: .SM ID ! 969: of the process ! 970: does not match ! 971: .B shm_perm.[c]uid ! 972: and the effective group ! 973: .SM ID ! 974: of the process ! 975: matches ! 976: .B shm_perm.[c]gid ! 977: and the appropriate bit of the ``group'' portion ! 978: (060) of ! 979: .B shm_perm.mode ! 980: is set. ! 981: .IP ! 982: The effective user ! 983: .SM ID ! 984: of the process ! 985: does not match ! 986: .B shm_perm.[c]uid ! 987: and the effective group ! 988: .SM ID ! 989: of the process ! 990: does not match ! 991: .B shm_perm.[c]gid ! 992: and the appropriate bit of the ``other'' portion (06) of ! 993: .B shm_perm.mode ! 994: is set. ! 995: .PP ! 996: Otherwise, the corresponding permissions are denied. ! 997: .SS "System Five Interfaces Library" ! 998: The following system calls constitute the system 5 interfaces library: ! 999: .PP ! 1000: .RS ! 1001: .IR msgctl , ! 1002: .br ! 1003: .IR msgget , ! 1004: .br ! 1005: .IR msgrcv , ! 1006: .br ! 1007: .IR msgsnd , ! 1008: .br ! 1009: .IR plock , ! 1010: .br ! 1011: .IR semctl , ! 1012: .br ! 1013: .IR semget , ! 1014: .br ! 1015: .IR semop , ! 1016: .br ! 1017: .IR shmat , ! 1018: .br ! 1019: .IR shmctl , ! 1020: .br ! 1021: .IR shmdt , ! 1022: .br ! 1023: .IR shmget , ! 1024: .br ! 1025: .IR ulimit , ! 1026: .br ! 1027: .IR uname , ! 1028: .br ! 1029: .IR ustat , ! 1030: .RE ! 1031: .SH NOTES ! 1032: This manual page replaces the 4.2BSD manual page. ! 1033: .SH FILES ! 1034: .nf ! 1035: /usr/lib/libsys5.a System Five Interfaces Library ! 1036: .fi ! 1037: .SH SEE ALSO ! 1038: close(2), ! 1039: ioctl(2), ! 1040: open(2), ! 1041: pipe(2), ! 1042: read(2), ! 1043: write(2), ! 1044: intro(3). ! 1045: .\" @(#)intro.2 6.2 of 9/6/83
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.