summaryrefslogtreecommitdiff
path: root/usr/src/man/man2
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2011-03-14 14:05:30 -0400
committerRichard Lowe <richlowe@richlowe.net>2011-03-14 14:05:30 -0400
commitc10c16dec587a0662068f6e2991c29ed3a9db943 (patch)
treef414286f4bba41d75683ed4fbbaa6bfa4bf7fabd /usr/src/man/man2
parent68caef18a23a498d9e3017b983562c0f4fd8ab23 (diff)
downloadillumos-joyent-c10c16dec587a0662068f6e2991c29ed3a9db943.tar.gz
243 system manual pages should live with the software
Reviewed by: garrett@nexenta.com Reviewed by: gwr@nexenta.com Reviewed by: trisk@opensolaris.org Approved by: gwr@nexenta.com --HG-- extra : rebase_source : 0c599d0bec0dc8865fbba67721a7a6cd6b1feefb
Diffstat (limited to 'usr/src/man/man2')
-rw-r--r--usr/src/man/man2/Intro.22348
-rw-r--r--usr/src/man/man2/Makefile380
-rw-r--r--usr/src/man/man2/__sparc_utrap_install.2416
-rw-r--r--usr/src/man/man2/_lwp_cond_signal.277
-rw-r--r--usr/src/man/man2/_lwp_cond_wait.2220
-rw-r--r--usr/src/man/man2/_lwp_info.2100
-rw-r--r--usr/src/man/man2/_lwp_kill.282
-rw-r--r--usr/src/man/man2/_lwp_mutex_lock.2102
-rw-r--r--usr/src/man/man2/_lwp_self.241
-rw-r--r--usr/src/man/man2/_lwp_sema_wait.2136
-rw-r--r--usr/src/man/man2/_lwp_suspend.279
-rw-r--r--usr/src/man/man2/access.2379
-rw-r--r--usr/src/man/man2/acct.2150
-rw-r--r--usr/src/man/man2/acl.2308
-rw-r--r--usr/src/man/man2/adjtime.2113
-rw-r--r--usr/src/man/man2/alarm.276
-rw-r--r--usr/src/man/man2/audit.2134
-rw-r--r--usr/src/man/man2/auditon.2655
-rw-r--r--usr/src/man/man2/brk.2151
-rw-r--r--usr/src/man/man2/chdir.2239
-rw-r--r--usr/src/man/man2/chmod.2503
-rw-r--r--usr/src/man/man2/chown.2367
-rw-r--r--usr/src/man/man2/chroot.2204
-rw-r--r--usr/src/man/man2/close.2270
-rw-r--r--usr/src/man/man2/creat.296
-rw-r--r--usr/src/man/man2/dup.2132
-rw-r--r--usr/src/man/man2/exec.2765
-rw-r--r--usr/src/man/man2/exit.2260
-rw-r--r--usr/src/man/man2/fcntl.21034
-rw-r--r--usr/src/man/man2/fork.2535
-rw-r--r--usr/src/man/man2/fpathconf.2425
-rw-r--r--usr/src/man/man2/getacct.2180
-rw-r--r--usr/src/man/man2/getaudit.2156
-rw-r--r--usr/src/man/man2/getauid.2105
-rw-r--r--usr/src/man/man2/getcontext.2104
-rw-r--r--usr/src/man/man2/getdents.2146
-rw-r--r--usr/src/man/man2/getgroups.2132
-rw-r--r--usr/src/man/man2/getisax.288
-rw-r--r--usr/src/man/man2/getitimer.2197
-rw-r--r--usr/src/man/man2/getlabel.2200
-rw-r--r--usr/src/man/man2/getmsg.2256
-rw-r--r--usr/src/man/man2/getpflags.2168
-rw-r--r--usr/src/man/man2/getpid.2136
-rw-r--r--usr/src/man/man2/getppriv.2156
-rw-r--r--usr/src/man/man2/getrlimit.2336
-rw-r--r--usr/src/man/man2/getsid.282
-rw-r--r--usr/src/man/man2/getuid.276
-rw-r--r--usr/src/man/man2/getustack.284
-rw-r--r--usr/src/man/man2/ioctl.2204
-rw-r--r--usr/src/man/man2/issetugid.285
-rw-r--r--usr/src/man/man2/kill.2145
-rw-r--r--usr/src/man/man2/link.2260
-rw-r--r--usr/src/man/man2/llseek.2146
-rw-r--r--usr/src/man/man2/lseek.2204
-rw-r--r--usr/src/man/man2/memcntl.2473
-rw-r--r--usr/src/man/man2/meminfo.2299
-rw-r--r--usr/src/man/man2/mincore.282
-rw-r--r--usr/src/man/man2/mkdir.2298
-rw-r--r--usr/src/man/man2/mknod.2382
-rw-r--r--usr/src/man/man2/mmap.2954
-rw-r--r--usr/src/man/man2/mmapobj.2407
-rw-r--r--usr/src/man/man2/mount.2411
-rw-r--r--usr/src/man/man2/mprotect.2165
-rw-r--r--usr/src/man/man2/msgctl.2179
-rw-r--r--usr/src/man/man2/msgget.2181
-rw-r--r--usr/src/man/man2/msgids.2122
-rw-r--r--usr/src/man/man2/msgrcv.2261
-rw-r--r--usr/src/man/man2/msgsnap.2217
-rw-r--r--usr/src/man/man2/msgsnd.2250
-rw-r--r--usr/src/man/man2/munmap.278
-rw-r--r--usr/src/man/man2/nice.2115
-rw-r--r--usr/src/man/man2/ntp_adjtime.2108
-rw-r--r--usr/src/man/man2/ntp_gettime.280
-rw-r--r--usr/src/man/man2/open.21001
-rw-r--r--usr/src/man/man2/p_online.2214
-rw-r--r--usr/src/man/man2/pause.277
-rw-r--r--usr/src/man/man2/pcsample.293
-rw-r--r--usr/src/man/man2/pipe.2109
-rw-r--r--usr/src/man/man2/poll.2303
-rw-r--r--usr/src/man/man2/priocntl.21580
-rw-r--r--usr/src/man/man2/priocntlset.2219
-rw-r--r--usr/src/man/man2/processor_bind.2174
-rw-r--r--usr/src/man/man2/processor_info.294
-rw-r--r--usr/src/man/man2/profil.2130
-rw-r--r--usr/src/man/man2/pset_bind.2196
-rw-r--r--usr/src/man/man2/pset_create.2189
-rw-r--r--usr/src/man/man2/pset_info.2117
-rw-r--r--usr/src/man/man2/pset_list.285
-rw-r--r--usr/src/man/man2/pset_setattr.2129
-rw-r--r--usr/src/man/man2/putmsg.2290
-rw-r--r--usr/src/man/man2/read.2546
-rw-r--r--usr/src/man/man2/readlink.2208
-rw-r--r--usr/src/man/man2/rename.2421
-rw-r--r--usr/src/man/man2/resolvepath.2132
-rw-r--r--usr/src/man/man2/rmdir.2229
-rw-r--r--usr/src/man/man2/semctl.2356
-rw-r--r--usr/src/man/man2/semget.2189
-rw-r--r--usr/src/man/man2/semids.2119
-rw-r--r--usr/src/man/man2/semop.2418
-rw-r--r--usr/src/man/man2/setpgid.2145
-rw-r--r--usr/src/man/man2/setpgrp.257
-rw-r--r--usr/src/man/man2/setrctl.2301
-rw-r--r--usr/src/man/man2/setregid.2104
-rw-r--r--usr/src/man/man2/setreuid.2109
-rw-r--r--usr/src/man/man2/setsid.290
-rw-r--r--usr/src/man/man2/settaskid.2129
-rw-r--r--usr/src/man/man2/setuid.2144
-rw-r--r--usr/src/man/man2/shmctl.2240
-rw-r--r--usr/src/man/man2/shmget.2212
-rw-r--r--usr/src/man/man2/shmids.2119
-rw-r--r--usr/src/man/man2/shmop.2268
-rw-r--r--usr/src/man/man2/sigaction.2256
-rw-r--r--usr/src/man/man2/sigaltstack.2205
-rw-r--r--usr/src/man/man2/sigpending.267
-rw-r--r--usr/src/man/man2/sigprocmask.2115
-rw-r--r--usr/src/man/man2/sigsend.2242
-rw-r--r--usr/src/man/man2/sigsuspend.2109
-rw-r--r--usr/src/man/man2/sigwait.2245
-rw-r--r--usr/src/man/man2/stat.2699
-rw-r--r--usr/src/man/man2/statvfs.2294
-rw-r--r--usr/src/man/man2/stime.258
-rw-r--r--usr/src/man/man2/swapctl.2344
-rw-r--r--usr/src/man/man2/symlink.2219
-rw-r--r--usr/src/man/man2/sync.254
-rw-r--r--usr/src/man/man2/sysfs.2140
-rw-r--r--usr/src/man/man2/sysinfo.2379
-rw-r--r--usr/src/man/man2/time.255
-rw-r--r--usr/src/man/man2/times.2109
-rw-r--r--usr/src/man/man2/uadmin.2424
-rw-r--r--usr/src/man/man2/ulimit.2150
-rw-r--r--usr/src/man/man2/umask.254
-rw-r--r--usr/src/man/man2/umount.2235
-rw-r--r--usr/src/man/man2/uname.288
-rw-r--r--usr/src/man/man2/unlink.2301
-rw-r--r--usr/src/man/man2/ustat.2132
-rw-r--r--usr/src/man/man2/utime.2224
-rw-r--r--usr/src/man/man2/utimes.2258
-rw-r--r--usr/src/man/man2/uucopy.272
-rw-r--r--usr/src/man/man2/vfork.2186
-rw-r--r--usr/src/man/man2/vhangup.238
-rw-r--r--usr/src/man/man2/waitid.2231
-rw-r--r--usr/src/man/man2/write.2635
-rw-r--r--usr/src/man/man2/yield.226
143 files changed, 35665 insertions, 0 deletions
diff --git a/usr/src/man/man2/Intro.2 b/usr/src/man/man2/Intro.2
new file mode 100644
index 0000000000..ad92060030
--- /dev/null
+++ b/usr/src/man/man2/Intro.2
@@ -0,0 +1,2348 @@
+'\" te
+.\" Copyright 1989 AT&T.
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH Intro 2 "17 Nov 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+Intro, intro \- introduction to system calls and error numbers
+.SH SYNOPSIS
+.LP
+.nf
+\fB#include <errno.h>\fR
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+A system call is a C library function that requests a service from the system,
+such as getting the time of day. This request is performed in the kernel. The
+library interface executes a trap into the kernel, which actually executes the
+system call code.
+.sp
+.LP
+Most system calls return one or more error conditions. An error condition is
+indicated by an otherwise impossible return value. This is almost always
+\fB\(mi1\fR or the null pointer; the individual descriptions specify the
+details. An error number is also made available in the external variable
+\fBerrno\fR, which is not cleared on successful calls, so it should be tested
+only after an error has been indicated.
+.sp
+.LP
+In the case of multithreaded applications, the \fB-mt\fR option must be
+specified on the command line at compilation time (see \fBthreads\fR(5)). When
+the \fB-mt\fR option is specified, \fBerrno\fR becomes a macro that enables
+each thread to have its own \fBerrno\fR. This \fBerrno\fR macro can be used on
+either side of the assignment as though it were a variable.
+.sp
+.LP
+An error value listed as "will fail" describes a condition whose detection and
+reporting is mandatory for an implementation that conforms to the Single UNIX
+Specification (SUS). An application can rely on this condition being detected
+and reported. An error value listed as "may fail" describes a condition whose
+detection and reporting is optional for an implementation that conforms to the
+SUS. An application should not rely this condition being detected and reported.
+An application that relies on such behavior cannot be assured to be portable
+across conforming implementations. If more than one error occurs in processing
+a function call, any one of the possible errors might may be returned, as the
+order of detection is undefined. See \fBstandards\fR(5) for additional
+information regarding the Single UNIX Specification.
+.sp
+.LP
+Each system call description attempts to list all possible error numbers. The
+following is a complete list of the error numbers and their names as defined in
+<\fBerrno.h\fR>.
+.sp
+.ne 2
+.mk
+.na
+\fB1 EPERM\fR
+.ad
+.RS 23n
+.rt
+Lacking appropriate privileges
+.sp
+Typically this error indicates an attempt to modify a file in some way
+forbidden except to its owner or an appropriately privileged process. It is
+also returned for attempts by ordinary users to perform operations allowed only
+to processes with certain privileges.
+.sp
+The manual pages for individual functions document which privileges are needed
+to override the restriction.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB2 ENOENT\fR
+.ad
+.RS 23n
+.rt
+No such file or directory
+.sp
+A file name is specified and the file should exist but doesn't, or one of the
+directories in a path name does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB3 ESRCH\fR
+.ad
+.RS 23n
+.rt
+No such process, LWP, or thread
+.sp
+No process can be found in the system that corresponds to the specified
+\fBPID,\fR \fBLWPID_t\fR, or \fBthread_t\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB4 EINTR\fR
+.ad
+.RS 23n
+.rt
+Interrupted system call
+.sp
+An asynchronous signal (such as interrupt or quit), which the user has elected
+to catch, occurred during a system service function. If execution is resumed
+after processing the signal, it will appear as if the interrupted function call
+returned this error condition.
+.sp
+In a multithreaded application, \fBEINTR\fR may be returned whenever another
+thread or \fBLWP\fR calls \fBfork\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB5 EIO\fR
+.ad
+.RS 23n
+.rt
+I/O error
+.sp
+Some physical I/O error has occurred. This error may in some cases occur on a
+call following the one to which it actually applies.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB6 ENXIO\fR
+.ad
+.RS 23n
+.rt
+No such device or address
+.sp
+I/O on a special file refers to a subdevice which does not exist, or exists
+beyond the limit of the device. It may also occur when, for example, a tape
+drive is not on-line or no disk pack is loaded on a drive.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB7 E2BIG\fR
+.ad
+.RS 23n
+.rt
+Arg list too long
+.sp
+An argument list longer than \fBARG_MAX\fR bytes is presented to a member of
+the \fBexec\fR family of functions (see \fBexec\fR(2)). The argument list limit
+is the sum of the size of the argument list plus the size of the environment's
+exported shell variables.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB8 ENOEXEC\fR
+.ad
+.RS 23n
+.rt
+Exec format error
+.sp
+A request is made to execute a file which, although it has the appropriate
+permissions, does not start with a valid format (see \fBa.out\fR(4)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB9 EBADF\fR
+.ad
+.RS 23n
+.rt
+Bad file number
+.sp
+Either a file descriptor refers to no open file, or a \fBread\fR(2)
+(respectively, \fBwrite\fR(2)) request is made to a file that is open only for
+writing (respectively, reading).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB10 ECHILD\fR
+.ad
+.RS 23n
+.rt
+No child processes
+.sp
+A \fBwait\fR(3C) function call was executed by a process that had no existing
+or unwaited-for child processes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB11 EAGAIN\fR
+.ad
+.RS 23n
+.rt
+No more processes, or no more LWPs
+.sp
+For example, the \fBfork\fR(2) function failed because the system's process
+table is full or the user is not allowed to create any more processes, or a
+call failed because of insufficient memory or swap space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB12 ENOMEM\fR
+.ad
+.RS 23n
+.rt
+Not enough space
+.sp
+During execution of \fBbrk()\fR or \fBsbrk()\fR (see \fBbrk\fR(2)), or one of
+the \fBexec\fR family of functions, a program asks for more space than the
+system is able to supply. This is not a temporary condition; the maximum size
+is a system parameter. On some architectures, the error may also occur if the
+arrangement of text, data, and stack segments requires too many segmentation
+registers, or if there is not enough swap space during the \fBfork\fR(2)
+function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB13 EACCES\fR
+.ad
+.RS 23n
+.rt
+Permission denied
+.sp
+An attempt was made to access a file in a way forbidden by the protection
+system.
+.sp
+The manual pages for individual functions document which privileges are needed
+to override the protection system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB14 EFAULT\fR
+.ad
+.RS 23n
+.rt
+Bad address
+.sp
+The system encountered a hardware fault in attempting to use an argument of a
+routine. For example, \fBerrno\fR potentially may be set to \fBEFAULT\fR any
+time a routine that takes a pointer argument is passed an invalid address, if
+the system can detect the condition. Because systems will differ in their
+ability to reliably detect a bad address, on some implementations passing a bad
+address to a routine will result in undefined behavior.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB15 ENOTBLK\fR
+.ad
+.RS 23n
+.rt
+Block device required
+.sp
+A non-block device or file was mentioned where a block device was required (for
+example, in a call to the \fBmount\fR(2) function).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB16 EBUSY\fR
+.ad
+.RS 23n
+.rt
+Device busy
+.sp
+An attempt was made to mount a device that was already mounted or an attempt
+was made to unmount a device on which there is an active file (open file,
+current directory, mounted-on file, active text segment). It will also occur if
+an attempt is made to enable accounting when it is already enabled. The device
+or resource is currently unavailable. \fBEBUSY\fR is also used by mutexes,
+semaphores, condition variables, and r/w locks, to indicate that a lock is
+held, and by the processor control function \fBP_ONLINE\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB17 EEXIST\fR
+.ad
+.RS 23n
+.rt
+File exists
+.sp
+An existing file was mentioned in an inappropriate context (for example, call
+to the \fBlink\fR(2) function).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB18 EXDEV\fR
+.ad
+.RS 23n
+.rt
+Cross-device link
+.sp
+A hard link to a file on another device was attempted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB19 ENODEV\fR
+.ad
+.RS 23n
+.rt
+No such device
+.sp
+An attempt was made to apply an inappropriate operation to a device (for
+example, read a write-only device).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB20 ENOTDIR\fR
+.ad
+.RS 23n
+.rt
+Not a directory
+.sp
+A non-directory was specified where a directory is required (for example, in a
+path prefix or as an argument to the \fBchdir\fR(2) function).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB21 EISDIR\fR
+.ad
+.RS 23n
+.rt
+Is a directory
+.sp
+An attempt was made to write on a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB22 EINVAL\fR
+.ad
+.RS 23n
+.rt
+Invalid argument
+.sp
+An invalid argument was specified (for example, unmounting a non-mounted
+device), mentioning an undefined signal in a call to the \fBsignal\fR(3C) or
+\fBkill\fR(2) function, or an unsupported operation related to extended
+attributes was attempted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB23 ENFILE\fR
+.ad
+.RS 23n
+.rt
+File table overflow
+.sp
+The system file table is full (that is, \fBSYS_OPEN\fR files are open, and
+temporarily no more files can be opened).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB24 EMFILE\fR
+.ad
+.RS 23n
+.rt
+Too many open files
+.sp
+No process may have more than \fBOPEN_MAX\fR file descriptors open at a time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB25 ENOTTY\fR
+.ad
+.RS 23n
+.rt
+Inappropriate ioctl for device
+.sp
+A call was made to the \fBioctl\fR(2) function specifying a file that is not a
+special character device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB26 ETXTBSY\fR
+.ad
+.RS 23n
+.rt
+Text file busy (obsolete)
+.sp
+An attempt was made to execute a pure-procedure program that is currently open
+for writing. Also an attempt to open for writing or to remove a pure-procedure
+program that is being executed. \fB(This message is obsolete.)\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB27 EFBIG\fR
+.ad
+.RS 23n
+.rt
+File too large
+.sp
+The size of the file exceeded the limit specified by resource
+\fBRLIMIT_FSIZEn\fR; the file size exceeds the maximum supported by the file
+system; or the file size exceeds the offset maximum of the file descriptor.
+See the \fBFile Descriptor\fR subsection of the \fBDEFINITIONS\fR section
+below.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB28 ENOSPC\fR
+.ad
+.RS 23n
+.rt
+No space left on device
+.sp
+While writing an ordinary file or creating a directory entry, there is no free
+space left on the device. In the \fBfcntl\fR(2) function, the setting or
+removing of record locks on a file cannot be accomplished because there are no
+more record entries left on the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB29 ESPIPE\fR
+.ad
+.RS 23n
+.rt
+Illegal seek
+.sp
+A call to the \fBlseek\fR(2) function was issued to a pipe.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB30 EROFS\fR
+.ad
+.RS 23n
+.rt
+Read-only file system
+.sp
+An attempt to modify a file or directory was made on a device mounted
+read-only.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB31 EMLINK\fR
+.ad
+.RS 23n
+.rt
+Too many links
+.sp
+An attempt to make more than the maximum number of links, \fBLINK_MAX\fR, to a
+file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB32 EPIPE\fR
+.ad
+.RS 23n
+.rt
+Broken pipe
+.sp
+A write on a pipe for which there is no process to read the data. This
+condition normally generates a signal; the error is returned if the signal is
+ignored.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB33 EDOM\fR
+.ad
+.RS 23n
+.rt
+Math argument out of domain of function
+.sp
+The argument of a function in the math package (3M) is out of the domain of the
+function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB34 ERANGE\fR
+.ad
+.RS 23n
+.rt
+Math result not representable
+.sp
+The value of a function in the math package (3M) is not representable within
+machine precision.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB35 ENOMSG\fR
+.ad
+.RS 23n
+.rt
+No message of desired type
+.sp
+An attempt was made to receive a message of a type that does not exist on the
+specified message queue (see \fBmsgrcv\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB36 EIDRM\fR
+.ad
+.RS 23n
+.rt
+Identifier removed
+.sp
+This error is returned to processes that resume execution due to the removal of
+an identifier from the file system's name space (see \fBmsgctl\fR(2),
+\fBsemctl\fR(2), and \fBshmctl\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB37 ECHRNG\fR
+.ad
+.RS 23n
+.rt
+Channel number out of range
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB38 EL2NSYNC\fR
+.ad
+.RS 23n
+.rt
+Level 2 not synchronized
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB39 EL3HLT\fR
+.ad
+.RS 23n
+.rt
+Level 3 halted
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB40 EL3RST\fR
+.ad
+.RS 23n
+.rt
+Level 3 reset
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB41 ELNRNG\fR
+.ad
+.RS 23n
+.rt
+Link number out of range
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB42 EUNATCH\fR
+.ad
+.RS 23n
+.rt
+Protocol driver not attached
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB43 ENOCSI\fR
+.ad
+.RS 23n
+.rt
+No CSI structure available
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB44 EL2HLT\fR
+.ad
+.RS 23n
+.rt
+Level 2 halted
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB45 EDEADLK\fR
+.ad
+.RS 23n
+.rt
+Deadlock condition
+.sp
+A deadlock situation was detected and avoided. This error pertains to file and
+record locking, and also applies to mutexes, semaphores, condition variables,
+and r/w locks.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB46 ENOLCK\fR
+.ad
+.RS 23n
+.rt
+No record locks available
+.sp
+There are no more locks available. The system lock table is full (see
+\fBfcntl\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB47 ECANCELED\fR
+.ad
+.RS 23n
+.rt
+Operation canceled
+.sp
+The associated asynchronous operation was canceled before completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB48 ENOTSUP\fR
+.ad
+.RS 23n
+.rt
+Not supported
+.sp
+This version of the system does not support this feature. Future versions of
+the system may provide support.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB49 EDQUOT\fR
+.ad
+.RS 23n
+.rt
+Disc quota exceeded
+.sp
+A \fBwrite\fR(2) to an ordinary file, the creation of a directory or symbolic
+link, or the creation of a directory entry failed because the user's quota of
+disk blocks was exhausted, or the allocation of an inode for a newly created
+file failed because the user's quota of inodes was exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB58-59\fR
+.ad
+.RS 23n
+.rt
+Reserved
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB60 ENOSTR\fR
+.ad
+.RS 23n
+.rt
+Device not a stream
+.sp
+A \fBputmsg\fR(2) or \fBgetmsg\fR(2) call was attempted on a file descriptor
+that is not a STREAMS device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB61 ENODATA\fR
+.ad
+.RS 23n
+.rt
+No data available
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB62 ETIME\fR
+.ad
+.RS 23n
+.rt
+Timer expired
+.sp
+The timer set for a STREAMS \fBioctl\fR(2) call has expired. The cause of this
+error is device-specific and could indicate either a hardware or software
+failure, or perhaps a timeout value that is too short for the specific
+operation. The status of the \fBioctl()\fR operation is indeterminate. This is
+also returned in the case of \fB_lwp_cond_timedwait\fR(2) or
+\fBcond_timedwait\fR(3C).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB63 ENOSR\fR
+.ad
+.RS 23n
+.rt
+Out of stream resources
+.sp
+During a \fBSTREAMS\fR \fBopen\fR(2) call, either no \fBSTREAMS\fR queues or
+no \fBSTREAMS\fR head data structures were available. This is a temporary
+condition; one may recover from it if other processes release resources.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB65 ENOPKG\fR
+.ad
+.RS 23n
+.rt
+Package not installed
+.sp
+This error occurs when users attempt to use a call from a package which has not
+been installed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB71 EPROTO\fR
+.ad
+.RS 23n
+.rt
+Protocol error
+.sp
+Some protocol error occurred. This error is device-specific, but is generally
+not related to a hardware failure.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB77 EBADMSG\fR
+.ad
+.RS 23n
+.rt
+Not a data message
+.sp
+During a \fBread\fR(2), \fBgetmsg\fR(2), or \fBioctl\fR(2) \fBI_RECVFD\fR call
+to a STREAMS device, something has come to the head of the queue that can not
+be processed. That something depends on the call:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBread()\fR:\fR
+.ad
+.RS 13n
+.rt
+control information or passed file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBgetmsg()\fR:\fR
+.ad
+.RS 13n
+.rt
+passed file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBioctl()\fR:\fR
+.ad
+.RS 13n
+.rt
+control or data information.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB78 ENAMETOOLONG\fR
+.ad
+.RS 23n
+.rt
+File name too long
+.sp
+The length of the path argument exceeds \fIPATH_MAX\fR, or the length of a
+path component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in effect;
+see \fBlimits.h\fR(3HEAD).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB79 EOVERFLOW\fR
+.ad
+.RS 23n
+.rt
+Value too large for defined data type.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB80 ENOTUNIQ\fR
+.ad
+.RS 23n
+.rt
+Name not unique on network
+.sp
+Given log name not unique.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB81 EBADFD\fR
+.ad
+.RS 23n
+.rt
+File descriptor in bad state
+.sp
+Either a file descriptor refers to no open file or a read request was made to a
+file that is open only for writing.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB82 EREMCHG\fR
+.ad
+.RS 23n
+.rt
+Remote address changed
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB83 ELIBACC\fR
+.ad
+.RS 23n
+.rt
+Cannot access a needed share library
+.sp
+Trying to \fBexec\fR an \fBa.out\fR that requires a static shared library and
+the static shared library does not exist or the user does not have permission
+to use it.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB84 ELIBBAD\fR
+.ad
+.RS 23n
+.rt
+Accessing a corrupted shared library
+.sp
+Trying to \fBexec\fR an \fBa.out\fR that requires a static shared library (to
+be linked in) and \fBexec\fR could not load the static shared library. The
+static shared library is probably corrupted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB85 ELIBSCN\fR
+.ad
+.RS 23n
+.rt
+\fB\&.lib\fR section in \fBa.out\fR corrupted
+.sp
+Trying to \fBexec\fR an \fBa.out\fR that requires a static shared library (to
+be linked in) and there was erroneous data in the \fB\&.lib\fR section of the
+\fBa.out\fR. The \fB\&.lib\fR section tells \fBexec\fR what static shared
+libraries are needed. The \fBa.out\fR is probably corrupted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB86 ELIBMAX\fR
+.ad
+.RS 23n
+.rt
+Attempting to link in more shared libraries than system limit
+.sp
+Trying to \fBexec\fR an \fBa.out\fR that requires more static shared libraries
+than is allowed on the current configuration of the system. See \fISystem
+Administration Guide: IP Services\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB87 ELIBEXEC\fR
+.ad
+.RS 23n
+.rt
+Cannot \fBexec\fR a shared library directly
+.sp
+Attempting to \fBexec\fR a shared library directly.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB88 EILSEQ\fR
+.ad
+.RS 23n
+.rt
+Error 88
+.sp
+Illegal byte sequence. Handle multiple characters as a single character.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB89 ENOSYS\fR
+.ad
+.RS 23n
+.rt
+Operation not applicable
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB90 ELOOP\fR
+.ad
+.RS 23n
+.rt
+Number of symbolic links encountered during path name traversal exceeds
+\fBMAXSYMLINKS\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB91 ESTART\fR
+.ad
+.RS 23n
+.rt
+Restartable system call
+.sp
+Interrupted system call should be restarted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB92 ESTRPIPE\fR
+.ad
+.RS 23n
+.rt
+If pipe/FIFO, don't sleep in stream head
+.sp
+Streams pipe error (not externally visible).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB93 ENOTEMPTY\fR
+.ad
+.RS 23n
+.rt
+Directory not empty
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB94 EUSERS\fR
+.ad
+.RS 23n
+.rt
+Too many users
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB95 ENOTSOCK\fR
+.ad
+.RS 23n
+.rt
+Socket operation on non-socket
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB96 EDESTADDRREQ\fR
+.ad
+.RS 23n
+.rt
+Destination address required
+.sp
+A required address was omitted from an operation on a transport endpoint.
+Destination address required.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB97 EMGSIZE\fR
+.ad
+.RS 23n
+.rt
+Message too long
+.sp
+A message sent on a transport provider was larger than the internal message
+buffer or some other network limit.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB98 EPROTOTYPE\fR
+.ad
+.RS 23n
+.rt
+Protocol wrong type for socket
+.sp
+A protocol was specified that does not support the semantics of the socket type
+requested.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB99 ENOPROTOOPT\fR
+.ad
+.RS 23n
+.rt
+Protocol not available
+.sp
+A bad option or level was specified when getting or setting options for a
+protocol.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB120 EPROTONOSUPPORT\fR
+.ad
+.RS 23n
+.rt
+Protocol not supported
+.sp
+The protocol has not been configured into the system or no implementation for
+it exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB121 ESOCKTNOSUPPORT\fR
+.ad
+.RS 23n
+.rt
+Socket type not supported
+.sp
+The support for the socket type has not been configured into the system or no
+implementation for it exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB122 EOPNOTSUPP\fR
+.ad
+.RS 23n
+.rt
+Operation not supported on transport endpoint
+.sp
+For example, trying to accept a connection on a datagram transport endpoint.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB123 EPFNOSUPPORT\fR
+.ad
+.RS 23n
+.rt
+Protocol family not supported
+.sp
+The protocol family has not been configured into the system or no
+implementation for it exists. Used for the Internet protocols.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB124 EAFNOSUPPORT\fR
+.ad
+.RS 23n
+.rt
+Address family not supported by protocol family
+.sp
+An address incompatible with the requested protocol was used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB125 EADDRINUSE\fR
+.ad
+.RS 23n
+.rt
+Address already in use
+.sp
+User attempted to use an address already in use, and the protocol does not
+allow this.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB126 EADDRNOTAVAIL\fR
+.ad
+.RS 23n
+.rt
+Cannot assign requested address
+.sp
+Results from an attempt to create a transport endpoint with an address not on
+the current machine.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB127 ENETDOWN\fR
+.ad
+.RS 23n
+.rt
+Network is down
+.sp
+Operation encountered a dead network.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB128 ENETUNREACH\fR
+.ad
+.RS 23n
+.rt
+Network is unreachable
+.sp
+Operation was attempted to an unreachable network.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB129 ENETRESET\fR
+.ad
+.RS 23n
+.rt
+Network dropped connection because of reset
+.sp
+The host you were connected to crashed and rebooted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB130 ECONNABORTED\fR
+.ad
+.RS 23n
+.rt
+Software caused connection abort
+.sp
+A connection abort was caused internal to your host machine.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB131 ECONNRESET\fR
+.ad
+.RS 23n
+.rt
+Connection reset by peer
+.sp
+A connection was forcibly closed by a peer. This normally results from a loss
+of the connection on the remote host due to a timeout or a reboot.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB132 ENOBUFS\fR
+.ad
+.RS 23n
+.rt
+No buffer space available
+.sp
+An operation on a transport endpoint or pipe was not performed because the
+system lacked sufficient buffer space or because a queue was full.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB133 EISCONN\fR
+.ad
+.RS 23n
+.rt
+Transport endpoint is already connected
+.sp
+A connect request was made on an already connected transport endpoint; or, a
+\fBsendto\fR(3SOCKET) or \fBsendmsg\fR(3SOCKET) request on a connected
+transport endpoint specified a destination when already connected.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB134 ENOTCONN\fR
+.ad
+.RS 23n
+.rt
+Transport endpoint is not connected
+.sp
+A request to send or receive data was disallowed because the transport endpoint
+is not connected and (when sending a datagram) no address was supplied.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB143 ESHUTDOWN\fR
+.ad
+.RS 23n
+.rt
+Cannot send after transport endpoint shutdown
+.sp
+A request to send data was disallowed because the transport endpoint has
+already been shut down.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB144 ETOOMANYREFS\fR
+.ad
+.RS 23n
+.rt
+Too many references: cannot splice
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB145 ETIMEDOUT\fR
+.ad
+.RS 23n
+.rt
+Connection timed out
+.sp
+A \fBconnect\fR(3SOCKET) or \fBsend\fR(3SOCKET) request failed because the
+connected party did not properly respond after a period of time; or a
+\fBwrite\fR(2) or \fBfsync\fR(3C) request failed because a file is on an
+\fBNFS\fR file system mounted with the \fIsoft\fR option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB146 ECONNREFUSED\fR
+.ad
+.RS 23n
+.rt
+Connection refused
+.sp
+No connection could be made because the target machine actively refused it.
+This usually results from trying to connect to a service that is inactive on
+the remote host.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB147 EHOSTDOWN\fR
+.ad
+.RS 23n
+.rt
+Host is down
+.sp
+A transport provider operation failed because the destination host was down.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB148 EHOSTUNREACH\fR
+.ad
+.RS 23n
+.rt
+No route to host
+.sp
+A transport provider operation was attempted to an unreachable host.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB149 EALREADY\fR
+.ad
+.RS 23n
+.rt
+Operation already in progress
+.sp
+An operation was attempted on a non-blocking object that already had an
+operation in progress.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB150 EINPROGRESS\fR
+.ad
+.RS 23n
+.rt
+Operation now in progress
+.sp
+An operation that takes a long time to complete (such as a \fBconnect()\fR) was
+attempted on a non-blocking object.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB151 ESTALE\fR
+.ad
+.RS 23n
+.rt
+Stale NFS file handle
+.RE
+
+.SH DEFINITIONS
+.SS "Background Process Group"
+.sp
+.LP
+Any process group that is not the foreground process group of a session that
+has established a connection with a controlling terminal.
+.SS "Controlling Process"
+.sp
+.LP
+A session leader that established a connection to a controlling terminal.
+.SS "Controlling Terminal"
+.sp
+.LP
+A terminal that is associated with a session. Each session may have, at most,
+one controlling terminal associated with it and a controlling terminal may be
+associated with only one session. Certain input sequences from the controlling
+terminal cause signals to be sent to process groups in the session associated
+with the controlling terminal; see \fBtermio\fR(7I).
+.SS "Directory"
+.sp
+.LP
+Directories organize files into a hierarchical system where directories are the
+nodes in the hierarchy. A directory is a file that catalogs the list of files,
+including directories (sub-directories), that are directly beneath it in the
+hierarchy. Entries in a directory file are called links. A link associates a
+file identifier with a filename. By convention, a directory contains at least
+two links, \fB\&.\fR (dot) and \fB\&..\fR (dot-dot). The link called dot refers
+to the directory itself while dot-dot refers to its parent directory. The root
+directory, which is the top-most node of the hierarchy, has itself as its
+parent directory. The pathname of the root directory is \fB/\fR and the parent
+directory of the root directory is \fB/\fR.
+.SS "Downstream"
+.sp
+.LP
+In a stream, the direction from stream head to driver.
+.SS "Driver"
+.sp
+.LP
+In a stream, the driver provides the interface between peripheral hardware and
+the stream. A driver can also be a pseudo-driver, such as a multiplexor or log
+driver (see \fBlog\fR(7D)), which is not associated with a hardware device.
+.SS "Effective User \fBID\fR and Effective Group \fBID\fR"
+.sp
+.LP
+An active process has an effective user \fBID\fR and an effective group
+\fBID\fR that are used to determine file access permissions (see below). The
+effective user \fBID\fR and effective group \fBID\fR are equal to the process's
+real user \fBID\fR and real group \fBID,\fR respectively, unless the process or
+one of its ancestors evolved from a file that had the set-user-ID bit or
+set-group-ID bit set (see \fBexec\fR(2)).
+.SS "File Access Permissions"
+.sp
+.LP
+Read, write, and execute/search permissions for a file are granted to a process
+if one or more of the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective user ID of the process matches the user ID of the owner of the
+file and the appropriate access bit of the "owner" portion (0700) of the file
+mode is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective user ID of the process does not match the user ID of the owner
+of the file, but either the effective group ID or one of the supplementary
+group IDs of the process match the group ID of the file and the appropriate
+access bit of the "group" portion (0070) of the file mode is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective user ID of the process does not match the user ID of the owner of
+the file, and neither the effective group ID nor any of the supplementary group
+IDs of the process match the group ID of the file, but the appropriate access
+bit of the "other" portion (0007) of the file mode is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The read, write, or execute mode bit is not set but the process has the
+discretionary file access override privilege for the corresponding mode bit:
+{\fBPRIV_FILE_DAC_READ\fR} for the read bit {\fBPRIV_FILE_DAC_WRITE\fR} for the
+write bit, {\fBPRIV_FILE_DAC_SEARCH\fR} for the execute bit on directories, and
+{\fBPRIV_FILE_DAC_EXECUTE\fR} for the executable bit on plain files.
+.RE
+.sp
+.LP
+Otherwise, the corresponding permissions are denied.
+.SS "File Descriptor"
+.sp
+.LP
+A file descriptor is a small integer used to perform \fBI/O\fR on a file. The
+value of a file descriptor is from \fB0\fR to (\fBNOFILES\(mi1\fR). A process
+may have no more than \fBNOFILES\fR file descriptors open simultaneously. A
+file descriptor is returned by calls such as \fBopen\fR(2) or \fBpipe\fR(2).
+The file descriptor is used as an argument by calls such as \fBread\fR(2),
+\fBwrite\fR(2), \fBioctl\fR(2), and \fBclose\fR(2).
+.sp
+.LP
+Each file descriptor has a corresponding offset maximum. For regular files that
+were opened without setting the \fBO_LARGEFILE\fR flag, the offset maximum is 2
+Gbyte \(mi 1 byte (2^31 \(mi1 bytes). For regular files that were opened with
+the \fBO_LARGEFILE\fR flag set, the offset maximum is 2^63 \(mi1 bytes.
+.SS "File Name"
+.sp
+.LP
+Names consisting of 1 to \fINAME_MAX\fR characters may be used to name an
+ordinary file, special file or directory.
+.sp
+.LP
+These characters may be selected from the set of all character values excluding
+\e0 (null) and the \fBASCII\fR code for \fB/\fR (slash).
+.sp
+.LP
+Note that it is generally unwise to use \fB*\fR, \fB?\fR, \fB[\fR, or \fB]\fR
+as part of file names because of the special meaning attached to these
+characters by the shell (see \fBsh\fR(1), \fBcsh\fR(1), and \fBksh\fR(1)).
+Although permitted, the use of unprintable characters in file names should be
+avoided.
+.sp
+.LP
+A file name is sometimes referred to as a pathname component. The
+interpretation of a pathname component is dependent on the values of
+\fINAME_MAX\fR and \fB_POSIX_NO_TRUNC\fR associated with the path prefix of
+that component. If any pathname component is longer than \fINAME_MAX\fR and
+\fB_POSIX_NO_TRUNC\fR is in effect for the path prefix of that component (see
+\fBfpathconf\fR(2) and \fBlimits.h\fR(3HEAD)), it shall be considered an error
+condition in that implementation. Otherwise, the implementation shall use the
+first \fINAME_MAX\fR bytes of the pathname component.
+.SS "Foreground Process Group"
+.sp
+.LP
+Each session that has established a connection with a controlling terminal will
+distinguish one process group of the session as the foreground process group of
+the controlling terminal. This group has certain privileges when accessing its
+controlling terminal that are denied to background process groups.
+.SS "{IOV_MAX}"
+.sp
+.LP
+Maximum number of entries in a \fBstruct iovec\fR array.
+.SS "{LIMIT}"
+.sp
+.LP
+The braces notation, \fB{LIMIT}\fR, is used to denote a magnitude limitation
+imposed by the implementation. This indicates a value which may be defined by
+a header file (without the braces), or the actual value may be obtained at
+runtime by a call to the configuration inquiry \fBpathconf\fR(2) with the name
+argument \fB_PC_LIMIT\fR.
+.SS "Masks"
+.sp
+.LP
+The file mode creation mask of the process used during any create function
+calls to turn off permission bits in the \fImode\fR argument supplied. Bit
+positions that are set in \fBumask(\fR\fIcmask\fR\fB)\fR are cleared in the
+mode of the created file.
+.SS "Message"
+.sp
+.LP
+In a stream, one or more blocks of data or information, with associated STREAMS
+control structures. Messages can be of several defined types, which identify
+the message contents. Messages are the only means of transferring data and
+communicating within a stream.
+.SS "Message Queue"
+.sp
+.LP
+In a stream, a linked list of messages awaiting processing by a module or
+driver.
+.SS "Message Queue Identifier"
+.sp
+.LP
+A message queue identifier (\fBmsqid\fR) is a unique positive integer created
+by a \fBmsgget\fR(2) call. Each \fBmsqid\fR has a message queue and a data
+structure associated with it. The data structure is referred to as
+\fBmsqid_ds\fR and contains the following members:
+.sp
+.in +2
+.nf
+struct ipc_perm msg_perm;
+struct msg *msg_first;
+struct msg *msg_last;
+ulong_t msg_cbytes;
+ulong_t msg_qnum;
+ulong_t msg_qbytes;
+pid_t msg_lspid;
+pid_t msg_lrpid;
+time_t msg_stime;
+time_t msg_rtime;
+time_t msg_ctime;
+.fi
+.in -2
+
+.sp
+.LP
+The following are descriptions of the \fBmsqid_ds\fR structure members:
+.sp
+.LP
+The \fBmsg_perm\fR member is an \fBipc_perm\fR structure that specifies the
+message operation permission (see below). This structure includes the following
+members:
+.sp
+.in +2
+.nf
+uid_t cuid; /* creator user id */
+gid_t cgid; /* creator group id */
+uid_t uid; /* user id */
+gid_t gid; /* group id */
+mode_t mode; /* r/w permission */
+ulong_t seq; /* slot usage sequence # */
+key_t key; /* key */
+.fi
+.in -2
+
+.sp
+.LP
+The \fB*msg_first\fR member is a pointer to the first message on the queue.
+.sp
+.LP
+The \fB*msg_last\fR member is a pointer to the last message on the queue.
+.sp
+.LP
+The \fBmsg_cbytes\fR member is the current number of bytes on the queue.
+.sp
+.LP
+The \fBmsg_qnum\fR member is the number of messages currently on the queue.
+.sp
+.LP
+The \fBmsg_qbytes\fR member is the maximum number of bytes allowed on the
+queue.
+.sp
+.LP
+The \fBmsg_lspid\fR member is the process \fBID\fR of the last process that
+performed a \fBmsgsnd()\fR operation.
+.sp
+.LP
+The \fBmsg_lrpid\fR member is the process id of the last process that performed
+a \fBmsgrcv()\fR operation.
+.sp
+.LP
+The \fBmsg_stime\fR member is the time of the last \fBmsgsnd()\fR operation.
+.sp
+.LP
+The \fBmsg_rtime\fR member is the time of the last \fBmsgrcv()\fR operation.
+.sp
+.LP
+The \fBmsg_ctime\fR member is the time of the last \fBmsgctl()\fR operation
+that changed a member of the above structure.
+.SS "Message Operation Permissions"
+.sp
+.LP
+In the \fBmsgctl\fR(2), \fBmsgget\fR(2), \fBmsgrcv\fR(2), and \fBmsgsnd\fR(2)
+function descriptions, the permission required for an operation is given as
+{\fItoken\fR}, where \fItoken\fR is the type of permission needed, interpreted
+as follows:
+.sp
+.in +2
+.nf
+00400 READ by user
+00200 WRITE by user
+00040 READ by group
+00020 WRITE by group
+00004 READ by others
+00002 WRITE by others
+.fi
+.in -2
+
+.sp
+.LP
+Read and write permissions for a \fBmsqid\fR are granted to a process if one or
+more of the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
+present in the effective set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective user \fBID\fR of the process matches \fBmsg_perm.cuid\fR or
+\fBmsg_perm.uid\fR in the data structure associated with \fBmsqid\fR and the
+appropriate bit of the "user" portion (0600) of \fBmsg_perm.mode\fR is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Any group ID in the process credentials from the set (\fBcr_gid\fR,
+\fBcr_groups\fR) matches \fBmsg_perm.cgid\fR or \fBmsg_perm.gid\fR and the
+appropriate bit of the "group" portion (060) of \fBmsg_perm.mode\fR is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The appropriate bit of the "other" portion (006) of \fBmsg_perm.mode\fR is
+set."
+.RE
+.sp
+.LP
+Otherwise, the corresponding permissions are denied.
+.SS "Module"
+.sp
+.LP
+A module is an entity containing processing routines for input and output data.
+It always exists in the middle of a stream, between the stream's head and a
+driver. A module is the STREAMS counterpart to the commands in a shell pipeline
+except that a module contains a pair of functions which allow independent
+bidirectional (downstream and upstream) data flow and processing.
+.SS "Multiplexor"
+.sp
+.LP
+A multiplexor is a driver that allows streams associated with several user
+processes to be connected to a single driver, or several drivers to be
+connected to a single user process. STREAMS does not provide a general
+multiplexing driver, but does provide the facilities for constructing them and
+for connecting multiplexed configurations of streams.
+.SS "Offset Maximum"
+.sp
+.LP
+An offset maximum is an attribute of an open file description representing the
+largest value that can be used as a file offset.
+.SS "Orphaned Process Group"
+.sp
+.LP
+A process group in which the parent of every member in the group is either
+itself a member of the group, or is not a member of the process group's
+session.
+.SS "Path Name"
+.sp
+.LP
+A path name is a null-terminated character string starting with an optional
+slash (\fB/\fR), followed by zero or more directory names separated by slashes,
+optionally followed by a file name.
+.sp
+.LP
+If a path name begins with a slash, the path search begins at the root
+directory. Otherwise, the search begins from the current working directory.
+.sp
+.LP
+A slash by itself names the root directory.
+.sp
+.LP
+Unless specifically stated otherwise, the null path name is treated as if it
+named a non-existent file.
+.SS "Privileged User"
+.sp
+.LP
+Solaris software implements a set of privileges that provide fine-grained
+control over the actions of processes. The possession of of a certain privilege
+allows a process to perform a specific set of restricted operations. Prior to
+the Solaris 10 release, a process running with uid 0 was granted all
+privileges. See \fBprivileges\fR(5) for the semantics and the degree of
+backward compatibility awarded to processes with an effective uid of 0.
+.SS "Process \fBID\fR"
+.sp
+.LP
+Each process in the system is uniquely identified during its lifetime by a
+positive integer called a process ID. A process ID cannot be reused by the
+system until the process lifetime, process group lifetime, and session lifetime
+ends for any process ID, process group ID, and session ID equal to that process
+ID. There are threads within a process with thread IDs \fBthread_t\fR and
+\fBLWPID_t\fR. These threads are not visible to the outside process.
+.SS "Parent Process \fBID\fR"
+.sp
+.LP
+A new process is created by a currently active process (see \fBfork\fR(2)). The
+parent process \fBID\fR of a process is the process \fBID\fR of its creator.
+.SS "Privilege"
+.sp
+.LP
+Having appropriate privilege means having the capability to override system
+restrictions.
+.SS "Process Group"
+.sp
+.LP
+Each process in the system is a member of a process group that is identified by
+a process group ID. Any process that is not a process group leader may create
+a new process group and become its leader. Any process that is not a process
+group leader may join an existing process group that shares the same session
+as the process. A newly created process joins the process group of its parent.
+.SS "Process Group Leader"
+.sp
+.LP
+A process group leader is a process whose process \fBID\fR is the same as its
+process group ID.
+.SS "Process Group \fBID\fR"
+.sp
+.LP
+Each active process is a member of a process group and is identified by a
+positive integer called the process group ID. This \fBID\fR is the process
+\fBID\fR of the group leader. This grouping permits the signaling of related
+processes (see \fBkill\fR(2)).
+.SS "Process Lifetime"
+.sp
+.LP
+A process lifetime begins when the process is forked and ends after it exits,
+when its termination has been acknowledged by its parent process. See
+\fBwait\fR(3C).
+.SS "Process Group Lifetime"
+.sp
+.LP
+A process group lifetime begins when the process group is created by its
+process group leader, and ends when the lifetime of the last process in the
+group ends or when the last process in the group leaves the group.
+.SS "Processor Set \fBID\fR"
+.sp
+.LP
+The processors in a system may be divided into subsets, known as processor
+sets. A process bound to one of these sets will run only on processors in that
+set, and the processors in the set will normally run only processes that have
+been bound to the set. Each active processor set is identified by a positive
+integer. See \fBpset_create\fR(2).
+.SS "Read Queue"
+.sp
+.LP
+In a stream, the message queue in a module or driver containing messages moving
+upstream.
+.SS "Real User \fBID\fR and Real Group \fBID\fR"
+.sp
+.LP
+Each user allowed on the system is identified by a positive integer (\fB0\fR
+to \fBMAXUID\fR) called a real user \fBID.\fR
+.sp
+.LP
+Each user is also a member of a group. The group is identified by a positive
+integer called the real group \fBID.\fR
+.sp
+.LP
+An active process has a real user \fBID\fR and real group \fBID\fR that are set
+to the real user \fBID\fR and real group \fBID,\fR respectively, of the user
+responsible for the creation of the process.
+.SS "Root Directory and Current Working Directory"
+.sp
+.LP
+Each process has associated with it a concept of a root directory and a current
+working directory for the purpose of resolving path name searches. The root
+directory of a process need not be the root directory of the root file system.
+.SS "Saved Resource Limits"
+.sp
+.LP
+Saved resource limits is an attribute of a process that provides some
+flexibility in the handling of unrepresentable resource limits, as described in
+the \fBexec\fR family of functions and \fBsetrlimit\fR(2).
+.SS "Saved User \fBID\fR and Saved Group \fBID\fR"
+.sp
+.LP
+The saved user \fBID\fR and saved group \fBID\fR are the values of the
+effective user \fBID\fR and effective group \fBID\fR just after an \fBexec\fR
+of a file whose set user or set group file mode bit has been set (see
+\fBexec\fR(2)).
+.SS "Semaphore Identifier"
+.sp
+.LP
+A semaphore identifier (\fBsemid\fR) is a unique positive integer created by a
+\fBsemget\fR(2) call. Each \fBsemid\fR has a set of semaphores and a data
+structure associated with it. The data structure is referred to as
+\fBsemid_ds\fR and contains the following members:
+.sp
+.in +2
+.nf
+struct ipc_perm sem_perm; /* operation permission struct */
+struct sem *sem_base; /* ptr to first semaphore in set */
+ushort_t sem_nsems; /* number of sems in set */
+time_t sem_otime; /* last operation time */
+time_t sem_ctime; /* last change time */
+ /* Times measured in secs since */
+ /* 00:00:00 GMT, Jan. 1, 1970 */
+.fi
+.in -2
+
+.sp
+.LP
+The following are descriptions of the \fBsemid_ds\fR structure members:
+.sp
+.LP
+The \fBsem_perm\fR member is an \fBipc_perm\fR structure that specifies the
+semaphore operation permission (see below). This structure includes the
+following members:
+.sp
+.in +2
+.nf
+uid_t uid; /* user id */
+gid_t gid; /* group id */
+uid_t cuid; /* creator user id */
+gid_t cgid; /* creator group id */
+mode_t mode; /* r/a permission */
+ulong_t seq; /* slot usage sequence number */
+key_t key; /* key */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBsem_nsems\fR member is equal to the number of semaphores in the set.
+Each semaphore in the set is referenced by a nonnegative integer referred to as
+a \fBsem_num\fR. \fBsem_num\fR values run sequentially from \fB0\fR to the
+value of \fBsem_nsems\fR minus 1.
+.sp
+.LP
+The \fBsem_otime\fR member is the time of the last \fBsemop\fR(2) operation.
+.sp
+.LP
+The \fBsem_ctime\fR member is the time of the last \fBsemctl\fR(2) operation
+that changed a member of the above structure.
+.sp
+.LP
+A semaphore is a data structure called \fBsem\fR that contains the following
+members:
+.sp
+.in +2
+.nf
+ushort_t semval; /* semaphore value */
+pid_t sempid; /* pid of last operation */
+ushort_t semncnt; /* # awaiting semval > cval */
+ushort_t semzcnt; /* # awaiting semval = 0 */
+.fi
+.in -2
+
+.sp
+.LP
+The following are descriptions of the \fBsem\fR structure members:
+.sp
+.LP
+The \fBsemval\fR member is a non-negative integer that is the actual value of
+the semaphore.
+.sp
+.LP
+The \fBsempid\fR member is equal to the process \fBID\fR of the last process
+that performed a semaphore operation on this semaphore.
+.sp
+.LP
+The \fBsemncnt\fR member is a count of the number of processes that are
+currently suspended awaiting this semaphore's \fBsemval\fR to become greater
+than its current value.
+.sp
+.LP
+The \fBsemzcnt\fR member is a count of the number of processes that are
+currently suspended awaiting this semaphore's \fBsemval\fR to become \fB0\fR.
+.SS "Semaphore Operation Permissions"
+.sp
+.LP
+In the \fBsemop\fR(2) and \fBsemctl\fR(2) function descriptions, the permission
+required for an operation is given as {\fItoken\fR}, where \fItoken\fR is the
+type of permission needed interpreted as follows:
+.sp
+.in +2
+.nf
+\fB00400 READ by user
+00200 ALTER by user
+00040 READ by group
+00020 ALTER by group
+00004 READ by others
+00002 ALTER by others\fR
+.fi
+.in -2
+
+.sp
+.LP
+Read and alter permissions for a \fBsemid\fR are granted to a process if one or
+more of the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
+present in the effective set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective user \fBID\fR of the process matches \fBsem_perm.cuid\fR or
+\fBsem_perm.uid\fR in the data structure associated with \fBsemid\fR and the
+appropriate bit of the "user" portion (0600) of \fBsem_perm.mode\fR is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective group \fBID\fR of the process matches \fBsem_perm.cgid\fR or
+\fBsem_perm.gid\fR and the appropriate bit of the "group" portion (060) of
+\fBsem_perm.mode\fR is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The appropriate bit of the "other" portion (06) of \fBsem_perm.mode\fR is set.
+.RE
+.sp
+.LP
+Otherwise, the corresponding permissions are denied.
+.SS "Session"
+.sp
+.LP
+A session is a group of processes identified by a common \fBID\fR called a
+session ID, capable of establishing a connection with a controlling terminal.
+Any process that is not a process group leader may create a new session and
+process group, becoming the session leader of the session and process group
+leader of the process group. A newly created process joins the session of its
+creator.
+.SS "Session \fBID\fR"
+.sp
+.LP
+Each session in the system is uniquely identified during its lifetime by a
+positive integer called a session ID, the process \fBID\fR of its session
+leader.
+.SS "Session Leader"
+.sp
+.LP
+A session leader is a process whose session \fBID\fR is the same as its
+process and process group ID.
+.SS "Session Lifetime"
+.sp
+.LP
+A session lifetime begins when the session is created by its session leader,
+and ends when the lifetime of the last process that is a member of the session
+ends, or when the last process that is a member in the session leaves the
+session.
+.SS "Shared Memory Identifier"
+.sp
+.LP
+A shared memory identifier (\fBshmid\fR) is a unique positive integer created
+by a \fBshmget\fR(2) call. Each \fBshmid\fR has a segment of memory (referred
+to as a shared memory segment) and a data structure associated with it. (Note
+that these shared memory segments must be explicitly removed by the user after
+the last reference to them is removed.) The data structure is referred to as
+\fBshmid_ds\fR and contains the following members:
+.sp
+.in +2
+.nf
+struct ipc_perm shm_perm; /* operation permission struct */
+size_t shm_segsz; /* size of segment */
+struct anon_map *shm_amp; /* ptr to region structure */
+char pad[4]; /* for swap compatibility */
+pid_t shm_lpid; /* pid of last operation */
+pid_t shm_cpid; /* creator pid */
+shmatt_t shm_nattch; /* number of current attaches */
+ulong_t shm_cnattch; /* used only for shminfo */
+time_t shm_atime; /* last attach time */
+time_t shm_dtime; /* last detach time */
+time_t shm_ctime; /* last change time */
+ /* Times measured in secs since */
+ /* 00:00:00 GMT, Jan. 1, 1970 */
+.fi
+.in -2
+
+.sp
+.LP
+The following are descriptions of the \fBshmid_ds\fR structure members:
+.sp
+.LP
+The \fBshm_perm\fR member is an \fBipc_perm\fR structure that specifies the
+shared memory operation permission (see below). This structure includes the
+following members:
+.sp
+.in +2
+.nf
+uid_t cuid; /* creator user id */
+gid_t cgid; /* creator group id */
+uid_t uid; /* user id */
+gid_t gid; /* group id */
+mode_t mode; /* r/w permission */
+ulong_t seq; /* slot usage sequence # */
+key_t key; /* key */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBshm_segsz\fR member specifies the size of the shared memory segment in
+bytes.
+.sp
+.LP
+The \fBshm_cpid\fR member is the process \fBID\fR of the process that created
+the shared memory identifier.
+.sp
+.LP
+The \fBshm_lpid\fR member is the process \fBID\fR of the last process that
+performed a \fBshmat()\fR or \fBshmdt()\fR operation (see \fBshmop\fR(2)).
+.sp
+.LP
+The \fBshm_nattch\fR member is the number of processes that currently have this
+segment attached.
+.sp
+.LP
+The \fBshm_atime\fR member is the time of the last \fBshmat()\fR operation (see
+\fBshmop\fR(2)).
+.sp
+.LP
+The \fBshm_dtime\fR member is the time of the last \fBshmdt()\fR operation (see
+\fBshmop\fR(2)).
+.sp
+.LP
+The \fBshm_ctime\fR member is the time of the last \fBshmctl\fR(2) operation
+that changed one of the members of the above structure.
+.SS "Shared Memory Operation Permissions"
+.sp
+.LP
+In the \fBshmctl\fR(2), \fBshmat()\fR, and \fBshmdt()\fR (see \fBshmop\fR(2))
+function descriptions, the permission required for an operation is given as
+{\fItoken\fR}, where \fItoken\fR is the type of permission needed interpreted
+as follows:
+.sp
+.in +2
+.nf
+00400 READ by user
+00200 WRITE by user
+00040 READ by group
+00020 WRITE by group
+00004 READ by others
+00002 WRITE by others
+.fi
+.in -2
+
+.sp
+.LP
+Read and write permissions for a \fBshmid\fR are granted to a process if one or
+more of the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The {\fBPRIV_IPC_DAC_READ\fR} or {\fBPRIV_IPC_DAC_WRITE\fR} privilege is
+present in the effective set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective user \fBID\fR of the process matches \fBshm_perm.cuid\fR or
+\fBshm_perm.uid\fR in the data structure associated with \fBshmid\fR and the
+appropriate bit of the "user" portion (0600) of \fBshm_perm.mode\fR is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The effective group \fBID\fR of the process matches \fBshm_perm.cgid\fR or
+\fBshm_perm.gid\fR and the appropriate bit of the "group" portion (060) of
+\fBshm_perm.mode\fR is set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The appropriate bit of the "other" portion (06) of \fBshm_perm.mode\fR is set.
+.RE
+.sp
+.LP
+Otherwise, the corresponding permissions are denied.
+.SS "Special Processes"
+.sp
+.LP
+The process with \fBID\fR 0 and the process with \fBID\fR 1 are special
+processes referred to as proc0 and proc1; see \fBkill\fR(2). proc0 is the
+process scheduler. proc1 is the initialization process (\fIinit\fR); proc1 is
+the ancestor of every other process in the system and is used to control the
+process structure.
+.SS "\fBSTREAMS\fR"
+.sp
+.LP
+A set of kernel mechanisms that support the development of network services and
+data communication drivers. It defines interface standards for character
+input/output within the kernel and between the kernel and user level processes.
+The STREAMS mechanism is composed of utility routines, kernel facilities and a
+set of data structures.
+.SS "Stream"
+.sp
+.LP
+A stream is a full-duplex data path within the kernel between a user process
+and driver routines. The primary components are a stream head, a driver, and
+zero or more modules between the stream head and driver. A stream is analogous
+to a shell pipeline, except that data flow and processing are bidirectional.
+.SS "Stream Head"
+.sp
+.LP
+In a stream, the stream head is the end of the stream that provides the
+interface between the stream and a user process. The principal functions of the
+stream head are processing STREAMS-related system calls and passing data and
+information between a user process and the stream.
+.SS "Upstream"
+.sp
+.LP
+In a stream, the direction from driver to stream head.
+.SS "Write Queue"
+.sp
+.LP
+In a stream, the message queue in a module or driver containing messages moving
+downstream.
+.SH ACKNOWLEDGMENTS
+.sp
+.LP
+Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to
+reproduce portions of its copyrighted documentation. Original documentation
+from The Open Group can be obtained online at
+http://www.opengroup.org/bookstore/\&.
+.sp
+.LP
+The Institute of Electrical and Electronics Engineers and The Open Group, have
+given us permission to reprint portions of their documentation.
+.sp
+.LP
+In the following statement, the phrase ``this text'' refers to portions of the
+system documentation.
+.sp
+.LP
+Portions of this text are reprinted and reproduced in electronic form in the
+SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for
+Information Technology -- Portable Operating System Interface (POSIX), The Open
+Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of
+Electrical and Electronics Engineers, Inc and The Open Group. In the event of
+any discrepancy between these versions and the original IEEE and The Open Group
+Standard, the original IEEE and The Open Group Standard is the referee
+document. The original Standard can be obtained online at
+http://www.opengroup.org/unix/online.html\&.
+.sp
+.LP
+This notice shall appear on any product containing this material.
+.SH SEE ALSO
+.sp
+.LP
+\fBstandards\fR(5), \fBthreads\fR(5)
diff --git a/usr/src/man/man2/Makefile b/usr/src/man/man2/Makefile
new file mode 100644
index 0000000000..449177c4df
--- /dev/null
+++ b/usr/src/man/man2/Makefile
@@ -0,0 +1,380 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet
+# at http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2011, Richard Lowe
+
+include ../../Makefile.master
+
+MANSECT = 2
+
+MANFILES = Intro.2 \
+ __sparc_utrap_install.2 \
+ _lwp_cond_signal.2 \
+ _lwp_cond_wait.2 \
+ _lwp_info.2 \
+ _lwp_kill.2 \
+ _lwp_mutex_lock.2 \
+ _lwp_self.2 \
+ _lwp_sema_wait.2 \
+ _lwp_suspend.2 \
+ access.2 \
+ acct.2 \
+ acl.2 \
+ adjtime.2 \
+ alarm.2 \
+ audit.2 \
+ auditon.2 \
+ brk.2 \
+ chdir.2 \
+ chmod.2 \
+ chown.2 \
+ chroot.2 \
+ close.2 \
+ creat.2 \
+ dup.2 \
+ exec.2 \
+ exit.2 \
+ fcntl.2 \
+ fork.2 \
+ fpathconf.2 \
+ getacct.2 \
+ getaudit.2 \
+ getauid.2 \
+ getcontext.2 \
+ getdents.2 \
+ getgroups.2 \
+ getisax.2 \
+ getitimer.2 \
+ getlabel.2 \
+ getmsg.2 \
+ getpflags.2 \
+ getpid.2 \
+ getppriv.2 \
+ getrlimit.2 \
+ getsid.2 \
+ getuid.2 \
+ getustack.2 \
+ ioctl.2 \
+ issetugid.2 \
+ kill.2 \
+ link.2 \
+ llseek.2 \
+ lseek.2 \
+ memcntl.2 \
+ meminfo.2 \
+ mincore.2 \
+ mkdir.2 \
+ mknod.2 \
+ mmap.2 \
+ mmapobj.2 \
+ mount.2 \
+ mprotect.2 \
+ msgctl.2 \
+ msgget.2 \
+ msgids.2 \
+ msgrcv.2 \
+ msgsnap.2 \
+ msgsnd.2 \
+ munmap.2 \
+ nice.2 \
+ ntp_adjtime.2 \
+ ntp_gettime.2 \
+ open.2 \
+ p_online.2 \
+ pause.2 \
+ pcsample.2 \
+ pipe.2 \
+ poll.2 \
+ priocntl.2 \
+ priocntlset.2 \
+ processor_bind.2 \
+ processor_info.2 \
+ profil.2 \
+ pset_bind.2 \
+ pset_create.2 \
+ pset_info.2 \
+ pset_list.2 \
+ pset_setattr.2 \
+ putmsg.2 \
+ read.2 \
+ readlink.2 \
+ rename.2 \
+ resolvepath.2 \
+ rmdir.2 \
+ semctl.2 \
+ semget.2 \
+ semids.2 \
+ semop.2 \
+ setpgid.2 \
+ setpgrp.2 \
+ setrctl.2 \
+ setregid.2 \
+ setreuid.2 \
+ setsid.2 \
+ settaskid.2 \
+ setuid.2 \
+ shmctl.2 \
+ shmget.2 \
+ shmids.2 \
+ shmop.2 \
+ sigaction.2 \
+ sigaltstack.2 \
+ sigpending.2 \
+ sigprocmask.2 \
+ sigsend.2 \
+ sigsuspend.2 \
+ sigwait.2 \
+ stat.2 \
+ statvfs.2 \
+ stime.2 \
+ swapctl.2 \
+ symlink.2 \
+ sync.2 \
+ sysfs.2 \
+ sysinfo.2 \
+ time.2 \
+ times.2 \
+ uadmin.2 \
+ ulimit.2 \
+ umask.2 \
+ umount.2 \
+ uname.2 \
+ unlink.2 \
+ ustat.2 \
+ utime.2 \
+ utimes.2 \
+ uucopy.2 \
+ vfork.2 \
+ vhangup.2 \
+ waitid.2 \
+ write.2 \
+ yield.2 \
+
+MANSOFILES = _Exit.2 \
+ _exit.2 \
+ _lwp_cond_broadcast.2 \
+ _lwp_cond_reltimedwait.2 \
+ _lwp_cond_timedwait.2 \
+ _lwp_continue.2 \
+ _lwp_mutex_trylock.2 \
+ _lwp_mutex_unlock.2 \
+ _lwp_sema_init.2 \
+ _lwp_sema_post.2 \
+ _lwp_sema_trywait.2 \
+ execl.2 \
+ execle.2 \
+ execlp.2 \
+ execv.2 \
+ execve.2 \
+ execvp.2 \
+ faccessat.2 \
+ facl.2 \
+ fchdir.2 \
+ fchmod.2 \
+ fchown.2 \
+ fchownat.2 \
+ fchroot.2 \
+ fgetlabel.2 \
+ fork1.2 \
+ forkall.2 \
+ forkallx.2 \
+ forkx.2 \
+ fstat.2 \
+ fstatat.2 \
+ fstatvfs.2 \
+ futimesat.2 \
+ getaudit_addr.2 \
+ getegid.2 \
+ geteuid.2 \
+ getgid.2 \
+ getpgid.2 \
+ getpgrp.2 \
+ getpmsg.2 \
+ getppid.2 \
+ getprojid.2 \
+ getrctl.2 \
+ gettaskid.2 \
+ intro.2 \
+ lchown.2 \
+ lstat.2 \
+ openat.2 \
+ pathconf.2 \
+ pread.2 \
+ pset_assign.2 \
+ pset_destroy.2 \
+ pset_getattr.2 \
+ putacct.2 \
+ putpmsg.2 \
+ pwrite.2 \
+ readv.2 \
+ renameat.2 \
+ sbrk.2 \
+ semtimedop.2 \
+ setaudit.2 \
+ setaudit_addr.2 \
+ setauid.2 \
+ setcontext.2 \
+ setegid.2 \
+ seteuid.2 \
+ setgid.2 \
+ setgroups.2 \
+ setitimer.2 \
+ setpflags.2 \
+ setppriv.2 \
+ setrlimit.2 \
+ setustack.2 \
+ shmat.2 \
+ shmdt.2 \
+ sigsendset.2 \
+ umount2.2 \
+ unlinkat.2 \
+ vforkx.2 \
+ wracct.2 \
+ writev.2
+
+MANFILES += $(MANSOFILES)
+
+intro.2 := SOSRC = man2/Intro.2
+
+_lwp_cond_broadcast.2 := SOSRC = man2/_lwp_cond_signal.2
+
+_lwp_cond_reltimedwait.2 := SOSRC = man2/_lwp_cond_wait.2
+_lwp_cond_timedwait.2 := SOSRC = man2/_lwp_cond_wait.2
+
+_lwp_mutex_trylock.2 := SOSRC = man2/_lwp_mutex_lock.2
+_lwp_mutex_unlock.2 := SOSRC = man2/_lwp_mutex_lock.2
+
+_lwp_sema_init.2 := SOSRC = man2/_lwp_sema_wait.2
+_lwp_sema_post.2 := SOSRC = man2/_lwp_sema_wait.2
+_lwp_sema_trywait.2 := SOSRC = man2/_lwp_sema_wait.2
+
+_lwp_continue.2 := SOSRC = man2/_lwp_suspend.2
+
+faccessat.2 := SOSRC = man2/access.2
+
+facl.2 := SOSRC = man2/acl.2
+
+sbrk.2 := SOSRC = man2/brk.2
+
+fchdir.2 := SOSRC = man2/chdir.2
+
+fchmod.2 := SOSRC = man2/chmod.2
+
+fchown.2 := SOSRC = man2/chown.2
+fchownat.2 := SOSRC = man2/chown.2
+lchown.2 := SOSRC = man2/chown.2
+
+fchroot.2 := SOSRC = man2/chroot.2
+
+execl.2 := SOSRC = man2/exec.2
+execle.2 := SOSRC = man2/exec.2
+execlp.2 := SOSRC = man2/exec.2
+execv.2 := SOSRC = man2/exec.2
+execve.2 := SOSRC = man2/exec.2
+execvp.2 := SOSRC = man2/exec.2
+
+_Exit.2 := SOSRC = man2/exit.2
+_exit.2 := SOSRC = man2/exit.2
+
+fork1.2 := SOSRC = man2/fork.2
+forkall.2 := SOSRC = man2/fork.2
+forkallx.2 := SOSRC = man2/fork.2
+forkx.2 := SOSRC = man2/fork.2
+
+pathconf.2 := SOSRC = man2/fpathconf.2
+
+putacct.2 := SOSRC = man2/getacct.2
+wracct.2 := SOSRC = man2/getacct.2
+
+getaudit_addr.2 := SOSRC = man2/getaudit.2
+setaudit.2 := SOSRC = man2/getaudit.2
+setaudit_addr.2 := SOSRC = man2/getaudit.2
+
+setauid.2 := SOSRC = man2/getauid.2
+
+setcontext.2 := SOSRC = man2/getcontext.2
+
+setgroups.2 := SOSRC = man2/getgroups.2
+
+setitimer.2 := SOSRC = man2/getitimer.2
+
+fgetlabel.2 := SOSRC = man2/getlabel.2
+
+getpmsg.2 := SOSRC = man2/getmsg.2
+
+setpflags.2 := SOSRC = man2/getpflags.2
+
+getpgid.2 := SOSRC = man2/getpid.2
+getpgrp.2 := SOSRC = man2/getpid.2
+getppid.2 := SOSRC = man2/getpid.2
+
+setppriv.2 := SOSRC = man2/getppriv.2
+
+setrlimit.2 := SOSRC = man2/getrlimit.2
+
+getegid.2 := SOSRC = man2/getuid.2
+geteuid.2 := SOSRC = man2/getuid.2
+getgid.2 := SOSRC = man2/getuid.2
+
+setustack.2 := SOSRC = man2/getustack.2
+
+openat.2 := SOSRC = man2/open.2
+
+pset_assign.2 := SOSRC = man2/pset_create.2
+pset_destroy.2 := SOSRC = man2/pset_create.2
+
+pset_getattr.2 := SOSRC = man2/pset_setattr.2
+
+putpmsg.2 := SOSRC = man2/putmsg.2
+
+pread.2 := SOSRC = man2/read.2
+readv.2 := SOSRC = man2/read.2
+
+renameat.2 := SOSRC = man2/rename.2
+
+semtimedop.2 := SOSRC = man2/semop.2
+
+getrctl.2 := SOSRC = man2/setrctl.2
+
+getprojid.2 := SOSRC = man2/settaskid.2
+gettaskid.2 := SOSRC = man2/settaskid.2
+
+setegid.2 := SOSRC = man2/setuid.2
+seteuid.2 := SOSRC = man2/setuid.2
+setgid.2 := SOSRC = man2/setuid.2
+
+shmat.2 := SOSRC = man2/shmop.2
+shmdt.2 := SOSRC = man2/shmop.2
+
+sigsendset.2 := SOSRC = man2/sigsend.2
+
+fstat.2 := SOSRC = man2/stat.2
+fstatat.2 := SOSRC = man2/stat.2
+lstat.2 := SOSRC = man2/stat.2
+
+fstatvfs.2 := SOSRC = man2/statvfs.2
+
+umount2.2 := SOSRC = man2/umount.2
+
+unlinkat.2 := SOSRC = man2/unlink.2
+
+futimesat.2 := SOSRC = man2/utimes.2
+
+vforkx.2 := SOSRC = man2/vfork.2
+
+pwrite.2 := SOSRC = man2/write.2
+writev.2 := SOSRC = man2/write.2
+
+.KEEP_STATE:
+
+include ../Makefile.man
+
+install: $(ROOTMANFILES)
diff --git a/usr/src/man/man2/__sparc_utrap_install.2 b/usr/src/man/man2/__sparc_utrap_install.2
new file mode 100644
index 0000000000..a40ba121a0
--- /dev/null
+++ b/usr/src/man/man2/__sparc_utrap_install.2
@@ -0,0 +1,416 @@
+'\" te
+.\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH __sparc_utrap_install 2 "11 Nov 1997" "SunOS 5.11" "System Calls"
+.SH NAME
+__sparc_utrap_install \- install a SPARC V9 user trap handler
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/utrap.h>
+
+\fBint\fR \fB__sparc_utrap_install\fR(\fButrap_entry_t\fR \fItype\fR,
+ \fButrap_handler_t\fR \fInew_precise\fR, \fButrap_handler_t\fR \fInew_deferred\fR,
+ \fButrap_handler_t *\fR\fIold_precise\fR, \fButrap_handler_t *\fR\fIold_deferred\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB__sparc_utrap_install()\fR function establishes \fInew_precise\fR and
+\fInew_deferred\fR user trap handlers as the new values for the specified
+\fItype\fR and returns the existing user trap handler values in
+\fB*\fR\fIold_precise\fR and \fB*\fR\fIold_deferred\fR in a single atomic
+operation. A new handler address of \fINULL\fR means no user handler of that
+type will be installed. A new handler address of \fBUTH_NOCHANGE\fR means that
+the user handler for that type should not be changed. An old handler pointer of
+\fINULL\fR means that the user is not interested in the old handler address.
+.sp
+.LP
+A \fIprecise trap\fR is caused by a specific instruction and occurs before any
+program-visible state has been changed by this instruction. When a precise trap
+occurs, the program counter (PC) saved in the Trap Program Counter (TPC)
+register points to the instruction that induced the trap; all instructions
+prior to this trapping instruction have been executed. The next program
+counter (nPC) saved in the Trap Next Program Counter (TnPC) register points to
+the next instruction following the trapping instruction, which has not yet been
+executed. A \fIdeferred trap\fR is also caused by a particular instruction,
+but unlike a precise trap, a deferred trap may occur after the program-visible
+state has been changed. See the \fISPARC Architecture Manual, Version 9\fR for
+further information on precise and deferred traps.
+.sp
+.LP
+The list that follows contains hardware traps and their corresponding user trap
+types. User trap types marked with a plus-sign (\fB+\fR) are required and must
+be provided by all ABI-conforming implementations. The others may not be
+present on every implementation; an attempt to install a user trap handler for
+those conditions will return \fBEINVAL\fR. User trap types marked with an
+asterisk (\fB*\fR) are implemented as precise traps only.
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.74i) |cw(2.76i)
+lw(2.74i) |lw(2.76i)
+.
+\fBTrap Name\fR\fBUser Trap Type (utrap_entry_t)\fR
+_
+\fBillegal_instruction\fRT{
+\fBUT_ILLTRAP_INSTRUCTION\fR +*\fB or UT_ILLEGAL_INSTRUCTION\fR
+T}
+_
+\fBfp_disabled\fR\fBUT_FP_DISABLED\fR +*
+_
+\fBfp_exception_ieee_754\fR\fBUT_FP_EXCEPTION_IEEE_754\fR +
+_
+\fBfp_exception_other\fR\fBUT_FP_EXCEPTION_OTHER\fR
+_
+\fBtag_overflow\fR\fBUT_TAG_OVERFLOW\fR +*
+_
+\fBdivision_by_zero\fR\fBUT_DIVISION_BY_ZERO\fR +
+_
+\fBmem_address_not_aligned\fR\fBUT_MEM_ADDRESS_NOT_ALIGNED\fR +
+_
+\fBprivileged_action\fR\fBUT_PRIVILEGED_ACTION\fR +
+_
+\fBprivileged_opcode\fR\fBUT_PRIVILEGED_OPCODE\fR
+_
+\fBasync_data_error\fR\fBUT_ASYNC_DATA_ERROR\fR
+_
+\fBtrap_instruction\fRT{
+\fBUT_TRAP_INSTRUCTION_16 \fRthrough \fBUT_TRAP_INSTRUCTION_31\fR +*
+T}
+_
+T{
+\fBinstruction_access_exception\fR \fBinstruction_access_MMU_miss\fR \fBinstruction_access_error\fR
+T}T{
+\fBUT_INSTRUCTION_EXCEPTION \fRor \fBUT_INSTRUCTION_PROTECTION \fRor \fBUT_INSTRUCTION_ERROR \fR
+T}
+_
+T{
+\fBdata_access_exception\fR \fBdata_access_MMU_miss\fR \fBdata_access_error\fR \fBdata_access_protection\fR
+T}T{
+\fBUT_DATA_EXCEPTION \fRor \fBUT_DATA_PROTECTION \fRor \fBUT_DATA_ERROR\fR
+T}
+.TE
+
+.sp
+.LP
+The following explanations are provided for those user trap types that are not
+self-explanatory.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_ILLTRAP_INSTRUCTION\fR\fR
+.ad
+.sp .6
+.RS 4n
+This trap is raised by user execution of the \fBILLTRAP\fR \fBINSTRUCTION.\fR
+It is always precise.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_ILLEGAL_INSTRUCTION\fR\fR
+.ad
+.sp .6
+.RS 4n
+This trap will be raised by the execution of otherwise undefined opcodes. It is
+implementation-dependent as to what opcodes raise this trap; the ABI only
+specifies the interface. The trap may be precise or deferred.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_PRIVILEGED_OPCODE\fR\fR
+.ad
+.sp .6
+.RS 4n
+All opcodes declared to be privileged in SPARC V9 will raise this trap. It is
+implementation-dependent whether other opcodes will raise it as well; the ABI
+only specifies the interface.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_DATA_EXCEPTION,\fR \fBUT_INSTRUCTION_EXCEPTION\fR\fR
+.ad
+.sp .6
+.RS 4n
+No valid user mapping can be made to this address, for a data or instruction
+access, respectively.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_DATA_PROTECTION,\fR \fBUT_INSTRUCTION_PROTECTION\fR\fR
+.ad
+.sp .6
+.RS 4n
+A valid mapping exists, and user privilege to it exists, but the type of access
+(read, write, or execute) is denied, for a data or instruction access,
+respectively.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_DATA_ERROR,\fR \fBUT_INSTRUCTION_ERROR\fR\fR
+.ad
+.sp .6
+.RS 4n
+A valid mapping exists, and both user privilege and the type of access are
+allowed, but an unrecoverable error occurred in attempting the access, for a
+data or instruction access, respectively. \fB%l1\fR will contain either
+\fBBUS_ADDRERR\fR or \fBBUS_OBJERR.\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUT_FP_DISABLED\fR\fR
+.ad
+.sp .6
+.RS 4n
+This trap is raised when an application issues a floating point instruction
+(including load or store) and the SPARC V9 Floating Point Registers State
+(FPRS) FEF bit is 0. If a user handler is installed for this trap, it will be
+given control. Otherwise the system will set FEF to one and retry the
+instruction.
+.RE
+
+.sp
+.LP
+For all traps, the handler executes in a new register window, where the
+\fIin\fR registers are the \fIout\fR registers of the previous frame and have
+the value they contained at the time of the trap, similar to a normal
+subroutine call after the \fBsave\fR instruction. The \fIglobal\fR registers
+(including the special registers \fB%ccr\fR, \fB%asi\fR, and \fB%y\fR) and the
+\fIfloating-point\fR registers have their values from the time of the trap. The
+stack pointer register \fB%sp\fR plus the BIAS will point to a properly-aligned
+128-byte register save area; if the handler needs scratch space, it should
+decrement the stack pointer to obtain it. If the handler needs access to the
+previous frame's \fIin\fR registers or \fIlocal\fR registers, it should execute
+a \fBFLUSHW\fR instruction, and then access them off of the frame pointer. If
+the handler calls an ABI-conforming function, it must set the \fB%asi\fR
+register to \fBASI_PRIMARY_NOFAULT\fR before the call.
+.sp
+.LP
+On entry to a precise user trap handler \fB%l6\fR contains the \fB%pc\fR and
+\fB%l7\fR contains the \fB%npc\fR at the time of the trap. To return from a
+handler and reexecute the trapped instruction, the handler would execute:
+.sp
+.in +2
+.nf
+jmpl %l6, %g0 ! Trapped PC supplied to user trap handler
+return %l7 ! Trapped nPC supplied to user trap handler
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+To return from a handler and skip the trapped instruction, the handler would
+execute:
+.sp
+.in +2
+.nf
+jmpl %l7, %g0 ! Trapped nPC supplied to user trap handler
+return %l7 + 4 ! Trapped nPC + 4
+.fi
+.in -2
+.sp
+
+.sp
+.LP
+On entry to a deferred trap handler \fB%o0\fR contains the address of the
+instruction that caused the trap and \fB%o1\fR contains the actual instruction
+(right-justified, zero-extended), if the information is available. Otherwise
+\fB%o0\fR contains the value \(mi1 and \fB%o1\fR is undefined. Additional
+information may be made available for certain cases of deferred traps, as
+indicated in the following table.
+.sp
+
+.sp
+.TS
+tab() box;
+lw(1.76i) |lw(3.74i)
+lw(1.76i) |lw(3.74i)
+.
+\fBInstructions\fR\fBAdditional Information\fR
+_
+LD-type (LDSTUB)T{
+\fB%o2\fR contains the effective address (\fIrs1\fR + \fIrs2\fR | \fIsimm13\fR).
+T}
+_
+ST-type (CAS, SWAP)T{
+\fB%o2\fR contains the effective address (\fI rs1\fR + \fIrs2\fR |\fIsimm13\fR).
+T}
+_
+Integer arithmeticT{
+\fB%o2\fR contains the \fIrs1\fR value. \fB%o3\fR contains the \fIrs2\fR | \fIsimm13\fR value. \fB%o4\fR contains the contents of the \fB%y\fR register.
+T}
+_
+Floating-point arithmeticT{
+\fB%o2\fR contains the address of \fIrs1\fR value. \fB%o3\fR contains the address of \fIrs2\fR value.
+T}
+_
+Control-transferT{
+\fB%o2\fR contains the target address (\fIrs1\fR + \fIrs2\fR | \fIsimm13\fR).
+T}
+_
+Asynchronous data errorsT{
+\fB%o2\fR contains the address that caused the error. \fB%o3\fR contains the effective ASI, if available, else \(mi1.
+T}
+.TE
+
+.sp
+.LP
+To return from a deferred trap, the trap handler issues:
+.sp
+.LP
+ta 68 ! ST_RETURN_FROM_DEFERRED_TRAP
+.sp
+.LP
+The following pseudo-code explains how the operating system dispatches traps:
+.sp
+.in +2
+.nf
+if (precise trap) {
+ if (precise_handler) {
+ invoke(precise_handler);
+ /* not reached */
+ } else {
+ convert_to_signal(precise_trap);
+ }
+ } else if (deferred_trap) {
+ invoke(deferred_handler);
+ /* not reached */
+ } else {
+ convert_to_signal(deferred_trap);
+ }
+ }
+ if (signal)
+ send(signal);
+.fi
+.in -2
+
+.sp
+.LP
+User trap handlers must preserve all registers except the \fIlocals\fR
+(\fB%l0-7\fR) and the \fIouts\fR (\fB%o0-7\fR), that is, \fB%i0-7\fR,
+\fB%g1-7\fR, \fB%d0-d62\fR, \fB%asi\fR, \fB%fsr\fR, \fB%fprs\fR, \fB%ccr\fR,
+and \fB%y,\fR except to the extent that modifying the registers is part of the
+desired functionality of the handler. For example, the handler for
+\fBUT_FP_DISABLED\fR may load floating-point registers.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, a non-zero value is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fB__sparc_utrap_install()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItype\fR argument is not a supported user trap type; the new user trap
+handler address is not word aligned; the old user trap handler address cannot
+be returned; or the user program is not a 64-bit executable.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRA sample program using the \fB__sparc_utrap_install()\fR
+function.
+.sp
+.LP
+The \fB__sparc_utrap_install()\fR function is normally used by user programs
+that wish to provide their own tailored exception handlers as a faster
+alternative to \fBsignal\fR(3C), or to handle exceptions that are not directly
+supported by the \fBsignal()\fR interface, such as \fBfp_disabled\fR.
+
+.sp
+.in +2
+.nf
+extern void *fpdis_trap_handler();
+utrap_handler_t new_precise = (utrap_handler_t)fpdis_trap_handler;
+double d;
+int err;
+err = __sparc_utrap_install(UT_FP_DISABLED, new_precise,
+ UTH_NOCHANGE, NULL, NULL);
+if (err == EINVAL) {
+ /* unexpected error, do something */
+ exit (1);
+}
+d = 1.0e-300;
+ENTRY(fpdis_trap_handler)
+wr %g0, FPRS_FEF, %fprs
+jmpl %l6, %g0
+return %l7
+SET_SIZE(fpdis_trap_handler)
+.fi
+.in -2
+
+.sp
+.LP
+This example turns on bit 2, FEF, in the Floating-Point Registers State (FPRS)
+Register, after a floating-point instruction causes an \fBfp_disabled\fR trap.
+(Note that this example simulates part of the default system behavior; programs
+do not need such a handler. The example is for illustrative purposes only.)
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsignal\fR(3C), \fBattributes\fR(5)
+.sp
+.LP
+\fISPARC Architecture Manual, Version 9\fR
+.sp
+.LP
+Manufacturer's processor chip user manuals
+.SH NOTES
+.sp
+.LP
+The Exceptions and Interrupt Descriptions section of the SPARC V9 manual
+documents which hardware traps are mandatory or optional, and whether they can
+be implemented as precise or deferred traps, or both. The manufacturer's
+processor chip user manuals describe the details of the traps supported for the
+specific processor implementation.
diff --git a/usr/src/man/man2/_lwp_cond_signal.2 b/usr/src/man/man2/_lwp_cond_signal.2
new file mode 100644
index 0000000000..4300294f32
--- /dev/null
+++ b/usr/src/man/man2/_lwp_cond_signal.2
@@ -0,0 +1,77 @@
+'\" te
+.\" Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_cond_signal 2 "8 Dec 1995" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_cond_signal, _lwp_cond_broadcast \- signal a condition variable
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+
+\fBint\fR \fB_lwp_cond_signal\fR(\fBlwp_cond_t *\fR\fIcvp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_cond_broadcast\fR(\fBlwp_cond_t *\fR\fIcvp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB_lwp_cond_signal()\fR function unblocks one LWP that is blocked on the
+LWP condition variable pointed to by \fIcvp\fR.
+.sp
+.LP
+The \fB_lwp_cond_broadcast()\fR function unblocks all LWPs that are blocked on
+the LWP condition variable pointed to by \fIcvp\fR.
+.sp
+.LP
+If no LWPs are blocked on the LWP condition variable, then
+\fB_lwp_cond_signal()\fR and \fB_lwp_cond_broadcast()\fR have no effect.
+.sp
+.LP
+Both functions should be called under the protection of the same LWP mutex lock
+that is used with the LWP condition variable being signaled. Otherwise, the
+condition variable may be signalled between the test of the associated
+condition and blocking in \fB_lwp_cond_wait()\fR. This can cause an infinite
+wait.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. A non-zero value indicates an
+error.
+.SH ERRORS
+.sp
+.LP
+The \fB_lwp_cond_signal()\fR and \fB_lwp_cond_broadcast()\fR functions will
+fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIcvp\fR argument points to an invalid LWP condition variable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIcvp\fR argument points to an invalid address.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fB_lwp_cond_wait\fR(2), \fB_lwp_mutex_lock\fR(2)
diff --git a/usr/src/man/man2/_lwp_cond_wait.2 b/usr/src/man/man2/_lwp_cond_wait.2
new file mode 100644
index 0000000000..e6d6c33002
--- /dev/null
+++ b/usr/src/man/man2/_lwp_cond_wait.2
@@ -0,0 +1,220 @@
+'\" te
+.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_cond_wait 2 "13 Apr 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_cond_wait, _lwp_cond_timedwait, _lwp_cond_reltimedwait \- wait on a
+condition variable
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+
+\fBint\fR \fB_lwp_cond_wait\fR(\fBlwp_cond_t *\fR\fIcvp\fR, \fBlwp_mutex_t *\fR\fImp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_cond_timedwait\fR(\fBlwp_cond_t *\fR\fIcvp\fR, \fBlwp_mutex_t *\fR\fImp\fR,
+ \fBtimestruc_t *\fR\fIabstime\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_cond_reltimedwait\fR(\fBlwp_cond_t *\fR\fIcvp\fR, \fBlwp_mutex_t *\fR\fImp\fR,
+ \fBtimestruc_t *\fR\fIreltime\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+These functions are used to wait for the occurrence of a condition represented
+by an LWP condition variable. LWP condition variables must be initialized to 0
+before use.
+.sp
+.LP
+The \fB_lwp_cond_wait()\fR function atomically releases the LWP mutex pointed
+to by \fImp\fR and causes the calling LWP to block on the LWP condition
+variable pointed to by \fIcvp\fR. The blocked LWP may be awakened by
+\fB_lwp_cond_signal\fR(2), \fB_lwp_cond_broadcast\fR(2), or when interrupted by
+delivery of a signal. Any change in value of a condition associated with the
+condition variable cannot be inferred by the return of \fB_lwp_cond_wait()\fR
+and any such condition must be re-evaluated.
+.sp
+.LP
+The \fB_lwp_cond_timedwait()\fR function is similar to \fB_lwp_cond_wait()\fR,
+except that the calling LWP will not block past the time of day specified by
+\fIabstime\fR. If the time of day becomes greater than \fIabstime\fR,
+\fB_lwp_cond_timedwait()\fR returns with the error code \fBETIME\fR.
+.sp
+.LP
+The \fB_lwp_cond_reltimedwait()\fR function is similar to
+\fB_lwp_cond_wait()\fR, except that the calling LWP will not block past the
+relative time specified by \fIreltime\fR. If the time of day becomes greater
+than the starting time of day plus \fIreltime\fR,
+\fB_lwp_cond_reltimedwait()\fR returns with the error code \fBETIME\fR.
+.sp
+.LP
+The \fB_lwp_cond_wait()\fR, \fB_lwp_cond_timedwait()\fR, and
+\fB_lwp_cond_reltimedwait()\fR functions always return with the mutex locked
+and owned by the calling lightweight process.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. A non-zero value indicates an
+error.
+.SH ERRORS
+.sp
+.LP
+If any of the following conditions are detected, \fB_lwp_cond_wait()\fR,
+\fB_lwp_cond_timedwait()\fR, and \fB_lwp_cond_reltimedwait()\fR fail and return
+the corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIcvp\fR argument points to an invalid LWP condition variable or the
+\fImp\fR argument points to an invalid LWP mutex.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fImp\fR, \fIcvp\fR, or \fIabstime\fR argument points to an illegal
+address.
+.RE
+
+.sp
+.LP
+If any of the following conditions occur, \fB_lwp_cond_wait()\fR,
+\fB_lwp_cond_timedwait()\fR, and \fB_lwp_cond_reltimedwait()\fR fail and return
+the corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 9n
+.rt
+The call was interrupted by a signal or \fBfork\fR(2).
+.RE
+
+.sp
+.LP
+If any of the following conditions occur, \fB_lwp_cond_timedwait()\fR and
+\fB_lwp_cond_reltimedwait()\fR fail and return the corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBETIME\fR\fR
+.ad
+.RS 9n
+.rt
+The time specified in\fIabstime\fR or \fIreltime\fR has passed.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUse the \fB_lwp_cond_wait()\fR function in a loop testing some
+condition.
+.sp
+.LP
+The \fB_lwp_cond_wait()\fR function is normally used in a loop testing some
+condition, as follows:
+
+.sp
+.in +2
+.nf
+lwp_mutex_t m;
+lwp_cond_t cv;
+int cond;
+(void) _lwp_mutex_lock(&m);
+while (cond == FALSE) {
+ (void) _lwp_cond_wait(&cv, &m);
+}
+(void) _lwp_mutex_unlock(&m);
+.fi
+.in -2
+
+.LP
+\fBExample 2 \fRUse the \fB_lwp_cond_timedwait()\fR function in a loop testing
+some condition.
+.sp
+.LP
+The \fB_lwp_cond_timedwait()\fR function is also normally used in a loop
+testing some condition. It uses an absolute timeout value as follows:
+
+.sp
+.in +2
+.nf
+timestruc_t to;
+lwp_mutex_t m;
+lwp_cond_t cv;
+int cond, err;
+(void) _lwp_mutex_lock(&m);
+to.tv_sec = time(NULL) + TIMEOUT;
+to.tv_nsec = 0;
+while (cond == FALSE) {
+ err = _lwp_cond_timedwait(&cv, &m, &to);
+ if (err == ETIME) {
+ /* timeout, do something */
+ break;
+ SENDwhom}
+}
+(void) _lwp_mutex_unlock(&m);
+.fi
+.in -2
+
+.sp
+.LP
+This example sets a bound on the total wait time even though the
+\fB_lwp_cond_timedwait()\fR may return several times due to the condition being
+signalled or the wait being interrupted.
+
+.LP
+\fBExample 3 \fRUse the \fB_lwp_cond_reltimedwait()\fR function in a loop
+testing some condition.
+.sp
+.LP
+The \fB_lwp_cond_reltimedwait()\fR function is also normally used in a loop
+testing some condition. It uses a relative timeout value as follows:
+
+.sp
+.in +2
+.nf
+timestruc_t to;
+lwp_mutex_t m;
+lwp_cond_t cv;
+int cond, err;
+(void) _lwp_mutex_lock(&m);
+while (cond == FALSE) {
+ to.tv_sec = TIMEOUT;
+ to.tv_nsec = 0;
+ err = _lwp_cond_reltimedwait(&cv, &m, &to);
+ if (err == ETIME) {
+ /* timeout, do something */
+ break;
+ }
+}
+(void) _lwp_mutex_unlock(&m);
+.fi
+.in -2
+
+.SH SEE ALSO
+.sp
+.LP
+\fB_lwp_cond_broadcast\fR(2), \fB_lwp_cond_signal\fR(2), \fB_lwp_kill\fR(2),
+\fB_lwp_mutex_lock\fR(2), \fBfork\fR(2), \fBkill\fR(2)
diff --git a/usr/src/man/man2/_lwp_info.2 b/usr/src/man/man2/_lwp_info.2
new file mode 100644
index 0000000000..05e72423ae
--- /dev/null
+++ b/usr/src/man/man2/_lwp_info.2
@@ -0,0 +1,100 @@
+'\" te
+.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_info 2 "8 Aug 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_info \- return the time-accounting information of a single LWP
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/time.h>
+#include <sys/lwp.h>
+
+\fBint\fR \fB_lwp_info\fR(\fBstruct lwpinfo *\fR\fIbuffer\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB_lwp_info()\fR function fills the \fBlwpinfo\fR structure pointed to by
+\fIbuffer\fR with time-accounting information pertaining to the calling LWP.
+This call may be extended in the future to return other information to the
+\fBlwpinfo\fR structure as needed. The \fBlwpinfo\fR structure in
+<\fBsys/lwp.h\fR> includes the following members:
+.sp
+.in +2
+.nf
+timestruc_t lwp_utime;
+timestruc_t lwp_stime;
+.fi
+.in -2
+
+.sp
+.LP
+The \fBlwp_utime\fR member is the CPU time used while executing instructions in
+the user space of the calling LWP.
+.sp
+.LP
+The \fBlwp_stime\fR member is the CPU time used by the system on behalf of the
+calling LWP.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB_lwp_info()\fR returns \fB0\fR and fills in
+the \fBlwpinfo\fR structure pointed to by \fIbuffer\fR.
+.SH ERRORS
+.sp
+.LP
+If the following condition is detected, \fB_lwp_info()\fR returns the
+corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuffer\fR argument points to an illegal address.
+.RE
+
+.sp
+.LP
+Additionally, the \fB_lwp_info()\fR function will fail for 32-bit interfaces
+if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The size of the \fBtv_sec\fR member of the \fBtimestruc_t\fR type pointed to by
+\fBlwp_utime\fR and \fBlwp_stime\fR is too small to contain the correct number
+of seconds.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBtimes\fR(2), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/_lwp_kill.2 b/usr/src/man/man2/_lwp_kill.2
new file mode 100644
index 0000000000..cdcb4c6462
--- /dev/null
+++ b/usr/src/man/man2/_lwp_kill.2
@@ -0,0 +1,82 @@
+'\" te
+.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_kill 2 "8 Aug 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_kill \- send a signal to a LWP
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+#include <signal.h>
+
+\fBint\fR \fB_lwp_kill\fR(\fBlwpid_t\fR \fItarget_lwp\fR, \fBint\fR \fIsig\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB_lwp_kill()\fR function sends a signal to the LWP specified by
+\fItarget_lwp\fR. The signal that is to be sent is specified by \fIsig\fR and
+must be one from the list given in \fBsignal.h\fR(3HEAD). If \fIsig\fR is 0
+(the null signal), error checking is performed but no signal is actually sent.
+This can be used to check the validity of \fItarget_lwp\fR.
+.sp
+.LP
+The \fItarget_lwp\fR must be an LWP within the same process as the calling LWP.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. A non-zero value indicates an
+error.
+.SH ERRORS
+.sp
+.LP
+If any of the following conditions occur, \fB_lwp_kill()\fR fails and returns
+the corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsig\fR argument is not a valid signal number.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItarget_lwp\fR argument cannot be found in the current process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBkill\fR(2), \fBsigaction\fR(2), \fBsigprocmask\fR(2), \fBsignal.h\fR(3HEAD),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/_lwp_mutex_lock.2 b/usr/src/man/man2/_lwp_mutex_lock.2
new file mode 100644
index 0000000000..69841cb737
--- /dev/null
+++ b/usr/src/man/man2/_lwp_mutex_lock.2
@@ -0,0 +1,102 @@
+'\" te
+.\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_mutex_lock 2 "30 Jul 1992" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_mutex_lock, _lwp_mutex_unlock, _lwp_mutex_trylock \- mutual exclusion
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+
+\fBint\fR \fB_lwp_mutex_lock\fR(\fBlwp_mutex_t *\fR\fImp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_mutex_trylock\fR(\fBlwp_mutex_t *\fR\fImp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_mutex_unlock\fR(\fBlwp_mutex_t *\fR\fImp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+These functions serialize the execution of lightweight processes. They are
+useful for ensuring that only one lightweight process can execute a critical
+section of code at any one time (mutual exclusion). LWP mutexes must be
+initialized to 0 before use.
+.sp
+.LP
+The \fB_lwp_mutex_lock()\fR function locks the LWP mutex pointed to by
+\fImp\fR. If the mutex is already locked, the calling LWP blocks until the
+mutex becomes available. When \fB_lwp_mutex_lock()\fR returns, the mutex is
+locked and the calling LWP is the "owner".
+.sp
+.LP
+The \fB_lwp_mutex_trylock()\fR function attempts to lock the mutex. If the
+mutex is already locked it returns with an error. If the mutex is unlocked, it
+is locked and \fB_lwp_mutex_trylock()\fR returns.
+.sp
+.LP
+The \fB_lwp_mutex_unlock()\fR function unlocks a locked mutex. The mutex must
+be locked and the calling LWP must be the one that last locked the mutex (the
+owner). If any other LWPs are waiting for the mutex to become available, one of
+them is unblocked.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. A non-zero value indicates an
+error.
+.SH ERRORS
+.sp
+.LP
+If any of the following conditions are detected, \fB_lwp_mutex_lock()\fR,
+\fB_lwp_mutex_trylock()\fR, and \fB_lwp_mutex_unlock()\fR fail and return the
+corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fImp\fR argument points to an invalid LWP mutex.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fImp\fR argument points to an illegal address.
+.RE
+
+.sp
+.LP
+If any of the following conditions occur, \fB_lwp_mutex_trylock()\fR fails and
+returns the corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 9n
+.rt
+The \fImp\fR argument points to a locked mutex.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fB_lwp_cond_wait\fR(2)
diff --git a/usr/src/man/man2/_lwp_self.2 b/usr/src/man/man2/_lwp_self.2
new file mode 100644
index 0000000000..8f117b1827
--- /dev/null
+++ b/usr/src/man/man2/_lwp_self.2
@@ -0,0 +1,41 @@
+'\" te
+.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_self 2 "8 Aug 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_self \- get LWP identifier
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+
+\fBlwpid_t\fR \fB_lwp_self\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB_lwp_self()\fR function returns the ID of the calling LWP.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/_lwp_sema_wait.2 b/usr/src/man/man2/_lwp_sema_wait.2
new file mode 100644
index 0000000000..bd9b881182
--- /dev/null
+++ b/usr/src/man/man2/_lwp_sema_wait.2
@@ -0,0 +1,136 @@
+'\" te
+.\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_sema_wait 2 "8 May 1998" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_sema_wait, _lwp_sema_trywait, _lwp_sema_init, _lwp_sema_post \- semaphore
+operations
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+
+\fBint\fR \fB_lwp_sema_wait\fR(\fBlwp_sema_t *\fR\fIsema\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_sema_trywait\fR(\fBlwp_sema_t *\fR\fIsema\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_sema_init\fR(\fBlwp_sema_t *\fR\fIsema\fR, \fBint\fR \fIcount\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_sema_post\fR(\fBlwp_sema_t *\fR\fIsema\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+Conceptually, a semaphore is an non-negative integer count that is atomically
+incremented and decremented. Typically this represents the number of resources
+available. The \fB_lwp_sema_init()\fR function initializes the count,
+\fB_lwp_sema_post()\fR atomically increments the count, and
+\fB_lwp_sema_wait()\fR waits for the count to become greater than 0 and then
+atomically decrements it.
+.sp
+.LP
+LWP semaphores must be initialized before use. The \fB_lwp_sema_init()\fR
+function initializes the count associated with the LWP semaphore pointed to by
+\fIsema\fR to \fIcount\fR.
+.sp
+.LP
+The \fB_lwp_sema_wait()\fR function blocks the calling LWP until the semaphore
+count becomes greater than 0 and then atomically decrements it.
+.sp
+.LP
+The \fB_lwp_sema_trywait()\fR function atomically decrements the count if it is
+greater than zero. Otherwise it returns an error.
+.sp
+.LP
+The \fB_lwp_sema_post()\fR function atomically increments the semaphore count.
+If there are any LWPs blocked on the semaphore, one is unblocked.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. A non-zero value indicates an
+error.
+.SH ERRORS
+.sp
+.LP
+The \fB_lwp_sema_init()\fR, \fB_lwp_sema_trywait()\fR, \fB_lwp_sema_wait()\fR,
+and \fB_lwp_sema_post()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsema\fR argument points to an invalid semaphore.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsema\fR argument points to an illegal address.
+.RE
+
+.sp
+.LP
+The \fB_lwp_sema_wait()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 9n
+.rt
+The function execution was interrupted by a signal or \fBfork\fR(2).
+.RE
+
+.sp
+.LP
+The \fB_lwp_sema_trywait()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 9n
+.rt
+The function was called on a semaphore with a zero count.
+.RE
+
+.sp
+.LP
+The \fB_lwp_sema_post()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The value of the \fIsema\fR argument exceeds \fBSEM_VALUE_MAX\fR.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBfork\fR(2)
diff --git a/usr/src/man/man2/_lwp_suspend.2 b/usr/src/man/man2/_lwp_suspend.2
new file mode 100644
index 0000000000..6e0f4331eb
--- /dev/null
+++ b/usr/src/man/man2/_lwp_suspend.2
@@ -0,0 +1,79 @@
+'\" te
+.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH _lwp_suspend 2 "13 Aug 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+_lwp_suspend, _lwp_continue \- continue or suspend LWP execution
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/lwp.h>
+
+\fBint\fR \fB_lwp_suspend\fR(\fBlwpid_t\fR \fItarget_lwp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fB_lwp_continue\fR(\fBlwpid_t\fR \fItarget_lwp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fB_lwp_suspend()\fR function immediately suspends the execution of the LWP
+specified by \fItarget_lwp\fR. On successful return from \fB_lwp_suspend()\fR,
+\fItarget_lwp\fR is no longer executing. Once a thread is suspended, subsequent
+calls to \fB_lwp_suspend()\fR have no affect.
+.sp
+.LP
+The \fB_lwp_continue()\fR function resumes the execution of a suspended LWP.
+Once a suspended LWP is continued, subsequent calls to \fB_lwp_continue()\fR
+have no effect.
+.sp
+.LP
+A suspended LWP will not be awakened by a signal. The signal stays pending
+until the execution of the LWP is resumed by \fB_lwp_continue()\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. A non-zero value indicates an
+error.
+.SH ERRORS
+.sp
+.LP
+If the following condition occurs, \fB_lwp_suspend()\fR and
+\fB_lwp_continue()\fR fail and return the corresponding value:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 9n
+.rt
+The \fItarget_lwpid\fR argument cannot be found in the current process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/access.2 b/usr/src/man/man2/access.2
new file mode 100644
index 0000000000..3be767eebe
--- /dev/null
+++ b/usr/src/man/man2/access.2
@@ -0,0 +1,379 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
+.\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
+.\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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. 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. 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]
+.TH access 2 "16 Jun 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+access, faccessat \- determine accessibility of a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+#include <sys/fcntl.h>
+
+\fBint\fR \fBaccess\fR(\fBconst char *\fR\fIpath\fR, \fBint\fR \fIamode\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfaccessat\fR(\fBint\fR \fIfd\fR, \fBconst char *\fR\fIpath\fR, \fBint\fR \fIamode\fR, \fBint\fR \fIflag\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBaccess()\fR function checks the file named by the pathname pointed to by
+the \fIpath\fR argument for accessibility according to the bit pattern
+contained in \fIamode\fR, using the real user \fBID\fR in place of the
+effective user \fBID\fR and the real group \fBID\fR in place of the effective
+group ID. This allows a setuid process to verify that the user running it would
+have had permission to access this file.
+.sp
+.LP
+The value of \fIamode\fR is either the bitwise inclusive \fBOR\fR of the access
+permissions to be checked (\fBR_OK\fR, \fBW_OK\fR, \fBX_OK\fR) or the existence
+test, \fBF_OK\fR.
+.sp
+.LP
+These constants are defined in <\fBunistd.h\fR> as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBR_OK\fR\fR
+.ad
+.RS 8n
+.rt
+Test for read permission.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBW_OK\fR\fR
+.ad
+.RS 8n
+.rt
+Test for write permission.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBX_OK\fR\fR
+.ad
+.RS 8n
+.rt
+Test for execute or search permission.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_OK\fR\fR
+.ad
+.RS 8n
+.rt
+Check existence of file
+.RE
+
+.sp
+.LP
+See \fBIntro\fR(2) for additional information about "File Access Permission".
+.sp
+.LP
+If any access permissions are to be checked, each will be checked individually,
+as described in \fBIntro\fR(2). If the process has appropriate privileges, an
+implementation may indicate success for \fBX_OK\fR even if none of the execute
+file permission bits are set.
+.sp
+.LP
+The \fBfaccessat()\fR function is equivalent to the \fBaccess()\fR function,
+except in the case where \fIpath\fR specifies a relative path. In this case the
+file whose accessibility is to be determined is located relative to the
+directory associated with the file descriptor \fIfd\fR instead of the current
+working directory.
+.sp
+.LP
+If \fBfaccessat()\fR is passed in the \fIfd\fR parameter the special value
+\fBAT_FDCWD\fR, defined in \fB<fcntl.h>\fR, the current working directory is
+used and the behavior is identical to a call to \fBaccess()\fR.
+.sp
+.LP
+Values for \fIflag\fR are constructed by a bitwise-inclusive OR of flags from
+the following list, defined in \fB<fcntl.h>\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAT_EACCESS\fR\fR
+.ad
+.RS 14n
+.rt
+The checks for accessibility are performed using the effective user and group
+IDs instead of the real user and group ID as required in a call to
+\fBaccess()\fR.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+If the requested access is permitted, \fBaccess()\fR and
+\fBfaccessat()\fRsucceed and return \fB0\fR. Otherwise, \fB\(mi1\fR is returned
+and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBaccess()\fR and \fBfaccessat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Permission bits of the file mode do not permit the requested access, or search
+permission is denied on a component of the path prefix.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the \fBaccess()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in resolving \fIpath\fR, or loop
+exists in symbolic links encountered during resolution of the \fIpath\fR
+argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR}, or a pathname
+component is longer than {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of \fIpath\fR does not name an existing file or \fIpath\fR is an
+empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a character or block device special file and
+the corresponding device has been retired by the fault management framework.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+Write access is requested for a file on a read-only file system.
+.RE
+
+.sp
+.LP
+The \fBfaccessat()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 9n
+.rt
+The \fIpath\fR argument does not specify an absolute path and the \fIfd\fR
+argument is neither \fBAT_FDCWD\fR nor a valid file descriptor open for reading
+or searching.
+.RE
+
+.sp
+.LP
+The \fBaccess()\fR and \fBfaccessat()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The value of the \fIamode\fR argument is invalid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+Pathname resolution of a symbolic link produced an intermediate result whose
+length exceeds {\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBETXTBSY\fR\fR
+.ad
+.RS 16n
+.rt
+Write access is requested for a pure procedure (shared text) file that is being
+executed.
+.RE
+
+.sp
+.LP
+The \fBfaccessat()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The value of the \fIflag\fR argument is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIpath\fR argument is not an absolute path and \fIfd\fR is neither
+\fBAT_FDCWD\fR nor a file descriptor associated with a directory.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Additional values of \fIamode\fR other than the set defined in the description
+might be valid, for example, if a system has extended access controls.
+.sp
+.LP
+The purpose of the \fBfaccessat()\fR function is to enable the checking of the
+accessibility of files in directories other than the current working directory
+without exposure to race conditions. Any part of the path of a file could be
+changed in parallel to a call to \fBaccess()\fR, resulting in unspecified
+behavior. By opening a file descriptor for the target directory and using the
+\fBfaccessat()\fR function, it can be guaranteed that the file tested for
+accessibility is located relative to the desired directory.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee below.
+.TE
+
+.sp
+.LP
+For \fBaccess()\fR, see \fBstandards\fR(5).
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBchmod\fR(2), \fBstat\fR(2), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/acct.2 b/usr/src/man/man2/acct.2
new file mode 100644
index 0000000000..8e576a2196
--- /dev/null
+++ b/usr/src/man/man2/acct.2
@@ -0,0 +1,150 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH acct 2 "20 Jan 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+acct \- enable or disable process accounting
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBacct\fR(\fBconst char *\fR\fIpath\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBacct()\fR function enables or disables the system process accounting
+routine. If the routine is enabled, an accounting record will be written in an
+accounting file for each process that terminates. The termination of a process
+can be caused by either an \fBexit\fR(2) call or a \fBsignal\fR(3C)). The
+effective user \fBID\fR of the process calling \fBacct()\fR must have the
+appropriate privileges.
+.sp
+.LP
+The \fIpath\fR argument points to the pathname of the accounting file, whose
+file format is described on the \fBacct.h\fR(3HEAD) manual page.
+.sp
+.LP
+The accounting routine is enabled if \fIpath\fR is non-zero and no errors occur
+during the function. It is disabled if \fIpath\fR is \fB(char *)NULL\fR and
+no errors occur during the function.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBacct()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+The file named by \fIpath\fR is not an ordinary file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 16n
+.rt
+An attempt is being made to enable accounting using the same file that is
+currently being used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR}, or the length
+of a \fIpath\fR argument exceeds {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR
+is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+One or more components of the accounting file pathname do not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The {\fBPRIV_SYS_ACCT\fR} privilege is not asserted in the effective set of the
+calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The named file resides on a read-only file system.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexit\fR(2), \fBacct.h\fR(3HEAD), \fBsignal\fR(3C), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/acl.2 b/usr/src/man/man2/acl.2
new file mode 100644
index 0000000000..5d433da0e6
--- /dev/null
+++ b/usr/src/man/man2/acl.2
@@ -0,0 +1,308 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH acl 2 "10 Jan 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+acl, facl \- get or set a file's Access Control List (ACL)
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/acl.h>
+
+\fBint\fR \fBacl\fR(\fBchar *\fR\fIpathp\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fInentries\fR, \fBvoid *\fR\fIaclbufp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfacl\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIcmd\fR, \fBint\fR \fInentries\fR, \fBvoid *\fR\fIaclbufp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBacl()\fR and \fBfacl()\fR functions get or set the \fBACL\fR of a file
+whose name is given by \fIpathp\fR or referenced by the open file descriptor
+\fIfildes\fR. The \fInentries\fR argument specifies how many \fBACL\fR entries
+fit into buffer \fIaclbufp\fR. The \fBacl()\fR function is used to manipulate
+\fBACL\fR on file system objects.
+.sp
+.LP
+The following types are supported for \fIaclbufp\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBaclent_t\fR\fR
+.ad
+.RS 12n
+.rt
+Used by the UFS file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBace_t\fR\fR
+.ad
+.RS 12n
+.rt
+Used by the ZFS and NFSv4 file systems.
+.RE
+
+.sp
+.LP
+The following values for \fIcmd\fR are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSETACL\fR\fR
+.ad
+.RS 17n
+.rt
+\fInentries\fR \fBaclent_t\fR \fBACL\fR entries, specified in buffer
+\fIaclbufp\fR, are stored in the file's \fBACL\fR. All directories in the path
+name must be searchable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETACL\fR\fR
+.ad
+.RS 17n
+.rt
+Buffer \fIaclbufp\fR is filled with the file's \fBaclent_t\fR \fBACL\fR
+entries. Read access to the file is not required, but all directories in the
+path name must be searchable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETACLCNT\fR\fR
+.ad
+.RS 17n
+.rt
+The number of entries in the file's \fBaclent_t\fR \fBACL\fR is returned. Read
+access to the file is not required, but all directories in the path name must
+be searchable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBACE_SETACL\fR\fR
+.ad
+.RS 17n
+.rt
+\fInentries\fR \fBace_t\fR ACL entries, specified in buffer \fIaclbufp\fR, are
+stored in the file's ACL. All directories in the path name must be searchable.
+Write ACL access is required to change the file's ACL.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBACE_GETACL\fR\fR
+.ad
+.RS 17n
+.rt
+Buffer \fIaclbufp\fR is filled with the file's \fBace_t\fR ACL entries. Read
+access to the file is required and all directories in the path name must be
+searchable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBACE_GETACLCNT\fR\fR
+.ad
+.RS 17n
+.rt
+The number of entries in the file's \fBace_t\fR ACL is returned. Read access
+to the file is required and all directories in the path name must be
+searchable.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBacl()\fR and \fBfacl()\fR return \fB0\fR if
+\fIcmd\fR is \fBSETACL\fR or \fBACE_SETACL\fR. If \fIcmd\fR is \fBGETACL\fR,
+\fBGETACLCNT\fR, \fBACE_GETACL\fR or \fBACE_GETACLCNT\fR, the number of
+\fBACL\fR entries is returned. Otherwise, \fB\(mi1\fR is returned and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBacl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 11n
+.rt
+The caller does not have access to a component of the pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIpathp\fR or \fIaclbufp\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is not \fBGETACL\fR, \fBSETACL\fR, \fBACE_GETACL\fR,
+\fBGETACLCNT\fR, or \fBACE_GETACLCNT\fR; the \fIcmd\fR argument is
+\fBSETACL\fR and \fInentries\fR is less than 3; or the \fIcmd\fR argument is
+\fBSETACL\fR or \fBACE_SETACL\fR and the \fBACL\fR specified in \fIaclbufp\fR
+is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 11n
+.rt
+A disk I/O error has occurred while storing or retrieving the \fBACL.\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 11n
+.rt
+A component of the path does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is \fBGETACL\fR and \fInentries\fR is less than the
+number of entries in the file's \fBACL\fR, or the \fIcmd\fR argument is
+\fBSETACL\fR and there is insufficient space in the file system to store the
+\fBACL\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSYS\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is \fBSETACL\fR or \fBACE_SETACL\fR and the file
+specified by \fIpathp\fR resides on a file system that does not support
+\fBACLs\fR, or the \fBacl()\fR function is not supported by this
+implementation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 11n
+.rt
+A component of the path specified by \fIpathp\fR is not a directory, or the
+\fIcmd\fR argument is \fBSETACL\fR or \fBACE_SETACL\fR and an attempt is made
+to set a default \fBACL\fR on a file type other than a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is \fBGETACL\fR, but the ACL is composed of \fBace_t\fR
+entries, and the ACL cannot be translated into \fBaclent_t\fR form.
+.sp
+The \fIcmd\fR argument is \fBACE_SETACL\fR, but the underlying filesystem only
+supports ACLs composed of \fBaclent_t\fR entries and the ACL could not be
+translated into \fBaclent_t\fR form.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The effective user \fBID\fR does not match the owner of the file and the
+process does not have appropriate privilege.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is \fBSETACL\fR or \fBACE_SETACL\fR and the file
+specified by \fIpathp\fR resides on a file system that is mounted read-only.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgetfacl\fR(1), \fBsetfacl\fR(1), \fBaclcheck\fR(3SEC), \fBaclsort\fR(3SEC)
diff --git a/usr/src/man/man2/adjtime.2 b/usr/src/man/man2/adjtime.2
new file mode 100644
index 0000000000..bcefc4398f
--- /dev/null
+++ b/usr/src/man/man2/adjtime.2
@@ -0,0 +1,113 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
+.TH adjtime 2 "20 Jan 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+adjtime \- correct the time to allow synchronization of the system clock
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/time.h>
+
+\fBint\fR \fBadjtime\fR(\fBstruct timeval *\fR\fIdelta\fR, \fBstruct timeval *\fR\fIolddelta\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBadjtime()\fR function adjusts the system's notion of the current time as
+returned by \fBgettimeofday\fR(3C), advancing or retarding it by the amount of
+time specified in the \fBstruct\fR \fBtimeval\fR pointed to by \fIdelta\fR.
+.sp
+.LP
+The adjustment is effected by speeding up (if that amount of time is positive)
+or slowing down (if that amount of time is negative) the system's clock by some
+small percentage, generally a fraction of one percent. The time is always a
+monotonically increasing function. A time correction from an earlier call to
+\fBadjtime()\fR may not be finished when \fBadjtime()\fR is called again.
+.sp
+.LP
+If \fIdelta\fR is 0, then \fIolddelta\fR returns the status of the effects of
+the previous \fBadjtime()\fR call with no effect on the time correction as a
+result of this call. If \fIolddelta\fR is not a null pointer, then the
+structure it points to will contain, upon successful return, the number of
+seconds and/or microseconds still to be corrected from the earlier call. If
+\fIolddelta\fR is a null pointer, the corresponding information will not be
+returned.
+.sp
+.LP
+This call may be used in time servers that synchronize the clocks of computers
+in a local area network. Such time servers would slow down the clocks of some
+machines and speed up the clocks of others to bring them to the average network
+time.
+.sp
+.LP
+Only a processes with appropriate privileges can adjust the time of day.
+.sp
+.LP
+The adjustment value will be silently rounded to the resolution of the system
+clock.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBadjtime()\fR returns \fB0\fR. Otherwise, it
+returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBadjtime()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIdelta\fR or \fIolddelta\fR argument points outside the process's
+allocated address space, or \fIolddelta\fR points to a region of the process's
+allocated address space that is not writable.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBtv_usec\fR member of \fIdelta\fR is not within valid range (\(mi1000000
+to 1000000).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_TIME\fR} privilege is not asserted in the effective set of the
+calling process.
+.RE
+
+.sp
+.LP
+Additionally, the \fBadjtime()\fR function will fail for 32-bit interfaces if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The size of the \fBtv_sec\fR member of the \fBtimeval\fR structure pointed to
+by \fIolddelta\fR is too small to contain the correct number of seconds.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBdate\fR(1), \fBgettimeofday\fR(3C), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/alarm.2 b/usr/src/man/man2/alarm.2
new file mode 100644
index 0000000000..73bfaaa279
--- /dev/null
+++ b/usr/src/man/man2/alarm.2
@@ -0,0 +1,76 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH alarm 2 "6 Jun 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+alarm \- schedule an alarm signal
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBunsigned int\fR \fBalarm\fR(\fBunsigned int\fR \fIseconds\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBalarm()\fR function causes the system to generate a \fBSIGALRM\fR signal
+for the process after the number of real-time seconds specified by seconds
+have elapsed (see \fBsignal.h\fR(3HEAD)). Processor scheduling delays may
+prevent the process from handling the signal as soon as it is generated.
+.sp
+.LP
+If \fIseconds\fR is 0, a pending alarm request, if any, is cancelled. If
+\fIseconds\fR is greater than \fBLONG_MAX\fR/\fIhz\fR, \fIseconds\fR is rounded
+down to \fBLONG_MAX\fR/\fIhz\fR. The value of \fIhz\fR is normally 100.
+.sp
+.LP
+Alarm requests are not stacked; only one \fBSIGALRM\fR generation can be
+scheduled in this manner; if the \fBSIGALRM\fR signal has not yet been
+generated, the call will result in rescheduling the time at which the
+\fBSIGALRM\fR signal will be generated.
+.sp
+.LP
+The \fBfork\fR(2) function clears pending alarms in the child process. A new
+process image created by one of the \fBexec\fR(2) functions inherits the time
+left to an alarm signal in the old process's image.
+.SH RETURN VALUES
+.sp
+.LP
+If there is a previous alarm request with time remaining, \fBalarm()\fR
+returns a non-zero value that is the number of seconds until the previous
+request would have generated a \fBSIGALRM\fR signal. Otherwise,
+\fBalarm()\fR returns 0.
+.SH ERRORS
+.sp
+.LP
+The \fBalarm()\fR function is always successful; no return value is reserved to
+indicate an error.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBfork\fR(2), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/audit.2 b/usr/src/man/man2/audit.2
new file mode 100644
index 0000000000..6d75a7b52a
--- /dev/null
+++ b/usr/src/man/man2/audit.2
@@ -0,0 +1,134 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH audit 2 "16 Apr 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+audit \- write a record to the audit log
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
+#include <sys/param.h>
+#include <bsm/libbsm.h>
+
+\fBint\fR \fBaudit\fR(\fBcaddr_t\fR \fIrecord\fR, \fBint\fR \fIlength\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBaudit()\fR function queues a record for writing to the system audit log.
+The data pointed to by \fIrecord\fR is queued for the log after a minimal
+consistency check, with the \fIlength\fR parameter specifying the size of the
+record in bytes. The data should be a well-formed audit record as described
+by \fBaudit.log\fR(4).
+.sp
+.LP
+The kernel validates the record header token type and length, and sets the
+time stamp value before writing the record to the audit log. The kernel does
+not do any preselection for user-level generated events. If the audit policy is
+set to include sequence or trailer tokens, the kernel will append them to the
+record.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBaudit()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE2BIG\fR\fR
+.ad
+.RS 11n
+.rt
+The record length is greater than the maximum allowed record length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIrecord\fR argument points outside the process's allocated address space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The header token in the record is invalid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+Solaris Audit is not defined for this system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The {\fBPRIV_PROC_AUDIT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Only privileged processes can successfully execute this call.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBbsmconv\fR(1M), \fBaudit\fR(1M), \fBauditd\fR(1M), \fBsvcadm\fR(1M),
+\fBauditon\fR(2), \fBgetaudit\fR(2), \fBaudit.log\fR(4), \fBattributes\fR(5),
+\fBprivileges\fR(5)
+.SH NOTES
+.sp
+.LP
+The functionality described in this man page is available only if the Solaris
+Auditing has been enabled and the audit daemon \fBauditd\fR(1M) has not been
+disabled by \fBaudit\fR(1M) or \fBsvcadm\fR(1M). See \fBbsmconv\fR(1M) for more
+information.
diff --git a/usr/src/man/man2/auditon.2 b/usr/src/man/man2/auditon.2
new file mode 100644
index 0000000000..17806057a9
--- /dev/null
+++ b/usr/src/man/man2/auditon.2
@@ -0,0 +1,655 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH auditon 2 "6 Apr 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+auditon \- manipulate auditing
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag\fR... ] \fIfile\fR... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR... ]
+#include <sys/param.h>
+#include <bsm/libbsm.h>
+
+\fBint\fR \fBauditon\fR(\fBint\fR \fIcmd\fR, \fBcaddr_t\fR \fIdata\fR, \fBint\fR \fIlength\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBauditon()\fR function performs various audit subsystem control
+operations. The \fIcmd\fR argument designates the particular audit control
+command. The \fIdata\fR argument is a pointer to command-specific data. The
+\fIlength\fR argument is the length in bytes of the command-specific data.
+.sp
+.LP
+The following commands are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETCOND\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the system audit on/off/disabled condition in the integer pointed to by
+\fIdata\fR. The following values can be returned:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUC_AUDITING\fR\fR
+.ad
+.RS 16n
+.rt
+Auditing has been turned on.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUC_DISABLED\fR\fR
+.ad
+.RS 16n
+.rt
+Auditing system has not been enabled.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUC_NOAUDIT\fR\fR
+.ad
+.RS 16n
+.rt
+Auditing has been turned off.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUC_NOSPACE\fR\fR
+.ad
+.RS 16n
+.rt
+Auditing has blocked due to lack of space in audit partition.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETCOND\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the system's audit on/off condition to the value in the integer pointed to
+by \fIdata\fR. The Solaris Audit subsystem must be enabled by \fBbsmconv\fR(1M)
+before auditing can be turned on. The following audit states can be set:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUC_AUDITING\fR\fR
+.ad
+.RS 16n
+.rt
+Turns on audit record generation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUC_NOAUDIT\fR\fR
+.ad
+.RS 16n
+.rt
+Turns off audit record generation.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETCLASS\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the event to class mapping for the designated audit event. The
+\fIdata\fR argument points to the \fBau_evclass_map\fR structure containing the
+event number. The preselection class mask is returned in the same structure.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETCLASS\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the event class preselection mask for the designated audit event. The
+\fIdata\fR argument points to the \fBau_evclass_map\fR structure containing the
+event number and class mask.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETKMASK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the kernel preselection mask in the \fBau_mask\fR structure pointed to
+by \fIdata\fR. This is the mask used to preselect non-attributable audit
+events.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETKMASK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the kernel preselection mask. The \fIdata\fR argument points to the
+\fBau_mask\fR structure containing the class mask. This is the mask used to
+preselect non-attributable audit events.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETPINFO\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the audit ID, preselection mask, terminal ID and audit session ID of the
+specified process in the \fBauditpinfo\fR structure pointed to by \fIdata\fR.
+.sp
+Note that \fBA_GETPINFO\fR can fail if the termial ID contains a network
+address longer than 32 bits. In this case, the \fBA_GETPINFO_ADDR\fR command
+should be used.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETPINFO_ADDR\fR\fR
+.ad
+.sp .6
+.RS 4n
+Returns the audit ID, preselection mask, terminal ID and audit session ID of
+the specified process in the \fBauditpinfo_addr\fR structure pointed to by
+\fIdata\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETPMASK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the preselection mask of the specified process. The \fIdata\fR argument
+points to the \fBauditpinfo\fR structure containing the process ID and the
+preselection mask. The other fields of the structure are ignored and should be
+set to \fINULL\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETUMASK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the preselection mask for all processes with the specified audit ID. The
+\fIdata\fR argument points to the \fBauditinfo\fR structure containing the
+audit ID and the preselection mask. The other fields of the structure are
+ignored and should be set to \fINULL\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETSMASK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the preselection mask for all processes with the specified audit session
+ID. The \fIdata\fR argument points to the \fBauditinfo\fR structure containing
+the audit session \fBID\fR and the preselection mask. The other fields of the
+structure are ignored and should be set to \fINULL.\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETQCTRL\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the kernel audit queue control parameters. These control the high and
+low water marks of the number of audit records allowed in the audit queue. The
+high water mark is the maximum allowed number of undelivered audit records. The
+low water mark determines when threads blocked on the queue are wakened.
+Another parameter controls the size of the data buffer used to write data to
+the audit trail. There is also a parameter that specifies a maximum delay
+before data is attempted to be written to the audit trail. The audit queue
+parameters are returned in the \fBau_qctrl\fR structure pointed to by
+\fIdata\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETQCTRL\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the kernel audit queue control parameters as described above in the
+\fBA_GETQCTRL\fR command. The \fIdata\fR argument points to the \fBau_qctrl\fR
+structure containing the audit queue control parameters. The default and
+maximum values 'A/B' for the audit queue control parameters are:
+.sp
+.ne 2
+.mk
+.na
+\fBhigh water\fR
+.ad
+.RS 22n
+.rt
+\fB100/10000\fR (audit records)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBlow water\fR
+.ad
+.RS 22n
+.rt
+\fB10/1024\fR (audit records)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBoutput buffer size\fR
+.ad
+.RS 22n
+.rt
+\fB1024/1048576\fR (bytes)
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBdelay\fR
+.ad
+.RS 22n
+.rt
+\fB20/20000\fR (hundredths second)
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETCWD\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the current working directory as kept by the audit subsystem. This is a
+path anchored on the real root, rather than on the active root. The \fIdata\fR
+argument points to a buffer into which the path is copied. The \fIlength\fR
+argument is the length of the buffer.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETCAR\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the current active root as kept by the audit subsystem. This path can be
+used to anchor an absolute path for a path token generated by an application.
+The \fIdata\fR argument points to a buffer into which the path is copied. The
+\fIlength\fR argument is the length of the buffer.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETSTAT\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the system audit statistics in the \fBaudit_stat\fR structure pointed to
+by \fIdata\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETSTAT\fR\fR
+.ad
+.sp .6
+.RS 4n
+Reset system audit statistics values. The kernel statistics value is reset if
+the corresponding field in the statistics structure pointed to by the
+\fIdata\fR argument is \fBCLEAR_VAL\fR. Otherwise, the value is not changed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_GETPOLICY\fR\fR
+.ad
+.sp .6
+.RS 4n
+Return the audit policy flags in the integer pointed to by \fIdata\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SETPOLICY\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the audit policy flags to the values in the integer pointed to by
+\fIdata\fR. The following policy flags are recognized:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_CNT\fR\fR
+.ad
+.sp .6
+.RS 4n
+Do not suspend processes when audit storage is full or inaccessible. The
+default action is to suspend processes until storage becomes available.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_AHLT\fR\fR
+.ad
+.sp .6
+.RS 4n
+Halt the machine when a non-attributable audit record can not be delivered. The
+default action is to count the number of events that could not be recorded.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_ARGV\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include in the audit record the argument list for a member of the \fBexec\fR(2)
+family of functions. The default action is not to include this information.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_ARGE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include the environment variables for the \fBexecv\fR(2) function in the audit
+record. The default action is not to include this information.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_SEQ\fR\fR
+.ad
+.sp .6
+.RS 4n
+Add a \fIsequence\fR token to each audit record. The default action is not to
+include it.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_TRAIL\fR\fR
+.ad
+.sp .6
+.RS 4n
+Append a \fItrailer\fR token to each audit record. The default action is not to
+include it.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_GROUP\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include the supplementary groups list in audit records. The default action is
+not to include it.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_PATH\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include secondary paths in audit records. Examples of secondary paths are
+dynamically loaded shared library modules and the command shell path for
+executable scripts. The default action is to include only the primary path from
+the system call.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_WINDATA_DOWN\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include in an audit record any downgraded data moved between windows. This
+policy is available only if the system is configured with Trusted Extensions.
+By default, this information is not included.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_WINDATA_UP\fR\fR
+.ad
+.sp .6
+.RS 4n
+Include in an audit record any upgraded data moved between windows. This policy
+is available only if the system is configured with Trusted Extensions. By
+default, this information is not included.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_PERZONE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Enable auditing for each local zone. If not set, audit records from all zones
+are collected in a single log accessible in the global zone and certain
+\fBauditconfig\fR(1M) operations are disallowed. This policy can be set only
+from the global zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAUDIT_ZONENAME\fR\fR
+.ad
+.sp .6
+.RS 4n
+Generate a zone ID token with each audit record.
+.RE
+
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBauditon()\fR returns \fB0\fR. Otherwise, \(mi1
+is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBauditon()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE2BIG\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIlength\fR field for the command was too small to hold the returned
+value.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The copy of data to/from the kernel failed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+One of the arguments was illegal, Solaris Audit has not been installed, or the
+operation is not valid from a local zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_AUDIT\fR} privilege is not asserted in the effective set of
+the calling process.
+.sp
+Neither the {\fBPRIV_PROC_AUDIT\fR} nor the {\fBPRIV_SYS_AUDIT\fR} privilege is
+asserted in the effective set of the calling process and the command is one of
+\fBA_GETCAR\fR, \fBA_GETCLASS\fR, \fBA_GETCOND\fR, \fBA_GETCWD\fR,
+\fBA_GETPINFO\fR, \fBA_GETPOLICY\fR.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBauditon()\fR function can be invoked only by processes with appropriate
+privileges.
+.sp
+.LP
+The use of \fBauditon()\fR to change system audit state is permitted only in
+the global zone. From any other zone \fBauditon()\fR returns \(mi1 with
+\fBerrno\fR set to \fBEPERM\fR. The following \fBauditon()\fR commands are
+permitted only in the global zone: \fBA_SETCOND\fR, \fBA_SETCLASS\fR,
+\fBA_SETKMASK\fR, \fBA_SETQCTRL\fR, \fBA_SETSTAT\fR, \fBA_SETFSIZE\fR, and
+\fBA_SETPOLICY\fR. All other \fBauditon()\fR commands are valid from any zone.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBauditconfig\fR(1M), \fBauditd\fR(1M), \fBbsmconv\fR(1M), \fBaudit\fR(2),
+\fBexec\fR(2), \fBaudit.log\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5)
+.SH NOTES
+.sp
+.LP
+The functionality described in this man page is available only if the Solaris
+Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.
+.sp
+.LP
+The auditon options that modify or display process-based information are not
+affected by the "perzone" audit policy. Those that modify system audit data
+such as the terminal ID and audit queue parameters are valid only in the global
+zone unless the "perzone" policy is set. The "get" options for system audit
+data reflect the local zone if "perzone" is set; otherwise they reflects the
+settings of the global zone.
diff --git a/usr/src/man/man2/brk.2 b/usr/src/man/man2/brk.2
new file mode 100644
index 0000000000..a06fc6fbd2
--- /dev/null
+++ b/usr/src/man/man2/brk.2
@@ -0,0 +1,151 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH brk 2 "14 Jan 1997" "SunOS 5.11" "System Calls"
+.SH NAME
+brk, sbrk \- change the amount of space allocated for the calling process's
+data segment
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBbrk\fR(\fBvoid *\fR\fIendds\fR);
+.fi
+
+.LP
+.nf
+\fBvoid *\fR\fBsbrk\fR(\fBintptr_t\fR \fIincr\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBbrk()\fR and \fBsbrk()\fR functions are used to change dynamically the
+amount of space allocated for the calling process's data segment (see
+\fBexec\fR(2)). The change is made by resetting the process's break value and
+allocating the appropriate amount of space. The break value is the address of
+the first location beyond the end of the data segment. The amount of allocated
+space increases as the break value increases. Newly allocated space is set to
+zero. If, however, the same memory space is reallocated to the same process
+its contents are undefined.
+.sp
+.LP
+When a program begins execution using \fBexecve()\fR the break is set at the
+highest location defined by the program and data storage areas.
+.sp
+.LP
+The \fBgetrlimit\fR(2) function may be used to determine the maximum
+permissible size of the \fIdata\fR segment; it is not possible to set the break
+beyond the \fBrlim_max\fR value returned from a call to \fBgetrlimit()\fR, that
+is to say, "\fBend + rlim.rlim_max\fR." See \fBend\fR(3C).
+.sp
+.LP
+The \fBbrk()\fR function sets the break value to \fIendds\fR and changes the
+allocated space accordingly.
+.sp
+.LP
+The \fBsbrk()\fR function adds \fIincr\fR function bytes to the break value
+and changes the allocated space accordingly. The \fIincr\fR function can be
+negative, in which case the amount of allocated space is decreased.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBbrk()\fR returns \fB0\fR. Otherwise, it returns
+\fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.sp
+.LP
+Upon successful completion, \fBsbrk()\fR returns the prior break value.
+Otherwise, it returns \fB(void *)\(mi1\fR and sets \fBerrno\fR to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBbrk()\fR and \fBsbrk()\fR functions will fail and no additional memory
+will be allocated if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+The data segment size limit as set by \fBsetrlimit()\fR (see
+\fBgetrlimit\fR(2)) would be exceeded; the maximum possible size of a data
+segment (compiled into the system) would be exceeded; insufficient space exists
+in the swap area to support the expansion; or the new break value would extend
+into an area of the address space defined by some previously established
+mapping (see \fBmmap\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+Total amount of system memory available for private pages is temporarily
+insufficient. This may occur even though the space requested was less than the
+maximum data segment size (see \fBulimit\fR(2)).
+.RE
+
+.SH USAGE
+.sp
+.LP
+The behavior of \fBbrk()\fR and \fBsbrk()\fR is unspecified if an application
+also uses any other memory functions (such as \fBmalloc\fR(3C), \fBmmap\fR(2),
+\fBfree\fR(3C)). The \fBbrk()\fR and \fBsbrk()\fR functions have been used in
+specialized cases where no other memory allocation function provided the same
+capability. The use of \fBmmap\fR(2) is now preferred because it can be used
+portably with all other memory allocation functions and with any function that
+uses other allocation functions.
+.sp
+.LP
+It is unspecified whether the pointer returned by \fBsbrk()\fR is aligned
+suitably for any purpose.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBgetrlimit\fR(2), \fBmmap\fR(2), \fBshmop\fR(2),
+\fBulimit\fR(2), \fBend\fR(3C), \fBfree\fR(3C), \fBmalloc\fR(3C)
+.SH NOTES
+.sp
+.LP
+The value of \fIincr\fR may be adjusted by the system before setting the new
+break value. Upon successful completion, the implementation guarantees a
+minimum of \fIincr\fR bytes will be added to the data segment if \fIincr\fR is
+a positive value. If \fIincr\fR is a negative value, a maximum of \fIincr\fR
+bytes will be removed from the data segment. This adjustment may not be
+necessary for all machine architectures.
+.sp
+.LP
+The value of the arguments to both \fBbrk()\fR and \fBsbrk()\fR are rounded up
+for alignment with eight-byte boundaries.
+.SH BUGS
+.sp
+.LP
+Setting the break may fail due to a temporary lack of swap space. It is not
+possible to distinguish this from a failure caused by exceeding the maximum
+size of the data segment without consulting \fBgetrlimit()\fR.
diff --git a/usr/src/man/man2/chdir.2 b/usr/src/man/man2/chdir.2
new file mode 100644
index 0000000000..a86abff536
--- /dev/null
+++ b/usr/src/man/man2/chdir.2
@@ -0,0 +1,239 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH chdir 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+chdir, fchdir \- change working directory
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBchdir\fR(\fBconst char *\fR\fIpath\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfchdir\fR(\fBint\fR \fIfildes\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBchdir()\fR and \fBfchdir()\fR functions cause a directory pointed to by
+\fIpath\fR or \fIfildes\fR to become the current working directory. The
+starting point for path searches for path names not beginning with \fB/\fR
+(slash). The \fIpath\fR argument points to the path name of a directory. The
+\fIfildes\fR argument is an open file descriptor of a directory.
+.sp
+.LP
+For a directory to become the current directory, a process must have execute
+(search) access to the directory.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, the current working directory is unchanged, and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBchdir()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for any component of the path name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBchdir()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+Either a component of the path prefix or the directory named by \fIpath\fR does
+not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path name is not a directory.
+.RE
+
+.sp
+.LP
+The \fBfchdir()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 11n
+.rt
+Search permission is denied for \fIfildes\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not an open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during the execution of the \fBfchdir()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 11n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument points to a remote machine and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 11n
+.rt
+The open file descriptor \fIfildes\fR does not refer to a directory.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchroot\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/chmod.2 b/usr/src/man/man2/chmod.2
new file mode 100644
index 0000000000..400fdda985
--- /dev/null
+++ b/usr/src/man/man2/chmod.2
@@ -0,0 +1,503 @@
+'\" te
+.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T.
+.\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH chmod 2 "12 Sep 2005" "SunOS 5.11" "System Calls"
+.SH NAME
+chmod, fchmod \- change access permission mode of file
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+
+\fBint\fR \fBchmod\fR(\fBconst char *\fR\fIpath\fR, \fBmode_t\fR \fImode\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfchmod\fR(\fBint\fR \fIfildes\fR, \fBmode_t\fR \fImode\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBchmod()\fR and \fBfchmod()\fR functions set the access permission
+portion of the mode of the file whose name is given by \fIpath\fR or referenced
+by the open file descriptor \fIfildes\fR to the bit pattern contained in
+\fImode\fR. Access permission bits are interpreted as follows:
+.sp
+
+.sp
+.TS
+tab();
+lw(1.01i) lw(.69i) lw(3.79i)
+lw(1.01i) lw(.69i) lw(3.79i)
+.
+\fBS_ISUID\fR04000Set user ID on execution.
+\fBS_ISGID\fR020#0T{
+Set group ID on execution if # is \fB7\fR, \fB5\fR, \fB3\fR, or \fB1\fR. Enable mandatory file/record locking if # is \fB6\fR, \fB4\fR, \fB2\fR, or \fB0\fR.
+T}
+\fBS_ISVTX\fR01000Sticky bit.
+\fBS_IRWXU\fR00700Read, write, execute by owner.
+\fBS_IRUSR\fR00400Read by owner.
+\fBS_IWUSR\fR00200Write by owner.
+\fBS_IXUSR\fR00100T{
+Execute (search if a directory) by owner.
+T}
+\fBS_IRWXG\fR00070Read, write, execute by group.
+\fBS_IRGRP\fR00040Read by group.
+\fBS_IWGRP\fR00020Write by group.
+\fBS_IXGRP\fR00010Execute by group.
+\fBS_IRWXO\fR00007Read, write, execute (search) by others.
+\fBS_IROTH\fR00004Read by others.
+\fBS_IWOTH\fR00002Write by others.
+\fBS_IXOTH\fR00001Execute by others.
+.TE
+
+.sp
+.LP
+Modes are constructed by the bitwise OR operation of the access permission
+bits.
+.sp
+.LP
+The effective user ID of the process must match the owner of the file or the
+process must have the appropriate privilege to change the mode of a file.
+.sp
+.LP
+If the process is not a privileged process and the file is not a directory,
+mode bit 01000 (save text image on execution) is cleared.
+.sp
+.LP
+If neither the process is privileged nor the file's group is a member of the
+process's supplementary group list, and the effective group ID of the process
+does not match the group ID of the file, mode bit 02000 (set group ID on
+execution) is cleared.
+.sp
+.LP
+If a directory is writable and has \fBS_ISVTX\fR (the sticky bit) set, files
+within that directory can be removed or renamed only if one or more of the
+following is true (see \fBunlink\fR(2) and \fBrename\fR(2)):
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user owns the file
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user owns the directory
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the file is writable by the user
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user is a privileged user
+.RE
+.sp
+.LP
+If a regular file is not executable and has \fBS_ISVTX\fR set, the file is
+assumed to be a swap file. In this case, the system's page cache will not be
+used to hold the file's data. If the \fBS_ISVTX\fR bit is set on any other
+file, the results are unspecified.
+.sp
+.LP
+If a directory has the set group ID bit set, a given file created within that
+directory will have the same group ID as the directory. Otherwise, the newly
+created file's group ID will be set to the effective group ID of the creating
+process.
+.sp
+.LP
+If the mode bit 02000 (set group ID on execution) is set and the mode bit 00010
+(execute or search by group) is not set, mandatory file/record locking will
+exist on a regular file, possibly affecting future calls to \fBopen\fR(2),
+\fBcreat\fR(2), \fBread\fR(2), and \fBwrite\fR(2) on this file.
+.sp
+.LP
+If \fIfildes\fR references a shared memory object, \fBfchmod()\fR need only
+affect the \fBS_IRUSR\fR, \fBS_IRGRP\fR, \fBS_IROTH\fR, \fBS_IWUSR\fR,
+\fBS_IWGRP\fR, \fBS_IWOTH\fR, \fBS_IXUSR\fR, \fBS_IXGRP\fR, and \fBS_IXOTH\fR
+file permission bits.
+.sp
+.LP
+If \fIfildes\fR refers to a socket, \fBfchmod()\fR does not fail but no action
+is taken.
+.sp
+.LP
+If \fIfildes\fR refers to a stream that is attached to an object in the file
+system name space with \fBfattach\fR(3C), the \fBfchmod()\fR call performs no
+action and returns successfully.
+.sp
+.LP
+Upon successful completion, \fBchmod()\fR and \fBfchmod()\fR mark for update
+the \fBst_ctime\fR field of the file.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, the file mode is unchanged, and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBchmod()\fR and \fBfchmod()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 9n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The effective user ID does not match the owner of the file and the process does
+not have appropriate privilege.
+.sp
+The {\fBPRIV_FILE_OWNER\fR} privilege overrides constraints on ownership when
+changing permissions on a file.
+.sp
+The {\fBPRIV_FILE_SETID\fR} privilege overrides constraints on ownership when
+adding the setuid or setgid bits to an executable file or a directory. When
+adding the setuid bit to a root owned executable, additional restrictions
+apply. See \fBprivileges\fR(5).
+.RE
+
+.sp
+.LP
+The \fBchmod()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied on a component of the path prefix of \fIpath\fR.
+The privilege {\fBFILE_DAC_SEARCH\fR} overrides file permissions restrictions
+in that case.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+A loop exists in symbolic links encountered during the resolution of the
+\fIpath\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+Either a component of the path prefix or the file referred to by \fIpath\fR
+does not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIfildes\fR argument points to a remote machine and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the prefix of \fIpath\fR is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The file referred to by \fIpath\fR resides on a read-only file system.
+.RE
+
+.sp
+.LP
+The \fBfchmod()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not an open file descriptor
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 11n
+.rt
+The file referred to by \fIfildes\fR resides on a read-only file system.
+.RE
+
+.sp
+.LP
+The \fBchmod()\fR and \fBfchmod()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+A signal was caught during execution of the function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of the \fImode\fR argument is invalid.
+.RE
+
+.sp
+.LP
+The \fBchmod()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+More than {\fBSYMLOOP_MAX\fR} symbolic links were encountered during the
+resolution of the \fIpath\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+As a result of encountering a symbolic link in resolution of the\fIpath\fR
+argument, the length of the substituted pathname strings exceeds
+{\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.LP
+The \fBfchmod()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument refers to a pipe and the system disallows execution
+of this function on a pipe.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRSet Read Permissions for User, Group, and Others
+.sp
+.LP
+The following example sets read permissions for the owner, group, and others.
+
+.sp
+.in +2
+.nf
+#include <sys/stat.h>
+const char *path;
+\&...
+chmod(path, S_IRUSR|S_IRGRP|S_IROTH);
+.fi
+.in -2
+
+.LP
+\fBExample 2 \fRSet Read, Write, and Execute Permissions for the Owner Only
+.sp
+.LP
+The following example sets read, write, and execute permissions for the owner,
+and no permissions for group and others.
+
+.sp
+.in +2
+.nf
+#include <sys/stat.h>
+const char *path;
+\&...
+chmod(path, S_IRWXU);
+.fi
+.in -2
+
+.LP
+\fBExample 3 \fRSet Different Permissions for Owner, Group, and Other
+.sp
+.LP
+The following example sets owner permissions for CHANGEFILE to read, write, and
+execute, group permissions to read and execute, and other permissions to read.
+
+.sp
+.in +2
+.nf
+#include <sys/stat.h>
+#define CHANGEFILE "/etc/myfile"
+\&...
+chmod(CHANGEFILE, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH);
+.fi
+.in -2
+
+.LP
+\fBExample 4 \fRSet and Checking File Permissions
+.sp
+.LP
+The following example sets the file permission bits for a file named
+\fB/home/cnd/mod1\fR, then calls the \fBstat\fR(2) function to verify the
+permissions.
+
+.sp
+.in +2
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+int status;
+struct stat buffer
+\&...
+chmod("home/cnd/mod1", S_IRWXU|S_IRWXG|S_IROTH|S_IWOTH);
+status = stat("home/cnd/mod1", &buffer;);
+.fi
+.in -2
+
+.SH USAGE
+.sp
+.LP
+If \fBchmod()\fR or \fBfchmod()\fR is used to change the file group owner
+permissions on a file with non-trivial ACL entries, only the ACL mask is set to
+the new permissions and the group owner permission bits in the file's mode
+field (defined in \fBmknod\fR(2)) are unchanged. A non-trivial ACL entry is
+one whose meaning cannot be represented in the file's mode field alone. The new
+ACL mask permissions might change the effective permissions for additional
+users and groups that have ACL entries on the file.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchmod\fR(1), \fBchown\fR(2), \fBcreat\fR(2), \fBfcntl\fR(2), \fBmknod\fR(2),
+\fBopen\fR(2), \fBread\fR(2), \fBrename\fR(2), \fBstat\fR(2), \fBwrite\fR(2),
+\fBfattach\fR(3C), \fBmkfifo\fR(3C), \fBstat.h\fR(3HEAD), \fBattributes\fR(5),
+\fBprivileges\fR(5), \fBstandards\fR(5)
+.sp
+.LP
+\fIProgramming Interfaces Guide\fR
diff --git a/usr/src/man/man2/chown.2 b/usr/src/man/man2/chown.2
new file mode 100644
index 0000000000..fed42dd2fb
--- /dev/null
+++ b/usr/src/man/man2/chown.2
@@ -0,0 +1,367 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH chown 2 "9 Oct 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+chown, lchown, fchown, fchownat \- change owner and group of a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+#include <sys/types.h>
+
+\fBint\fR \fBchown\fR(\fBconst char *\fR\fIpath\fR, \fBuid_t\fR \fIowner\fR, \fBgid_t\fR \fIgroup\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBlchown\fR(\fBconst char *\fR\fIpath\fR, \fBuid_t\fR \fIowner\fR, \fBgid_t\fR \fIgroup\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfchown\fR(\fBint\fR \fIfildes\fR, \fBuid_t\fR \fIowner\fR, \fBgid_t\fR \fIgroup\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfchownat\fR(\fBint\fR \fIfildes\fR, \fBconst char *\fR\fIpath\fR, \fBuid_t\fR \fIowner\fR,
+ \fBgid_t\fR \fIgroup\fR, \fBint\fR \fIflag\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBchown()\fR function sets the owner \fBID\fR and group \fBID\fR of the
+file specified by \fIpath\fR or referenced by the open file descriptor
+\fIfildes\fR to \fIowner\fR and \fIgroup\fR respectively. If \fIowner\fR or
+\fIgroup\fR is specified as \(mi1, \fBchown()\fR does not change the
+corresponding \fBID\fR of the file.
+.sp
+.LP
+The \fBlchown()\fR function sets the owner \fBID\fR and group \fBID\fR of the
+named file in the same manner as \fBchown()\fR, unless the named file is a
+symbolic link. In this case, \fBlchown()\fR changes the ownership of the
+symbolic link file itself, while \fBchown()\fR changes the ownership of the
+file or directory to which the symbolic link refers.
+.sp
+.LP
+The \fBfchownat()\fR function sets the owner ID and group ID of the named file
+in the same manner as \fBchown()\fR. If, however, the \fIpath\fR argument is
+relative, the path is resolved relative to the \fIfildes\fR argument rather
+than the current working directory. If the \fIfildes\fR argument has the
+special value \fBAT_FDCWD\fR, the path resolution reverts back to current
+working directory relative. If the \fIflag\fR argument is set to \fBSYMLNK\fR,
+the function behaves like \fBlchown()\fR with respect to symbolic links. If the
+\fIpath\fR argument is absolute, the \fIfildes\fR argument is ignored. If the
+\fIpath\fR argument is a null pointer, the function behaves like
+\fBfchown()\fR.
+.sp
+.LP
+If \fBchown()\fR, \fBlchown()\fR, \fBfchown()\fR, or \fBfchownat()\fR is
+invoked by a process that does not have {\fBPRIV_FILE_SETID\fR} asserted in its
+effective set, the set-user-ID and set-group-ID bits of the file mode,
+\fBS_ISUID\fR and \fBS_ISGID\fR respectively, are cleared (see
+\fBchmod\fR(2)). Additional restrictions apply when changing the ownership to
+uid 0.
+.sp
+.LP
+The operating system defines several privileges to override restrictions on the
+\fBchown()\fR family of functions. When the {\fBPRIV_FILE_CHOWN\fR} privilege
+is asserted in the effective set of the current process, there are no
+restrictions except in the special circumstances of changing ownership to or
+from uid 0. When the {\fBPRIV_FILE_CHOWN_SELF\fR} privilege is asserted,
+ownership changes are restricted to the files of which the ownership matches
+the effective user ID of the current process. If neither privilege is asserted
+in the effective set of the calling process, ownership changes are limited to
+changes of the group of the file to the list of supplementary group IDs and the
+effective group ID.
+.sp
+.LP
+The operating system provides a configuration option,
+{\fB_POSIX_CHOWN_RESTRICTED\fR}, to control the default behavior of processes
+and the behavior of the NFS server. If {\fB_POSIX_CHOWN_RESTRICTED\fR} is not
+in effect, the privilege {\fBPRIV_FILE_CHOWN_SELF\fR} is asserted in the
+inheritable set of all processes unless overridden by \fBpolicy.conf\fR(4) or
+\fBuser_attr\fR(4). To set this configuration option, include the following
+line in \fB/etc/system\fR:
+.sp
+.LP
+set rstchown = 1
+.sp
+.LP
+To disable this option, include the following line in \fB/etc/system\fR:
+.sp
+.LP
+set rstchown = 0
+.sp
+.LP
+See \fBsystem\fR(4) and \fBfpathconf\fR(2).
+.sp
+.LP
+Upon successful completion, \fBchown()\fR, \fBfchown()\fR and \fBlchown()\fR
+mark for update the \fBst_ctime\fR field of the file.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, the owner and group of the named file remain unchanged, and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+All of these functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The effective user ID does not match the owner of the file and the
+{\fBPRIV_FILE_CHOWN\fR} privilege is not asserted in the effective set of the
+calling process, or the {\fBPRIV_FILE_CHOWN_SELF\fR} privilege is not asserted
+in the effective set of the calling process.
+.RE
+
+.sp
+.LP
+The \fBchown()\fR, \fBlchown()\fR, and \fBfchownat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied on a component of the path prefix of \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address and for \fBfchownat()\fR,
+the file descriptor has the value \fBAT_FDCWD\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBchown()\fR or \fBlchown()\fR
+function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIgroup\fR or \fIowner\fR argument is out of range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fIPATH_MAX\fR}, or the length
+of a \fIpath\fR component exceeds {\fINAME_MAX\fR} while
+{\fB_POSIX_NO_TRUNC\fR} is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+Either a component of the path prefix or the file referred to by \fIpath\fR
+does not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIpath\fR is not a directory, or the path
+supplied to \fBfchownat()\fR is relative and the file descriptor provided does
+not refer to a valid directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The named file resides on a read-only file system.
+.RE
+
+.sp
+.LP
+The \fBfchown()\fR and \fBfchownat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+For \fBfchown()\fR the \fIfildes\fR argument is not an open file descriptor
+and.
+.sp
+For \fBfchownat()\fR, the \fIpath\fR argument is not absolute and the
+\fIfildes\fR argument is not \fBAT_FDCWD\fR or an open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 11n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during execution of the function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument points to a remote machine and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIgroup\fR or \fIowner\fR argument is out of range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 11n
+.rt
+The named file referred to by \fIfildes\fR resides on a read-only file system.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilitySee below.
+_
+MT-LevelSee below.
+.TE
+
+.sp
+.LP
+The \fBchown()\fR, \fBfchown()\fR, and \fBlchown()\fR functions are Standard.
+The \fBfchownat()\fR function is Evolving.
+.sp
+.LP
+The \fBchown()\fR and \fBfchownat()\fR functions are Async-Signal-Safe.
+.SH SEE ALSO
+.sp
+.LP
+\fBchgrp\fR(1), \fBchown\fR(1), \fBchmod\fR(2), \fBfpathconf\fR(2),
+\fBsystem\fR(4), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/chroot.2 b/usr/src/man/man2/chroot.2
new file mode 100644
index 0000000000..566e732f03
--- /dev/null
+++ b/usr/src/man/man2/chroot.2
@@ -0,0 +1,204 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH chroot 2 "20 Jan 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+chroot, fchroot \- change root directory
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBchroot\fR(\fBconst char *\fR\fIpath\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfchroot\fR(\fBint\fR \fIfildes\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBchroot()\fR and \fBfchroot()\fR functions cause a directory to become
+the root directory, the starting point for path searches for path names
+beginning with \fB/\fR (slash). The user's working directory is unaffected by
+the \fBchroot()\fR and \fBfchroot()\fR functions.
+.sp
+.LP
+The \fIpath\fR argument points to a path name naming a directory. The
+\fIfildes\fR argument to \fBfchroot()\fR is the open file descriptor of the
+directory which is to become the root.
+.sp
+.LP
+The privilege {\fBPRIV_PROC_CHROOT\fR} must be asserted in the effective set of
+the process to change the root directory. While it is always possible to change
+to the system root using the \fBfchroot()\fR function, it is not guaranteed to
+succeed in any other case, even if \fIfildes\fR is valid in all respects.
+.sp
+.LP
+The ".\|." entry in the root directory is interpreted to mean the root
+directory itself. Therefore, ".\|." cannot be used to access files outside the
+subtree rooted at the root directory. Instead, \fBfchroot()\fR can be used to
+reset the root to a directory that was opened before the root directory was
+changed.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, the root directory remains unchanged, and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBchroot()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix of
+\fIdirname\fR, or search permission is denied for the directory referred to by
+\fIdirname\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 16n
+.rt
+The descriptor is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The \fBfchroot()\fR function attempted to change to a directory the is not the
+system root and external circumstances do not allow this.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBchroot()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fB\fR\fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR
+is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The named directory does not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+Any component of the path name is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The {\fBPRIV_PROC_CHROOT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchroot\fR(1M), \fBchdir\fR(2), \fBprivileges\fR(5)
+.SH WARNINGS
+.sp
+.LP
+The only use of \fBfchroot()\fR that is appropriate is to change back to the
+system root.
diff --git a/usr/src/man/man2/close.2 b/usr/src/man/man2/close.2
new file mode 100644
index 0000000000..e9fa7a805c
--- /dev/null
+++ b/usr/src/man/man2/close.2
@@ -0,0 +1,270 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH close 2 "18 Oct 2005" "SunOS 5.11" "System Calls"
+.SH NAME
+close \- close a file descriptor
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBclose\fR(\fBint\fR \fIfildes\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBclose()\fR function deallocates the file descriptor indicated by
+\fIfildes\fR. To deallocate means to make the file descriptor available for
+return by subsequent calls to \fBopen\fR(2) or other functions that allocate
+file descriptors. All outstanding record locks owned by the process on the file
+associated with the file descriptor will be removed (that is, unlocked).
+.sp
+.LP
+If \fBclose()\fR is interrupted by a signal that is to be caught, it will
+return \fB\(mi1\fR with \fBerrno\fR set to \fBEINTR\fR and the state of
+\fIfildes\fR is unspecified. If an I/O error occurred while reading from or
+writing to the file system during \fBclose()\fR, it returns -1, sets
+\fBerrno\fR to \fBEIO\fR, and the state of \fIfildes\fR is unspecified.
+.sp
+.LP
+When all file descriptors associated with a pipe or \fBFIFO\fR special file are
+closed, any data remaining in the pipe or \fBFIFO\fR will be discarded.
+.sp
+.LP
+When all file descriptors associated with an open file description have been
+closed the open file description will be freed.
+.sp
+.LP
+If the link count of the file is 0, when all file descriptors associated with
+the file are closed, the space occupied by the file will be freed and the file
+will no longer be accessible.
+.sp
+.LP
+If a streams-based (see \fBIntro\fR(2)) \fIfildes\fR is closed and the calling
+process was previously registered to receive a \fBSIGPOLL\fR signal (see
+\fBsignal\fR(3C)) for events associated with that stream (see \fBI_SETSIG\fR in
+\fBstreamio\fR(7I)), the calling process will be unregistered for events
+associated with the stream. The last \fBclose()\fR for a stream causes the
+stream associated with \fIfildes\fR to be dismantled. If \fBO_NONBLOCK\fR and
+\fBO_NDELAY\fR are not set and there have been no signals posted for the
+stream, and if there is data on the module's write queue, \fBclose()\fR waits
+up to 15 seconds (for each module and driver) for any output to drain before
+dismantling the stream. The time delay can be changed via an \fBI_SETCLTIME\fR
+\fBioctl\fR(2) request (see \fBstreamio\fR(7I)). If the \fBO_NONBLOCK\fR or
+\fBO_NDELAY\fR flag is set, or if there are any pending signals, \fBclose()\fR
+does not wait for output to drain, and dismantles the stream immediately.
+.sp
+.LP
+If \fIfildes\fR is associated with one end of a pipe, the last \fBclose()\fR
+causes a hangup to occur on the other end of the pipe. In addition, if the
+other end of the pipe has been named by \fBfattach\fR(3C), then the last
+\fBclose()\fR forces the named end to be detached by \fBfdetach\fR(3C). If the
+named end has no open file descriptors associated with it and gets detached,
+the stream associated with that end is also dismantled.
+.sp
+.LP
+If \fIfildes\fR refers to the master side of a pseudo-terminal, a \fBSIGHUP\fR
+signal is sent to the session leader, if any, for which the slave side of the
+pseudo-terminal is the controlling terminal. It is unspecified whether closing
+the master side of the pseudo-terminal flushes all queued input and output.
+.sp
+.LP
+If \fIfildes\fR refers to the slave side of a streams-based pseudo-terminal, a
+zero-length message may be sent to the master.
+.sp
+.LP
+When there is an outstanding cancelable asynchronous I/O operation against
+\fIfildes\fR when \fBclose()\fR is called, that I/O operation is canceled. An
+I/O operation that is not canceled completes as if the \fBclose()\fR operation
+had not yet occurred. All operations that are not canceled will complete as if
+the \fBclose()\fR blocked until the operations completed.
+.sp
+.LP
+If a shared memory object or a memory mapped file remains referenced at the
+last close (that is, a process has it mapped), then the entire contents of the
+memory object will persist until the memory object becomes unreferenced. If
+this is the last close of a shared memory object or a memory mapped file and
+the close results in the memory object becoming unreferenced, and the memory
+object has been unlinked, then the memory object will be removed.
+.sp
+.LP
+If \fIfildes\fR refers to a socket, \fBclose()\fR causes the socket to be
+destroyed. If the socket is connection-mode, and the \fBSO_LINGER\fR option is
+set for the socket with non-zero linger time, and the socket has untransmitted
+data, then \fBclose()\fR will block for up to the current linger interval until
+all data is transmitted.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBclose()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+The \fBclose()\fR function was interrupted by a signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is on a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 11n
+.rt
+There was no free space remaining on the device containing the file.
+.RE
+
+.sp
+.LP
+The \fBclose()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 7n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRReassign a file descriptor.
+.sp
+.LP
+The following example closes the file descriptor associated with standard
+output for the current process, re-assigns standard output to a new file
+descriptor, and closes the original file descriptor to clean up. This example
+assumes that the file descriptor 0, which is the descriptor for standard input,
+is not closed.
+
+.sp
+.in +2
+.nf
+#include <unistd.h>
+\&...
+int pfd;
+\&...
+close(1);
+dup(pfd);
+close(pfd);
+\&...
+.fi
+.in -2
+
+.sp
+.LP
+Incidentally, this is exactly what could be achieved using:
+
+.sp
+.in +2
+.nf
+dup2(pfd, 1);
+close(pfd);
+.fi
+.in -2
+
+.LP
+\fBExample 2 \fRClose a file descriptor.
+.sp
+.LP
+In the following example, \fBclose()\fR is used to close a file descriptor
+after an unsuccessful attempt is made to associate that file descriptor with a
+stream.
+
+.sp
+.in +2
+.nf
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#define LOCKFILE "/etc/ptmp"
+\&...
+int pfd;
+FILE *fpfd;
+\&...
+if ((fpfd = fdopen (pfd, "w")) == NULL) {
+ close(pfd);
+ unlink(LOCKFILE);
+ exit(1);
+}
+\&...
+.fi
+.in -2
+
+.SH USAGE
+.sp
+.LP
+An application that used the \fBstdio\fR function \fBfopen\fR(3C) to open a
+file should use the corresponding \fBfclose\fR(3C) function rather than
+\fBclose()\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBcreat\fR(2), \fBdup\fR(2), \fBexec\fR(2), \fBfcntl\fR(2),
+\fBioctl\fR(2), \fBopen\fR(2) \fBpipe\fR(2), \fBfattach\fR(3C),
+\fBfclose\fR(3C), \fBfdetach\fR(3C), \fBfopen\fR(3C), \fBsignal\fR(3C),
+\fBsignal.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5),
+\fBstreamio\fR(7I)
diff --git a/usr/src/man/man2/creat.2 b/usr/src/man/man2/creat.2
new file mode 100644
index 0000000000..14ae004beb
--- /dev/null
+++ b/usr/src/man/man2/creat.2
@@ -0,0 +1,96 @@
+'\" te
+.\" Copyright (c) 1997, The Open Group. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH creat 2 "25 Mar 2002" "SunOS 5.11" "System Calls"
+.SH NAME
+creat \- create a new file or rewrite an existing one
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/stat.h>
+#include <fcntl.h>
+
+\fBint\fR \fBcreat\fR(\fBconst char *\fR\fIpath\fR, \fBmode_t\fR \fImode\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The function call
+.sp
+.LP
+creat(path, mode)
+.sp
+.LP
+is equivalent to:
+.sp
+.LP
+\fBopen(path, O_WRONLY | O_CREAT | O_TRUNC, mode)\fR
+.SH RETURN VALUES
+.sp
+.LP
+Refer to \fBopen\fR(2).
+.SH ERRORS
+.sp
+.LP
+Refer to \fBopen\fR(2).
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRCreating a File
+.sp
+.LP
+The following example creates the file \fB/tmp/file\fR with read and write
+permissions for the file owner and read permission for group and others. The
+resulting file descriptor is assigned to the \fIfd\fR variable.
+
+.sp
+.in +2
+.nf
+#include <fcntl.h>
+\&...
+int fd;
+mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+char *filename = "/tmp/file";
+\&...
+fd = creat(filename, mode);
+\&...
+.fi
+.in -2
+
+.SH USAGE
+.sp
+.LP
+The \fBcreat()\fR function has a transitional interface for 64-bit file
+offsets. See \fBlf64\fR(5).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBopen\fR(2), \fBattributes\fR(5), \fBlargefile\fR(5), \fBlf64\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/dup.2 b/usr/src/man/man2/dup.2
new file mode 100644
index 0000000000..dc0d066dae
--- /dev/null
+++ b/usr/src/man/man2/dup.2
@@ -0,0 +1,132 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH dup 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+dup \- duplicate an open file descriptor
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBdup\fR(\fBint\fR \fIfildes\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBdup()\fR function returns a new file descriptor having the following in
+common with the original open file descriptor \fIfildes\fR:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+same open file (or pipe)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+same file pointer (that is, both file descriptors share one file pointer)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+same access mode (read, write or read/write).
+.RE
+.sp
+.LP
+The new file descriptor is set to remain open across \fIexec\fR functions (see
+\fBfcntl\fR(2)).
+.sp
+.LP
+The file descriptor returned is the lowest one available.
+.sp
+.LP
+The \fBdup(\fR\fIfildes\fR\fB)\fR function call is equivalent to:
+.sp
+.LP
+\fBfcntl(\fR\fIfildes\fR\fB, F_DUPFD, 0)\fR
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative integer representing the file
+descriptor is returned. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is
+set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBdup()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during the execution of the \fBdup()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 11n
+.rt
+The process has too many open files (see \fBgetrlimit\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is on a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBclose\fR(2), \fBcreat\fR(2), \fBexec\fR(2), \fBfcntl\fR(2),
+\fBgetrlimit\fR(2), \fBopen\fR(2), \fBpipe\fR(2), \fBdup2\fR(3C),
+\fBlockf\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/exec.2 b/usr/src/man/man2/exec.2
new file mode 100644
index 0000000000..97e0ae3e0d
--- /dev/null
+++ b/usr/src/man/man2/exec.2
@@ -0,0 +1,765 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T.
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH exec 2 "16 Jun 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+exec, execl, execle, execlp, execv, execve, execvp \- execute a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBexecl\fR(\fBconst char *\fR\fIpath\fR, \fBconst char *\fR\fIarg0\fR, \fB\&...
+ /* const char *\fR\fIargn\fR, \fB(char *)0 */);\fR
+.fi
+
+.LP
+.nf
+\fBint\fR \fBexecv\fR(\fBconst char *\fR\fIpath\fR, \fBchar *const\fR \fIargv[]\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBexecle\fR(\fBconst char *\fR\fIpath\fR, \fBconst char *\fR\fIarg0\fR, \fB\&...
+ /* const char *\fR\fIargn\fR, \fB(char *)0\fR,\fBchar *const\fR \fIenvp\fR[]*/);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBexecve\fR(\fBconst char *\fR\fIpath\fR, \fBchar *const\fR \fIargv[]\fR,
+ \fBchar *const\fR \fIenvp[]\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBexeclp\fR(\fBconst char *\fR\fIfile\fR, \fBconst char *\fR\fIarg0\fR, \fB\&...
+ /* const char *\fR\fIargn\fR, \fB(char *)0 */);\fR
+.fi
+
+.LP
+.nf
+\fBint\fR \fBexecvp\fR(\fBconst char *\fR\fIfile\fR, \fBchar *const\fR \fIargv[]\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+Each of the functions in the \fBexec\fR family replaces the current process
+image with a new process image. The new image is constructed from a regular,
+executable file called the \fBnew process image file\fR. This file is either an
+executable object file or a file of data for an interpreter. There is no return
+from a successful call to one of these functions because the calling process
+image is overlaid by the new process image.
+.sp
+.LP
+An interpreter file begins with a line of the form
+.sp
+.in +2
+.nf
+#! pathname [\fIarg\fR]
+.fi
+.in -2
+
+.sp
+.LP
+where \fIpathname\fR is the path of the interpreter, and \fIarg\fR is an
+optional argument. When an interpreter file is executed, the system invokes the
+specified interpreter. The pathname specified in the interpreter file is passed
+as \fIarg0\fR to the interpreter. If \fIarg\fR was specified in the interpreter
+file, it is passed as \fIarg1\fR to the interpreter. The remaining arguments to
+the interpreter are \fIarg0\fR through \fIargn\fR of the originally exec'd
+file. The interpreter named by \fIpathname\fR must not be an interpreter file.
+.sp
+.LP
+When a C-language program is executed as a result of this call, it is entered
+as a C-language function call as follows:
+.sp
+.in +2
+.nf
+int main (int argc, char *argv[]);
+.fi
+.in -2
+
+.sp
+.LP
+where \fIargc\fR is the argument count and \fIargv\fR is an array of character
+pointers to the arguments themselves. In addition, the following variable:
+.sp
+.in +2
+.nf
+extern char **environ;
+.fi
+.in -2
+
+.sp
+.LP
+is initialized as a pointer to an array of character pointers to the
+environment strings. The \fIargv\fR and \fIenviron\fR arrays are each
+terminated by a null pointer. The null pointer terminating the \fIargv\fR array
+is not counted in \fIargc\fR.
+.sp
+.LP
+The value of \fIargc\fR is non-negative, and if greater than 0, \fIargv\fR[0]
+points to a string containing the name of the file. If \fIargc\fR is 0,
+\fIargv\fR[0] is a null pointer, in which case there are no arguments.
+Applications should verify that \fIargc\fR is greater than 0 or that
+\fIargv\fR[0] is not a null pointer before dereferencing \fIargv\fR[0].
+.sp
+.LP
+The arguments specified by a program with one of the \fBexec\fR functions are
+passed on to the new process image in the \fBmain()\fR arguments.
+.sp
+.LP
+The \fIpath\fR argument points to a path name that identifies the new process
+image file.
+.sp
+.LP
+The \fIfile\fR argument is used to construct a pathname that identifies the new
+process image file. If the \fIfile\fR argument contains a slash character, it
+is used as the pathname for this file. Otherwise, the path prefix for this file
+is obtained by a search of the directories passed in the \fBPATH\fR environment
+variable (see \fBenviron\fR(5)). The environment is supplied typically by the
+shell. If the process image file is not a valid executable object file,
+\fBexeclp()\fR and \fBexecvp()\fR use the contents of that file as standard
+input to the shell. In this case, the shell becomes the new process image. The
+standard to which the caller conforms determines which shell is used. See
+\fBstandards\fR(5).
+.sp
+.LP
+The arguments represented by \fIarg0\fR\&.\|.\|. are pointers to
+null-terminated character strings. These strings constitute the argument list
+available to the new process image. The list is terminated by a null pointer.
+The \fIarg0\fR argument should point to a filename that is associated with the
+process being started by one of the \fBexec\fR functions.
+.sp
+.LP
+The \fIargv\fR argument is an array of character pointers to null-terminated
+strings. The last member of this array must be a null pointer. These strings
+constitute the argument list available to the new process image. The value in
+\fIargv\fR[0] should point to a filename that is associated with the process
+being started by one of the \fBexec\fR functions.
+.sp
+.LP
+The \fIenvp\fR argument is an array of character pointers to null-terminated
+strings. These strings constitute the environment for the new process image.
+The \fIenvp\fR array is terminated by a null pointer. For \fBexecl()\fR,
+\fBexecv()\fR, \fBexecvp()\fR, and \fBexeclp()\fR, the C-language run-time
+start-off routine places a pointer to the environment of the calling process in
+the global object \fBextern char **environ\fR, and it is used to pass the
+environment of the calling process to the new process image.
+.sp
+.LP
+The number of bytes available for the new process's combined argument and
+environment lists is \fBARG_MAX\fR. It is implementation-dependent whether null
+terminators, pointers, and/or any alignment bytes are included in this total.
+.sp
+.LP
+File descriptors open in the calling process image remain open in the new
+process image, except for those whose close-on-exec flag \fBFD_CLOEXEC\fR is
+set; see \fBfcntl\fR(2). For those file descriptors that remain open, all
+attributes of the open file description, including file locks, remain
+unchanged.
+.sp
+.LP
+The preferred hardware address translation size (see \fBmemcntl\fR(2)) for the
+stack and heap of the new process image are set to the default system page
+size.
+.sp
+.LP
+Directory streams open in the calling process image are closed in the new
+process image.
+.sp
+.LP
+The state of conversion descriptors and message catalogue descriptors in the
+new process image is undefined. For the new process, the equivalent of:
+.sp
+.in +2
+.nf
+setlocale(LC_ALL, "C")
+.fi
+.in -2
+
+.sp
+.LP
+is executed at startup.
+.sp
+.LP
+Signals set to the default action (\fBSIG_DFL\fR) in the calling process image
+are set to the default action in the new process image (see \fBsignal\fR(3C)).
+Signals set to be ignored (\fBSIG_IGN\fR) by the calling process image are set
+to be ignored by the new process image. Signals set to be caught by the calling
+process image are set to the default action in the new process image (see
+\fBsignal.h\fR(3HEAD)). After a successful call to any of the \fBexec\fR
+functions, alternate signal stacks are not preserved and the \fBSA_ONSTACK\fR
+flag is cleared for all signals.
+.sp
+.LP
+After a successful call to any of the \fBexec\fR functions, any functions
+previously registered by \fBatexit\fR(3C) are no longer registered.
+.sp
+.LP
+The saved resource limits in the new process image are set to be a copy of the
+process's corresponding hard and soft resource limits.
+.sp
+.LP
+If the \fBST_NOSUID\fR bit is set for the file system containing the new
+process image file, then the effective user \fBID\fR and effective group
+\fBID\fR are unchanged in the new process image. If the set-user-\fBID\fR mode
+bit of the new process image file is set (see \fBchmod\fR(2)), the effective
+user \fBID\fR of the new process image is set to the owner \fBID\fR of the new
+process image file. Similarly, if the set-group-\fBID\fR mode bit of the new
+process image file is set, the effective group \fBID\fR of the new process
+image is set to the group \fBID\fR of the new process image file. The real user
+\fBID\fR and real group \fBID\fR of the new process image remain the same as
+those of the calling process image. The effective user ID and effective group
+ID of the new process image are saved (as the saved set-user-ID and the saved
+set-group-ID for use by \fBsetuid\fR(2).
+.sp
+.LP
+The privilege sets are changed according to the following rules:
+.RS +4
+.TP
+1.
+The inheritable set, I, is intersected with the limit set, L. This
+mechanism enforces the limit set for processes.
+.RE
+.RS +4
+.TP
+2.
+The effective set, E, and the permitted set, P, are made equal to the new
+inheritable set.
+.RE
+.sp
+.LP
+The system attempts to set the privilege-aware state to non-PA both before
+performing any modifications to the process IDs and privilege sets as well as
+after completing the transition to new UIDs and privilege sets, following the
+rules outlined in \fBprivileges\fR(5).
+.sp
+.LP
+If the {\fBPRIV_PROC_OWNER\fR} privilege is asserted in the effective set, the
+set-user-ID and set-group-ID bits will be honored when the process is being
+controlled by \fBptrace\fR(3C). Additional restriction can apply when the
+traced process has an effective UID of 0. See \fBprivileges\fR(5).
+.sp
+.LP
+Any shared memory segments attached to the calling process image will not be
+attached to the new process image (see \fBshmop\fR(2)). Any mappings
+established through \fBmmap()\fR are not preserved across an \fBexec\fR. Memory
+mappings created in the process are unmapped before the address space is
+rebuilt for the new process image. See \fBmmap\fR(2).
+.sp
+.LP
+Memory locks established by the calling process via calls to \fBmlockall\fR(3C)
+or \fBmlock\fR(3C) are removed. If locked pages in the address space of the
+calling process are also mapped into the address spaces the locks established
+by the other processes will be unaffected by the call by this process to the
+\fBexec\fR function. If the \fBexec\fR function fails, the effect on memory
+locks is unspecified.
+.sp
+.LP
+If \fB_XOPEN_REALTIME\fR is defined and has a value other than \(mi1, any named
+semaphores open in the calling process are closed as if by appropriate calls to
+\fBsem_close\fR(3C)
+.sp
+.LP
+Profiling is disabled for the new process; see \fBprofil\fR(2).
+.sp
+.LP
+Timers created by the calling process with \fBtimer_create\fR(3C) are deleted
+before replacing the current process image with the new process image.
+.sp
+.LP
+For the \fBSCHED_FIFO\fR and \fBSCHED_RR\fR scheduling policies, the policy and
+priority settings are not changed by a call to an \fBexec\fR function.
+.sp
+.LP
+All open message queue descriptors in the calling process are closed, as
+described in \fBmq_close\fR(3C).
+.sp
+.LP
+Any outstanding asynchronous I/O operations may be cancelled. Those
+asynchronous I/O operations that are not canceled will complete as if the
+\fBexec\fR function had not yet occurred, but any associated signal
+notifications are suppressed. It is unspecified whether the \fBexec\fR function
+itself blocks awaiting such I/O completion. In no event, however, will the new
+process image created by the \fBexec\fR function be affected by the presence of
+outstanding asynchronous I/O operations at the time the \fBexec\fR function is
+called.
+.sp
+.LP
+All active contract templates are cleared (see \fBcontract\fR(4)).
+.sp
+.LP
+The new process also inherits the following attributes from the calling
+process:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+controlling terminal
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+current working directory
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+file-locks (see \fBfcntl\fR(2) and \fBlockf\fR(3C))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+file mode creation mask (see \fBumask\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+file size limit (see \fBulimit\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+limit privilege set
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+nice value (see \fBnice\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+parent process \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+pending signals (see \fBsigpending\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+privilege debugging flag (see \fBprivileges\fR(5) and \fBgetpflags\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process contract (see \fBcontract\fR(4) and \fBprocess\fR(4))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process group \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process signal mask (see \fBsigprocmask\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+processor bindings (see \fBprocessor_bind\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+processor set bindings (see \fBpset_bind\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+project \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+real group \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+real user \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+resource limits (see \fBgetrlimit\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+root directory
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+scheduler class and priority (see \fBpriocntl\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBsemadj\fR values (see \fBsemop\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+session membership (see \fBexit\fR(2) and \fBsignal\fR(3C))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+supplementary group \fBIDs\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+task \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+time left until an alarm clock signal (see \fBalarm\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBtms_utime\fR, \fBtms_stime\fR, \fBtms_cutime\fR, and \fBtms_cstime\fR (see
+\fBtimes\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+trace flag (see \fBptrace\fR(3C) request 0)
+.RE
+.sp
+.LP
+A call to any \fBexec\fR function from a process with more than one thread
+results in all threads being terminated and the new executable image being
+loaded and executed. No destructor functions will be called.
+.sp
+.LP
+Upon successful completion, each of the functions in the \fBexec\fR family
+marks for update the \fBst_atime\fR field of the file. If an \fBexec\fR
+function failed but was able to locate the \fBprocess image file\fR, whether
+the \fBst_atime\fR field is marked for update is unspecified. Should the
+function succeed, the process image file is considered to have been opened with
+\fBopen\fR(2). The corresponding \fBclose\fR(2) is considered to occur at a
+time after this open, but before process termination or successful completion
+of a subsequent call to one of the \fBexec\fR functions. The \fIargv\fR[\|] and
+\fIenvp\fR[\|] arrays of pointers and the strings to which those arrays point
+will not be modified by a call to one of the \fBexec\fR functions, except as a
+consequence of replacing the process image.
+.sp
+.LP
+The saved resource limits in the new process image are set to be a copy of the
+process's corresponding hard and soft limits.
+.SH RETURN VALUES
+.sp
+.LP
+If a function in the \fBexec\fR family returns to the calling process image, an
+error has occurred; the return value is \fB\(mi1\fR and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBexec\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE2BIG\fR\fR
+.ad
+.RS 16n
+.rt
+The number of bytes in the new process's argument list is greater than the
+system-imposed limit of {\fBARG_MAX\fR} bytes. The argument list limit is sum
+of the size of the argument list plus the size of the environment's exported
+shell variables.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a directory listed in the new process file's
+path prefix.
+.sp
+The new process file is not an ordinary file.
+.sp
+The new process file mode denies execute permission.
+.sp
+The {\fBFILE_DAC_SEARCH\fR} privilege overrides the restriction on directory
+searches.
+.sp
+The {\fBFILE_DAC_EXECUTE\fR} privilege overrides the lack of execute
+permission.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 16n
+.rt
+Total amount of system memory available when reading using raw I/O is
+temporarily insufficient.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+An argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The new process image file has the appropriate permission and has a recognized
+executable binary format, but the system does not support execution of a file
+with this format.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of one of the functions in the
+\fIexec\fR family.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR or
+\fIfile\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIfile\fR or \fIpath\fR argument exceeds {\fBPATH_MAX\fR},
+or the length of a \fIfile\fR or \fIpath\fR component exceeds {\fBNAME_MAX\fR}
+while {\fB_POSIX_NO_TRUNC\fR} is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+One or more components of the new process path name of the file do not exist or
+is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the new process path of the file prefix is not a directory.
+.RE
+
+.sp
+.LP
+The \fBexec\fR functions, except for \fBexeclp()\fR and \fBexecvp()\fR, will
+fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOEXEC\fR\fR
+.ad
+.RS 11n
+.rt
+The new process image file has the appropriate access permission but is not in
+the proper format.
+.RE
+
+.sp
+.LP
+The \fBexec\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+Pathname resolution of a symbolic link produced an intermediate result whose
+length exceeds {\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 16n
+.rt
+The new process image requires more memory than is allowed by the hardware or
+system-imposed by memory management constraints. See \fBbrk\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBETXTBSY\fR\fR
+.ad
+.RS 16n
+.rt
+The new process image file is a pure procedure (shared text) file that is
+currently open for writing by some process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+As the state of conversion descriptors and message catalogue descriptors in the
+new process image is undefined, portable applications should not rely on their
+use and should close them prior to calling one of the \fBexec\fR functions.
+.sp
+.LP
+Applications that require other than the default POSIX locale should call
+\fBsetlocale\fR(3C) with the appropriate parameters to establish the locale of
+thenew process.
+.sp
+.LP
+The \fIenviron\fR array should not be accessed directly by the application.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelSee below.
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.sp
+.LP
+The \fBexecle()\fR and \fBexecve()\fR fucntions are Async-Signal-Safe.
+.SH SEE ALSO
+.sp
+.LP
+\fBksh\fR(1), \fBps\fR(1), \fBsh\fR(1), \fBalarm\fR(2), \fBbrk\fR(2),
+\fBchmod\fR(2), \fBexit\fR(2), \fBfcntl\fR(2), \fBfork\fR(2),
+\fBgetpflags\fR(2), \fBgetrlimit\fR(2), \fBmemcntl\fR(2), \fBmmap\fR(2),
+\fBnice\fR(2), \fBpriocntl\fR(2), \fBprofil\fR(2), \fBsemop\fR(2),
+\fBshmop\fR(2), \fBsigpending\fR(2), \fBsigprocmask\fR(2), \fBtimes\fR(2),
+\fBumask\fR(2), \fBlockf\fR(3C), \fBptrace\fR(3C), \fBsetlocale\fR(3C),
+\fBsignal\fR(3C), \fBsystem\fR(3C), \fBtimer_create\fR(3C), \fBa.out\fR(4),
+\fBcontract\fR(4), \fBprocess\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
+\fBprivileges\fR(5), \fBstandards\fR(5)
+.SH WARNINGS
+.sp
+.LP
+If a program is \fBsetuid\fR to a user \fBID\fR other than the superuser, and
+the program is executed when the real user \fBID\fR is super-user, then the
+program has some of the powers of a super-user as well.
diff --git a/usr/src/man/man2/exit.2 b/usr/src/man/man2/exit.2
new file mode 100644
index 0000000000..afb566828b
--- /dev/null
+++ b/usr/src/man/man2/exit.2
@@ -0,0 +1,260 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH exit 2 "5 Feb 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+exit, _Exit, _exit \- terminate process
+.SH SYNOPSIS
+.LP
+.nf
+#include <stdlib.h>
+
+\fBvoid\fR \fBexit\fR(\fBint\fR \fIstatus\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fB_Exit\fR(\fBint\fR \fIstatus\fR);
+.fi
+
+.LP
+.nf
+#include <unistd.h>
+
+\fBvoid\fR \fB_exit\fR(\fBint\fR \fIstatus\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBexit()\fR function first calls all functions registered by
+\fBatexit\fR(3C), in the reverse order of their registration, except that a
+function is called after any previously registered functions that had already
+been called at the time it was registered. Each function is called as many
+times as it was registered. If, during the call to any such function, a call to
+the \fBlongjmp\fR(3C) function is made that would terminate the call to the
+registered function, the behavior is undefined.
+.sp
+.LP
+If a function registered by a call to \fBatexit\fR(3C) fails to return, the
+remaining registered functions are not called and the rest of the \fBexit()\fR
+processing is not completed. If \fBexit()\fR is called more than once, the
+effects are undefined.
+.sp
+.LP
+The \fBexit()\fR function then flushes all open streams with unwritten buffered
+data, closes all open streams, and removes all files created by
+\fBtmpfile\fR(3C).
+.sp
+.LP
+The \fB_Exit()\fR and \fB_exit()\fR functions are functionally equivalent. They
+do not call functions registered with \fBatexit()\fR, do not call any
+registered signal handlers, and do not flush open streams.
+.sp
+.LP
+The \fB_exit()\fR, \fB_Exit()\fR, and \fBexit()\fR functions terminate the
+calling process with the following consequences:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+All of the file descriptors, directory streams, conversion descriptors and
+message catalogue descriptors open in the calling process are closed.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the parent process of the calling process is executing a \fBwait\fR(3C),
+\fBwait3\fR(3C), \fBwaitid\fR(2), or \fBwaitpid\fR(3C), and has neither set its
+\fBSA_NOCLDWAIT\fR flag nor set \fBSIGCHLD\fR to \fBSIG_IGN\fR, it is notified
+of the calling process's termination and the low-order eight bits (that is,
+bits 0377) of \fIstatus\fR are made available to it. If the parent is not
+waiting, the child's status will be made available to it when the parent
+subsequently executes \fBwait()\fR, \fBwait3()\fR, \fBwaitid()\fR, or
+\fBwaitpid()\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the parent process of the calling process is not executing a \fBwait()\fR,
+\fBwait3()\fR, \fBwaitid()\fR, or \fBwaitpid()\fR, and has not set its
+\fBSA_NOCLDWAIT\fR flag, or set \fBSIGCHLD\fR to \fBSIG_IGN\fR, the calling
+process is transformed into a \fIzombie process\fR. A \fIzombie process\fR is
+an inactive process and it will be deleted at some later time when its parent
+process executes \fBwait()\fR, \fBwait3()\fR, \fBwaitid()\fR, or
+\fBwaitpid()\fR. A zombie process only occupies a slot in the process table; it
+has no other space allocated either in user or kernel space. The process table
+slot that it occupies is partially overlaid with time accounting information
+(see \fB<sys/proc.h>\fR) to be used by the \fBtimes\fR(2) function.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Termination of a process does not directly terminate its children. The sending
+of a \fBSIGHUP\fR signal as described below indirectly terminates children in
+some circumstances.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+A \fBSIGCHLD\fR will be sent to the parent process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The parent process \fBID\fR of all of the calling process's existing child
+processes and zombie processes is set to 1. That is, these processes are
+inherited by the initialization process (see \fBIntro\fR(2)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Each mapped memory object is unmapped.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Each attached shared-memory segment is detached and the value of
+\fBshm_nattch\fR (see \fBshmget\fR(2)) in the data structure associated with
+its shared memory \fBID\fR is decremented by 1.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+For each semaphore for which the calling process has set a \fBsemadj\fR value
+(see \fBsemop\fR(2)), that value is added to the \fBsemval\fR of the specified
+semaphore.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the process is a controlling process, the \fBSIGHUP\fR signal will be sent
+to each process in the foreground process group of the controlling terminal
+belonging to the calling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the process is a controlling process, the controlling terminal associated
+with the session is disassociated from the session, allowing it to be acquired
+by a new controlling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the exit of the process causes a process group to become orphaned, and if
+any member of the newly-orphaned process group is stopped, then a \fBSIGHUP\fR
+signal followed by a \fBSIGCONT\fR signal will be sent to each process in the
+newly-orphaned process group.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the parent process has set its \fBSA_NOCLDWAIT\fR flag, or set \fBSIGCHLD\fR
+to \fBSIG_IGN\fR, the status will be discarded, and the lifetime of the calling
+process will end immediately.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the process has process, text or data locks, an \fBUNLOCK\fR is performed
+(see \fBplock\fR(3C) and \fBmemcntl\fR(2)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+All open named semaphores in the process are closed as if by appropriate calls
+to \fBsem_close\fR(3C). All open message queues in the process are closed as if
+by appropriate calls to \fBmq_close\fR(3C). Any outstanding asynchronous I/O
+operations may be cancelled.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+An accounting record is written on the accounting file if the system's
+accounting routine is enabled (see \fBacct\fR(2)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+An extended accounting record is written to the extended process accounting
+file if the system's extended process accounting facility is enabled (see
+\fBacctadm\fR(1M)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If the current process is the last process within its task and if the system's
+extended task accounting facility is enabled (see \fBacctadm\fR(1M)), an
+extended accounting record is written to the extended task accounting file.
+.RE
+.SH RETURN VALUES
+.sp
+.LP
+These functions do not return.
+.SH ERRORS
+.sp
+.LP
+No errors are defined.
+.SH USAGE
+.sp
+.LP
+Normally applications should use \fBexit()\fR rather than \fB_exit()\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelSee below.
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.sp
+.LP
+The \fB_exit()\fR and \fB_Exit()\fR functions are Async-Signal-Safe.
+.SH SEE ALSO
+.sp
+.LP
+\fBacctadm\fR(1M), \fBIntro\fR(2), \fBacct\fR(2), \fBclose\fR(2),
+\fBmemcntl\fR(2), \fBsemop\fR(2), \fBshmget\fR(2), \fBsigaction\fR(2),
+\fBtimes\fR(2), \fBwaitid\fR(2), \fBatexit\fR(3C), \fBfclose\fR(3C),
+\fBmq_close\fR(3C), \fBplock\fR(3C), \fBsignal.h\fR(3HEAD), \fBtmpfile\fR(3C),
+\fBwait\fR(3C), \fBwait3\fR(3C), \fBwaitpid\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/fcntl.2 b/usr/src/man/man2/fcntl.2
new file mode 100644
index 0000000000..80f6a84c7d
--- /dev/null
+++ b/usr/src/man/man2/fcntl.2
@@ -0,0 +1,1034 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH fcntl 2 "17 Jan 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+fcntl \- file control
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+\fBint\fR \fBfcntl\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIcmd\fR, \fB/*\fR \fIarg\fR */ ...);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBfcntl()\fR function provides for control over open files. The
+\fIfildes\fR argument is an open file descriptor.
+.sp
+.LP
+The \fBfcntl()\fR function can take a third argument, \fIarg\fR, whose data
+type, value, and use depend upon the value of \fIcmd\fR. The \fIcmd\fR argument
+specifies the operation to be performed by \fBfcntl()\fR.
+.sp
+.LP
+The values for \fIcmd\fR are defined in <\fBfcntl.h\fR> and include:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_DUPFD\fR\fR
+.ad
+.RS 15n
+.rt
+Return a new file descriptor which is the lowest numbered available (that is,
+not already open) file descriptor greater than or equal to the third argument,
+\fIarg\fR, taken as an integer of type \fBint\fR. The new file descriptor
+refers to the same open file description as the original file descriptor, and
+shares any locks. The \fBFD_CLOEXEC\fR flag associated with the new file
+descriptor is cleared to keep the file open across calls to one of the
+\fBexec\fR(2) functions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_DUP2FD\fR\fR
+.ad
+.RS 15n
+.rt
+Similar to \fBF_DUPFD\fR, but always returns \fIarg\fR. \fBF_DUP2FD\fR closes
+\fIarg\fR if it is open and not equal to \fIfildes.\fR \fBF_DUP2FD\fR is
+equivalent to \fBdup2\fR(\fIfildes\fR, \fIarg\fR).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_FREESP\fR\fR
+.ad
+.RS 15n
+.rt
+Free storage space associated with a section of the ordinary file \fIfildes\fR.
+The section is specified by a variable of data type \fBstruct flock\fR pointed
+to by \fIarg\fR. The data type \fBstruct flock\fR is defined in the
+<\fBfcntl.h\fR> header (see \fBfcntl.h\fR(3HEAD)) and is described below. Note
+that all file systems might not support all possible variations of
+\fBF_FREESP\fR arguments. In particular, many file systems allow space to be
+freed only at the end of a file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_FREESP64\fR\fR
+.ad
+.RS 15n
+.rt
+Equivalent to \fBF_FREESP\fR, but takes a \fBstruct flock64\fR argument rather
+than a \fBstruct flock\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_ALLOCSP\fR\fR
+.ad
+.RS 15n
+.rt
+Allocate space for a section of the ordinary file \fIfildes\fR. The section is
+specified by a variable of data type \fBstruct flock\fR pointed to by
+\fIarg\fR. The data type \fBstruct flock\fR is defined in the <\fBfcntl.h\fR>
+header (see \fBfcntl.h\fR(3HEAD) and is described below.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_ALLOCSP64\fR\fR
+.ad
+.RS 15n
+.rt
+Equivalent to \fBF_ALLOCSP\fR, but takes a \fBstruct flock64\fR argument rather
+than a \fBstruct flock\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETFD\fR\fR
+.ad
+.RS 15n
+.rt
+Get the file descriptor flags defined in <\fBfcntl.h\fR> that are associated
+with the file descriptor \fIfildes\fR. File descriptor flags are associated
+with a single file descriptor and do not affect other file descriptors that
+refer to the same file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETFL\fR\fR
+.ad
+.RS 15n
+.rt
+Get the file status flags and file access modes, defined in <\fBfcntl.h\fR>,
+for the file descriptor specified by \fIfildes\fR. The file access modes can be
+extracted from the return value using the mask \fBO_ACCMODE\fR, which is
+defined in <\fBfcntl.h\fR>. File status flags and file access modes do not
+affect other file descriptors that refer to the same file with different open
+file descriptions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETOWN\fR\fR
+.ad
+.RS 15n
+.rt
+If \fIfildes\fR refers to a socket, get the process or process group \fBID\fR
+specified to receive \fBSIGURG\fR signals when out-of-band data is available.
+Positive values indicate a process ID; negative values, other than \(mi1,
+indicate a process group ID. If \fIfildes\fR does not refer to a socket, the
+results are unspecified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETXFL\fR\fR
+.ad
+.RS 15n
+.rt
+Get the file status flags, file access modes, and file creation and assignment
+flags, defined in <\fBfcntl.h\fR>, for the file descriptor specified by
+\fIfildes\fR. The file access modes can be extracted from the return value
+using the mask \fBO_ACCMODE\fR, which is defined in <\fBfcntl.h\fR>. File
+status flags, file access modes, and file creation and assignment flags do not
+affect other file descriptors that refer to the same file with different open
+file descriptions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETFD\fR\fR
+.ad
+.RS 15n
+.rt
+Set the file descriptor flags defined in <\fBfcntl.h\fR>, that are associated
+with \fIfildes\fR, to the third argument, \fIarg\fR, taken as type \fBint\fR.
+If the \fBFD_CLOEXEC\fR flag in the third argument is 0, the file will remain
+open across the \fBexec()\fR functions; otherwise the file will be closed upon
+successful execution of one of the \fBexec()\fR functions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETFL\fR\fR
+.ad
+.RS 15n
+.rt
+Set the file status flags, defined in <\fBfcntl.h\fR>, for the file descriptor
+specified by \fIfildes\fR from the corresponding bits in the \fIarg\fR
+argument, taken as type \fBint\fR. Bits corresponding to the file access mode
+and file creation and assignment flags that are set in \fIarg\fR are ignored.
+If any bits in \fIarg\fR other than those mentioned here are changed by the
+application, the result is unspecified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETOWN\fR\fR
+.ad
+.RS 15n
+.rt
+If \fIfildes\fR refers to a socket, set the process or process group \fBID\fR
+specified to receive \fBSIGURG\fR signals when out-of-band data is available,
+using the value of the third argument, \fIarg\fR, taken as type \fBint\fR.
+Positive values indicate a process ID; negative values, other than \(mi1,
+indicate a process group ID. If \fIfildes\fR does not refer to a socket, the
+results are unspecified.
+.RE
+
+.sp
+.LP
+The following commands are available for advisory record locking. Record
+locking is supported for regular files, and may be supported for other files.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETLK\fR\fR
+.ad
+.RS 14n
+.rt
+Get the first lock which blocks the lock description pointed to by the third
+argument, \fIarg\fR, taken as a pointer to type \fBstruct flock\fR, defined in
+<\fBfcntl.h\fR>. The information retrieved overwrites the information passed to
+\fBfcntl()\fR in the structure \fBflock\fR. If no lock is found that would
+prevent this lock from being created, then the structure will be left unchanged
+except for the lock type which will be set to \fBF_UNLCK\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETLK64\fR\fR
+.ad
+.RS 14n
+.rt
+Equivalent to \fBF_GETLK\fR, but takes a \fBstruct flock64\fR argument rather
+than a \fBstruct flock\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLK\fR\fR
+.ad
+.RS 14n
+.rt
+Set or clear a file segment lock according to the lock description pointed to
+by the third argument, \fIarg\fR, taken as a pointer to type \fBstruct
+flock\fR, defined in <\fBfcntl.h\fR>. \fBF_SETLK\fR is used to establish shared
+(or read) locks (\fBF_RDLCK\fR) or exclusive (or write) locks (\fBF_WRLCK\fR),
+as well as to remove either type of lock (\fBF_UNLCK\fR). \fBF_RDLCK\fR,
+\fBF_WRLCK\fR and \fBF_UNLCK\fR are defined in <\fBfcntl.h\fR>. If a shared or
+exclusive lock cannot be set, \fBfcntl()\fR will return immediately with a
+return value of \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLK64\fR\fR
+.ad
+.RS 14n
+.rt
+Equivalent to \fBF_SETLK\fR, but takes a \fBstruct flock64\fR argument rather
+than a \fBstruct flock\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLKW\fR\fR
+.ad
+.RS 14n
+.rt
+This command is the same as \fBF_SETLK\fR except that if a shared or exclusive
+lock is blocked by other locks, the process will wait until the request can be
+satisfied. If a signal that is to be caught is received while \fBfcntl()\fR is
+waiting for a region, \fBfcntl()\fR will be interrupted. Upon return from the
+process' signal handler, \fBfcntl()\fR will return \fB\(mi1\fR with \fBerrno\fR
+set to \fBEINTR\fR, and the lock operation will not be done.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLKW64\fR\fR
+.ad
+.RS 14n
+.rt
+Equivalent to \fBF_SETLKW\fR, but takes a \fBstruct flock64\fR argument rather
+than a \fBstruct flock\fR argument.
+.RE
+
+.sp
+.LP
+When a shared lock is set on a segment of a file, other processes will be able
+to set shared locks on that segment or a portion of it. A shared lock prevents
+any other process from setting an exclusive lock on any portion of the
+protected area. A request for a shared lock will fail if the file descriptor
+was not opened with read access.
+.sp
+.LP
+An exclusive lock will prevent any other process from setting a shared lock or
+an exclusive lock on any portion of the protected area. A request for an
+exclusive lock will fail if the file descriptor was not opened with write
+access.
+.sp
+.LP
+The \fBflock\fR structure contains at least the following elements:
+.sp
+.in +2
+.nf
+short l_type; /* lock operation type */
+short l_whence; /* lock base indicator */
+off_t l_start; /* starting offset from base */
+off_t l_len; /* lock length; l_len == 0 means
+ until end of file */
+int l_sysid; /* system ID running process holding lock */
+pid_t l_pid; /* process ID of process holding lock */
+.fi
+.in -2
+
+.sp
+.LP
+The value of \fBl_whence\fR is \fBSEEK_SET\fR, \fBSEEK_CUR\fR, or
+\fBSEEK_END\fR, to indicate that the relative offset \fBl_start\fR bytes will
+be measured from the start of the file, current position or end of the file,
+respectively. The value of \fBl_len\fR is the number of consecutive bytes to be
+locked. The value of \fBl_len\fR may be negative (where the definition of
+\fBoff_t\fR permits negative values of \fBl_len\fR). After a successful
+\fBF_GETLK\fR or \fBF_GETLK64\fR request, that is, one in which a lock was
+found, the value of \fBl_whence\fR will be \fBSEEK_SET\fR.
+.sp
+.LP
+The \fBl_pid\fR and \fBl_sysid\fR fields are used only with \fBF_GETLK\fR or
+\fBF_GETLK64\fR to return the process \fBID\fR of the process holding a
+blocking lock and to indicate which system is running that process.
+.sp
+.LP
+If \fBl_len\fR is positive, the area affected starts at \fBl_start\fR and ends
+at \fBl_start\fR + \fBl_len \(mi 1\fR. If \fBl_len\fR is negative, the area
+affected starts at \fBl_start\fR + \fBl_len\fR and ends at \fBl_start \(mi
+1\fR. Locks may start and extend beyond the current end of a file, but must not
+be negative relative to the beginning of the file. A lock will be set to extend
+to the largest possible value of the file offset for that file by setting
+\fBl_len\fR to 0. If such a lock also has \fBl_start\fR set to 0 and
+\fBl_whence\fR is set to \fBSEEK_SET\fR, the whole file will be locked.
+.sp
+.LP
+If a process has an existing lock in which \fBl_len\fR is 0 and which includes
+the last byte of the requested segment, and an unlock (\fBF_UNLCK\fR) request
+is made in which \fBl_len\fR is non-zero and the offset of the last byte of the
+requested segment is the maximum value for an object of type \fBoff_t\fR, then
+the \fBF_UNLCK\fR request will be treated as a request to unlock from the start
+of the requested segment with an \fBl_len\fR equal to 0. Otherwise, the request
+will attempt to unlock only the requested segment.
+.sp
+.LP
+There will be at most one type of lock set for each byte in the file. Before a
+successful return from an \fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or
+\fBF_SETLKW64\fR request when the calling process has previously existing locks
+on bytes in the region specified by the request, the previous lock type for
+each byte in the specified region will be replaced by the new lock type. As
+specified above under the descriptions of shared locks and exclusive locks, an
+\fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or \fBF_SETLKW64\fR request
+will (respectively) fail or block when another process has existing locks on
+bytes in the specified region and the type of any of those locks conflicts with
+the type specified in the request.
+.sp
+.LP
+All locks associated with a file for a given process are removed when a file
+descriptor for that file is closed by that process or the process holding that
+file descriptor terminates. Locks are not inherited by a child process created
+using \fBfork\fR(2).
+.sp
+.LP
+A potential for deadlock occurs if a process controlling a locked region is put
+to sleep by attempting to lock another process' locked region. If the system
+detects that sleeping until a locked region is unlocked would cause a deadlock,
+\fBfcntl()\fR will fail with an \fBEDEADLK\fR error.
+.sp
+.LP
+The following values for \fIcmd\fR are used for file share reservations. A
+share reservation is placed on an entire file to allow cooperating processes to
+control access to the file.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SHARE\fR\fR
+.ad
+.RS 13n
+.rt
+Sets a share reservation on a file with the specified access mode and
+designates which types of access to deny.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_UNSHARE\fR\fR
+.ad
+.RS 13n
+.rt
+Remove an existing share reservation.
+.RE
+
+.sp
+.LP
+File share reservations are an advisory form of access control among
+cooperating processes, on both local and remote machines. They are most often
+used by \fBDOS\fR or Windows emulators and \fBDOS based\fR \fBNFS\fR clients.
+However, native UNIX versions of \fBDOS\fR or Windows applications may also
+choose to use this form of access control.
+.sp
+.LP
+A share reservation is described by an \fBfshare\fR structure defined in
+<\fBsys/fcntl.h\fR>, which is included in <\fBfcntl.h\fR> as follows:
+.sp
+.in +2
+.nf
+typedef struct fshare {
+ short f_access;
+ short f_deny;
+ int f_id;
+} fshare_t;
+.fi
+.in -2
+
+.sp
+.LP
+A share reservation specifies the type of access, \fBf_access\fR, to be
+requested on the open file descriptor. If access is granted, it further
+specifies what type of access to deny other processes, \fBf_deny\fR. A single
+process on the same file may hold multiple non-conflicting reservations by
+specifying an identifier, \fBf_id\fR, unique to the process, with each request.
+.sp
+.LP
+An \fBF_UNSHARE\fR request releases the reservation with the specified
+\fBf_id\fR. The \fBf_access\fR and \fBf_deny\fR fields are ignored.
+.sp
+.LP
+Valid \fBf_access\fR values are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_RDACC\fR\fR
+.ad
+.RS 11n
+.rt
+Set a file share reservation for read-only access.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_WRACC\fR\fR
+.ad
+.RS 11n
+.rt
+Set a file share reservation for write-only access.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_RWACC\fR\fR
+.ad
+.RS 11n
+.rt
+Set a file share reservation for read and write access.
+.RE
+
+.sp
+.LP
+Valid \fBf_deny\fR values are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_COMPAT\fR\fR
+.ad
+.RS 12n
+.rt
+Set a file share reservation to compatibility mode.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_RDDNY\fR\fR
+.ad
+.RS 12n
+.rt
+Set a file share reservation to deny read access to other processes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_WRDNY\fR\fR
+.ad
+.RS 12n
+.rt
+Set a file share reservation to deny write access to other processes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_RWDNY\fR\fR
+.ad
+.RS 12n
+.rt
+Set a file share reservation to deny read and write access to other processes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_NODNY\fR\fR
+.ad
+.RS 12n
+.rt
+Do not deny read or write access to any other process.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the value returned depends on \fIcmd\fR as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_DUPFD\fR\fR
+.ad
+.RS 14n
+.rt
+A new file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_FREESP\fR\fR
+.ad
+.RS 14n
+.rt
+Value of \fB0\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETFD\fR\fR
+.ad
+.RS 14n
+.rt
+Value of flags defined in \fB<fcntl.h>\fR\&. The return value will not be
+negative.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETFL\fR\fR
+.ad
+.RS 14n
+.rt
+Value of file status flags and access modes. The return value will not be
+negative.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETLK\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETLK64\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETOWN\fR\fR
+.ad
+.RS 14n
+.rt
+Value of the socket owner process or process group; this will not be
+\fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_GETXFL\fR\fR
+.ad
+.RS 14n
+.rt
+Value of file status flags, access modes, and creation and assignment flags.
+The return value will not be negative.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETFD\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETFL\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLK\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLK64\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLKW\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETLKW64\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SETOWN\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_SHARE\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBF_UNSHARE\fR\fR
+.ad
+.RS 14n
+.rt
+Value other than \fB\(mi1\fR\&.
+.RE
+
+.sp
+.LP
+Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBfcntl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBF_SETLK\fR or \fBF_SETLK64\fR, the type of lock
+\fB(l_type)\fR is a shared (\fBF_RDLCK\fR) or exclusive (\fBF_WRLCK\fR) lock,
+and the segment of a file to be locked is already exclusive-locked by another
+process; or the type is an exclusive lock and some portion of the segment of a
+file to be locked is already shared-locked or exclusive-locked by another
+process.
+.sp
+The \fIcmd\fR argument is \fBF_FREESP\fR, the file exists, mandatory
+file/record locking is set, and there are outstanding record locks on the file;
+or the \fIcmd\fR argument is \fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or
+\fBF_SETLKW64\fR, mandatory file/record locking is set, and the file is
+currently being mapped to virtual memory using \fBmmap\fR(2).
+.sp
+The \fIcmd\fR argument is \fBF_SHARE\fR and \fBf_access\fR conflicts with an
+existing \fBf_deny\fR share reservation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument is not a valid open file descriptor; or the \fIcmd\fR
+argument is \fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or
+\fBF_SETLKW64\fR, the type of lock, \fBl_type\fR, is a shared lock
+(\fBF_RDLCK\fR), and \fIfildes\fR is not a valid file descriptor open for
+reading; or the type of lock \fBl_type\fR is an exclusive lock (\fBF_WRLCK\fR)
+and \fIfildes\fR is not a valid file descriptor open for writing.
+.sp
+The \fIcmd\fR argument is \fBF_FREESP\fR and \fIfildes\fR is not a valid file
+descriptor open for writing.
+.sp
+The \fIcmd\fR argument is \fBF_DUP2FD\fR, and \fIarg\fR is negative or is not
+less than the current resource limit for \fBRLIMIT_NOFILE.\fR
+.sp
+The \fIcmd\fR argument is \fBF_SHARE,\fR the \fBf_access\fR share reservation
+is for write access, and \fIfildes\fR is not a valid file descriptor open for
+writing.
+.sp
+The \fIcmd\fR argument is \fBF_SHARE,\fR the \fBf_access\fR share reservation
+is for read access, and \fIfildes\fR is not a valid file descriptor open for
+reading.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBF_GETLK\fR, \fBF_GETLK64\fR, \fBF_SETLK\fR,
+\fBF_SETLK64\fR, \fBF_SETLKW\fR, \fBF_SETLKW64\fR, or \fBF_FREESP\fR and the
+\fIarg\fR argument points to an illegal address.
+.sp
+The \fIcmd\fR argument is \fBF_SHARE\fR or \fBF_UNSHARE\fR and \fIarg\fR points
+to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBF_SETLKW\fR or \fBF_SETLKW64\fR and the function
+was interrupted by a signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is invalid or not supported by the file system; or the
+\fIcmd\fR argument is \fBF_DUPFD\fR and \fIarg\fR is negative or greater than
+or equal to \fBOPEN_MAX\fR; or the \fIcmd\fR argument is \fBF_GETLK\fR,
+\fBF_GETLK64\fR, \fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or
+\fBF_SETLKW64\fR and the data pointed to by \fIarg\fR is not valid; or
+\fIfildes\fR refers to a file that does not support locking.
+.sp
+The \fIcmd\fR argument is \fBF_UNSHARE\fR and a reservation with this
+\fBf_id\fR for this process does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 13n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBF_DUPFD\fR and either \fBOPEN_MAX\fR file
+descriptors are currently open in the calling process, or no file descriptors
+greater than or equal to \fIarg\fR are available.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLCK\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or
+\fBF_SETLKW64\fR and satisfying the lock or unlock request would result in the
+number of locked regions in the system exceeding a system-imposed limit.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 13n
+.rt
+Either the \fIfildes\fR argument is on a remote machine and the link to that
+machine is no longer active; or the \fIcmd\fR argument is \fBF_FREESP\fR, the
+file is on a remote machine, and the link to that machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+One of the values to be returned cannot be represented correctly.
+.sp
+The \fIcmd\fR argument is \fBF_GETLK\fR, \fBF_SETLK\fR, or \fBF_SETLKW\fR and
+the smallest or, if \fBl_len\fR is non-zero, the largest, offset of any byte in
+the requested segment cannot be represented correctly in an object of type
+\fBoff_t\fR.
+.sp
+The \fIcmd\fR argument is \fBF_GETLK64\fR, \fBF_SETLK64\fR, or \fBF_SETLKW64\fR
+and the smallest or, if \fBl_len\fR is non-zero, the largest, offset of any
+byte in the requested segment cannot be represented correctly in an object of
+type \fBoff64_t\fR.
+.RE
+
+.sp
+.LP
+The \fBfcntl()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is \fBF_SETLK\fR, \fBF_SETLK64\fR, \fBF_SETLKW\fR, or
+\fBF_SETLKW64\fR, and the file is currently being mapped to virtual memory
+using \fBmmap\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDEADLK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is \fBF_SETLKW\fR or \fBF_SETLKW64\fR, the lock is
+blocked by some lock from another process and putting the calling process to
+sleep, waiting for that lock to become free would cause a deadlock.
+.sp
+The \fIcmd\fR argument is \fBF_FREESP,\fR mandatory record locking is enabled,
+\fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear and a deadlock condition was
+detected.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBlockd\fR(1M), \fBchmod\fR(2), \fBclose\fR(2), \fBcreat\fR(2), \fBdup\fR(2),
+\fBexec\fR(2), \fBfork\fR(2), \fBmmap\fR(2), \fBopen\fR(2), \fBpipe\fR(2),
+\fBread\fR(2), \fBsigaction\fR(2), \fBwrite\fR(2), \fBdup2\fR(3C),
+\fBfcntl.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5)
+.sp
+.LP
+\fIProgramming Interfaces Guide\fR
+.SH NOTES
+.sp
+.LP
+In the past, the variable \fBerrno\fR was set to \fBEACCES\fR rather than
+\fBEAGAIN\fR when a section of a file is already locked by another process.
+Therefore, portable application programs should expect and test for either
+value.
+.sp
+.LP
+Advisory locks allow cooperating processes to perform consistent operations on
+files, but do not guarantee exclusive access. Files can be accessed without
+advisory locks, but inconsistencies may result. The network share locking
+protocol does not support the \fBf_deny\fR value of \fBF_COMPAT\fR. For network
+file systems, if \fBf_access\fR is \fBF_RDACC\fR, \fBf_deny\fR is mapped to
+\fBF_RDDNY\fR. Otherwise, it is mapped to \fBF_RWDNY\fR.
+.sp
+.LP
+To prevent possible file corruption, the system may reject \fBmmap()\fR
+requests for advisory locked files, or it may reject advisory locking requests
+for mapped files. Applications that require a file be both locked and mapped
+should lock the entire file (\fBl_start\fR and \fBl_len\fR both set to 0). If a
+file is mapped, the system may reject an unlock request, resulting in a lock
+that does not cover the entire file.
+.sp
+.LP
+The process ID returned for locked files on network file systems might not be
+meaningful.
+.sp
+.LP
+If the file server crashes and has to be rebooted, the lock manager (see
+\fBlockd\fR(1M)) attempts to recover all locks that were associated with that
+server. If a lock cannot be reclaimed, the process that held the lock is issued
+a \fBSIGLOST\fR signal.
diff --git a/usr/src/man/man2/fork.2 b/usr/src/man/man2/fork.2
new file mode 100644
index 0000000000..22652fd85f
--- /dev/null
+++ b/usr/src/man/man2/fork.2
@@ -0,0 +1,535 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1994, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH fork 2 "28 Oct 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+fork, fork1, forkall, forkx, forkallx \- create a new process
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBpid_t\fR \fBfork\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBpid_t\fR \fBfork1\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBpid_t\fR \fBforkall\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+#include <sys/fork.h>
+
+\fBpid_t\fR \fBforkx\fR(\fBint\fR \fIflags\fR);
+.fi
+
+.LP
+.nf
+\fBpid_t\fR \fBforkallx\fR(\fBint\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBfork()\fR, \fBfork1()\fR, \fBforkall()\fR, \fBforkx()\fR, and
+\fBforkallx()\fR functions create a new process. The address space of the new
+process (child process) is an exact copy of the address space of the calling
+process (parent process). The child process inherits the following attributes
+from the parent process:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+real user ID, real group ID, effective user ID, effective group ID
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+environment
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+open file descriptors
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+close-on-exec flags (see \fBexec\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+signal handling settings (that is, \fBSIG_DFL\fR, \fBSIG_IGN\fR,
+\fBSIG_HOLD\fR, function address)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+supplementary group IDs
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+set-user-ID mode bit
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+set-group-ID mode bit
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+profiling on/off status
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+nice value (see \fBnice\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+scheduler class (see \fBpriocntl\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+all attached shared memory segments (see \fBshmop\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process group \fBID\fR -- memory mappings (see \fBmmap\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+session \fBID\fR (see \fBexit\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+current working directory
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+root directory
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+file mode creation mask (see \fBumask\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+resource limits (see \fBgetrlimit\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+controlling terminal
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+saved user \fBID\fR and group \fBID\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+task ID and project ID
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+processor bindings (see \fBprocessor_bind\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+processor set bindings (see \fBpset_bind\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process privilege sets (see \fBgetppriv\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+process flags (see \fBgetpflags\fR(2))
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+active contract templates (see \fBcontract\fR(4))
+.RE
+.sp
+.LP
+Scheduling priority and any per-process scheduling parameters that are specific
+to a given scheduling class might or might not be inherited according to the
+policy of that particular class (see \fBpriocntl\fR(2)). The child process
+might or might not be in the same process contract as the parent (see
+\fBprocess\fR(4)). The child process differs from the parent process in the
+following ways:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The child process has a unique process \fBID\fR which does not match any active
+process group \fBID\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The child process has a different parent process \fBID\fR (that is, the process
+\fBID\fR of the parent process).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The child process has its own copy of the parent's file descriptors and
+directory streams. Each of the child's file descriptors shares a common file
+pointer with the corresponding file descriptor of the parent.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Each shared memory segment remains attached and the value of \fBshm_nattach\fR
+is incremented by 1.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+All \fBsemadj\fR values are cleared (see \fBsemop\fR(2)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Process locks, text locks, data locks, and other memory locks are not inherited
+by the child (see \fBplock\fR(3C) and \fBmemcntl\fR(2)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The child process's \fBtms\fR structure is cleared: \fBtms_utime\fR,
+\fBstime\fR, \fBcutime\fR, and \fBcstime\fR are set to 0 (see \fBtimes\fR(2)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The child processes resource utilizations are set to 0; see \fBgetrlimit\fR(2).
+The \fBit_value\fR and \fBit_interval\fR values for the \fBITIMER_REAL\fR timer
+are reset to 0; see \fBgetitimer\fR(2).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The set of signals pending for the child process is initialized to the empty
+set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Timers created by \fBtimer_create\fR(3C) are not inherited by the child
+process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+No asynchronous input or asynchronous output operations are inherited by the
+child.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Any preferred hardware address tranlsation sizes (see \fBmemcntl\fR(2)) are
+inherited by the child.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The child process holds no contracts (see \fBcontract\fR(4)).
+.RE
+.sp
+.LP
+Record locks set by the parent process are not inherited by the child process
+(see \fBfcntl\fR(2)).
+.sp
+.LP
+Although any open door descriptors in the parent are shared by the child, only
+the parent will receive a door invocation from clients even if the door
+descriptor is open in the child. If a descriptor is closed in the parent,
+attempts to operate on the door descriptor will fail even if it is still open
+in the child.
+.SS "Threads"
+.sp
+.LP
+A call to \fBforkall()\fR or \fBforkallx()\fR replicates in the child process
+all of the threads (see \fBthr_create\fR(3C) and \fBpthread_create\fR(3C)) in
+the parent process. A call to \fBfork1()\fR or \fBforkx()\fR replicates only
+the calling thread in the child process.
+.sp
+.LP
+A call to \fBfork()\fR is identical to a call to \fBfork1()\fR; only the
+calling thread is replicated in the child process. This is the POSIX-specified
+behavior for \fBfork()\fR.
+.sp
+.LP
+In releases of Solaris prior to Solaris 10, the behavior of \fBfork()\fR
+depended on whether or not the application was linked with the POSIX threads
+library. When linked with \fB-lthread\fR (Solaris Threads) but not linked with
+\fB-lpthread\fR (POSIX Threads), \fBfork()\fR was the same as \fBforkall()\fR.
+When linked with \fB-lpthread\fR, whether or not also linked with
+\fB-lthread\fR, \fBfork()\fR was the same as \fBfork1()\fR.
+.sp
+.LP
+Prior to Solaris 10, either \fB-lthread\fR or \fB-lpthread\fR was required for
+multithreaded applications. This is no longer the case. The standard C library
+provides all threading support for both sets of application programming
+interfaces. Applications that require replicate-all fork semantics must call
+\fBforkall()\fR or \fBforkallx()\fR.
+.SS "Fork Extensions"
+.sp
+.LP
+The \fBforkx()\fR and \fBforkallx()\fR functions accept a \fIflags\fR argument
+consisting of a bitwise inclusive-OR of zero or more of the following flags,
+which are defined in the header \fB<sys/fork.h>\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFORK_NOSIGCHLD\fR\fR
+.ad
+.sp .6
+.RS 4n
+Do not post a \fBSIGCHLD\fR signal to the parent process when the child process
+terminates, regardless of the disposition of the \fBSIGCHLD\fR signal in the
+parent. \fBSIGCHLD\fR signals are still possible for job control stop and
+continue actions if the parent has requested them.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFORK_WAITPID\fR\fR
+.ad
+.sp .6
+.RS 4n
+Do not allow wait-for-multiple-pids by the parent, as in \fBwait()\fR,
+\fBwaitid\fR(\fBP_ALL\fR), or \fBwaitid\fR(\fBP_PGID\fR), to reap the child and
+do not allow the child to be reaped automatically due the disposition of the
+SIGCHLD signal being set to be ignored in the parent. Only a specific wait for
+the child, as in \fBwaitid\fR(\fBP_PID\fR, \fBpid\fR), is allowed and it is
+required, else when the child exits it will remain a zombie until the parent
+exits.
+.RE
+
+.sp
+.LP
+If the \fIflags\fR argument is 0 \fBforkx()\fR is identical to \fBfork()\fR and
+\fBforkallx()\fR is identical to \fBforkall()\fR.
+.SS "\fBfork()\fR Safety"
+.sp
+.LP
+If a multithreaded application calls \fBfork()\fR, \fBfork1()\fR, or
+\fBforkx()\fR, and the child does more than simply call one of the
+\fBexec\fR(2) functions, there is a possibility of deadlock occurring in the
+child. The application should use \fBpthread_atfork\fR(3C) to ensure safety
+with respect to this deadlock. Should there be any outstanding mutexes
+throughout the process, the application should call \fBpthread_atfork()\fR to
+wait for and acquire those mutexes prior to calling \fBfork()\fR,
+\fBfork1()\fR, or \fBforkx()\fR. See "MT-Level of Libraries" on the
+\fBattributes\fR(5) manual page.
+.sp
+.LP
+The \fBpthread_atfork()\fR mechanism is used to protect the locks that
+\fBlibc\fR(3LIB) uses to implement interfaces such as \fBmalloc\fR(3C). All
+interfaces provided by \fBlibc\fR are safe to use in a child process following
+a \fBfork()\fR, except when \fBfork()\fR is executed within a signal handler.
+.sp
+.LP
+The POSIX standard (see \fBstandards\fR(5)) requires fork to be
+Async-Signal-Safe (see \fBattributes\fR(5)). This cannot be made to happen with
+fork handlers in place, because they acquire locks. To be in nominal
+compliance, no fork handlers are called when \fBfork()\fR is executed within a
+signal context. This leaves the child process in a questionable state with
+respect to its locks, but at least the calling thread will not deadlock itself
+attempting to acquire a lock that it already owns. In this situation, the
+application should strictly adhere to the advice given in the POSIX
+specification: "To avoid errors, the child process may only execute
+Async-Signal-Safe operations until such time as one of the \fBexec\fR(2)
+functions is called."
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBfork()\fR, \fBfork1()\fR, \fBforkall()\fR,
+\fBforkx()\fR, and \fBforkallx()\fR return \fB0\fR to the child process and
+return the process \fBID\fR of the child process to the parent process.
+Otherwise, \fB(pid_t)\(mi1\fR is returned to the parent process, no child
+process is created, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBfork()\fR, \fBfork1()\fR, \fBforkall()\fR, \fBforkx()\fR, and
+\fBforkallx()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+A resource control or limit on the total number of processes, tasks or LWPs
+under execution by a single user, task, project, or zone has been exceeded, or
+the total amount of system memory available is temporarily insufficient to
+duplicate this process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+There is not enough swap space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_FORK\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.LP
+The \fBforkx()\fR and \fBforkallx()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIflags\fR argument is invalid.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe.
+_
+StandardSee below.
+.TE
+
+.sp
+.LP
+For \fBfork()\fR, see \fBstandards\fR(5).
+.SH SEE ALSO
+.sp
+.LP
+\fBalarm\fR(2), \fBexec\fR(2), \fBexit\fR(2), \fBfcntl\fR(2),
+\fBgetitimer\fR(2), \fBgetrlimit\fR(2), \fBmemcntl\fR(2), \fBmmap\fR(2),
+\fBnice\fR(2), \fBpriocntl\fR(2), \fBsemop\fR(2), \fBshmop\fR(2),
+\fBtimes\fR(2), \fBumask\fR(2), \fBwaitid\fR(2), \fBdoor_create\fR(3C),
+\fBexit\fR(3C), \fBplock\fR(3C), \fBpthread_atfork\fR(3C),
+\fBpthread_create\fR(3C), \fBsignal\fR(3C), \fBsystem\fR(3C),
+\fBthr_create\fR(3C) \fBtimer_create\fR(3C), \fBwait\fR(3C), \fBcontract\fR(4),
+\fBprocess\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+An application should call \fB_exit()\fR rather than \fBexit\fR(3C) if it
+cannot \fBexecve()\fR, since \fBexit()\fR will flush and close standard I/O
+channels and thereby corrupt the parent process's standard I/O data structures.
+Using \fBexit\fR(3C) will flush buffered data twice. See \fBexit\fR(2).
+.sp
+.LP
+The thread in the child that calls \fBfork()\fR, \fBfork1()\fR, or
+\fBfork1x()\fR must not depend on any resources held by threads that no longer
+exist in the child. In particular, locks held by these threads will not be
+released.
+.sp
+.LP
+In a multithreaded process, \fBforkall()\fR in one thread can cause blocking
+system calls to be interrupted and return with an \fBEINTR\fR error.
diff --git a/usr/src/man/man2/fpathconf.2 b/usr/src/man/man2/fpathconf.2
new file mode 100644
index 0000000000..df5320f197
--- /dev/null
+++ b/usr/src/man/man2/fpathconf.2
@@ -0,0 +1,425 @@
+'\" te
+.\" Copyright (c) 1994, X/Open Company Limited. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
+.\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
+.\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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. 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. 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]
+.TH fpathconf 2 "1 Sep 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+fpathconf, pathconf \- get configurable pathname variables
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBlong\fR \fBfpathconf\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIname\fR);
+.fi
+
+.LP
+.nf
+\fBlong\fR \fBpathconf\fR(\fBconst char *\fR\fIpath\fR, \fBint\fR \fIname\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBfpathconf()\fR and \fBpathconf()\fR functions determine the current
+value of a configurable limit or option ( variable ) that is associated with a
+file or directory.
+.sp
+.LP
+For \fBpathconf()\fR, the \fIpath\fR argument points to the pathname of a file
+or directory.
+.sp
+.LP
+For \fBfpathconf()\fR, the \fIfildes\fR argument is an open file descriptor.
+.sp
+.LP
+The \fIname\fR argument represents the variable to be queried relative to that
+file or directory. The variables in the following table come from
+<\fBlimits.h\fR> or <\fBunistd.h\fR> and the symbolic constants, defined in
+<\fBunistd.h\fR>, are the corresponding values used for \fIname:\fR
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.14i) |cw(2.15i) |cw(1.21i)
+lw(2.14i) |lw(2.15i) |lw(1.21i)
+.
+VariableValue of \fIname\fRNotes
+_
+{\fBACL_ENABLED\fR}\fB_PC_ACL_ENABLED\fR10
+_
+{\fBFILESIZEBITS\fR}\fB_PC_FILESIZEBITS\fR3,4
+_
+{\fBLINK_MAX\fR}\fB_PC_LINK_MAX\fR1
+_
+{\fBMAX_CANON\fR}\fB_PC_MAX_CANON\fR2
+_
+{\fBMAX_INPUT\fR}\fB_PC_MAX_INPUT\fR2
+_
+{\fBMIN_HOLE_SIZE\fR}\fB_PC_MIN_HOLE_SIZE\fR11
+_
+{\fBNAME_MAX\fR}\fB_PC_NAME_MAX\fR3, 4
+_
+{\fBPATH_MAX\fR}\fB_PC_PATH_MAX\fR4,5
+_
+{\fBPIPE_BUF\fR}\fB_PC_PIPE_BUF\fR6
+_
+{\fBPOSIX_ALLOC_SIZE_MIN\fR}\fB_PC_ALLOC_SIZE_MIN\fR
+_
+{\fBPOSIX_REC_INCR_XFER_SIZE\fR}\fB_PC_REC_INCR_XFER_SIZE\fR
+_
+{\fBPOSIX_REC_MAX_XFER_SIZE\fR}\fB_PC_REC_MAX_XFER_SIZE\fR
+_
+{\fBPOSIX_REC_MIN_XFER_SIZE\fR}\fB_PC_REC_MIN_XFER_SIZE\fR
+_
+{\fBPOSIX_REC_XFER_ALIGN\fR}\fB_PC_REC_XFER_ALIGN\fR
+_
+{\fBSYMLINK_MAX\fR}\fB_PC_SYMLINK_MAX\fR4, 9
+_
+{\fBXATTR_ENABLED\fR}\fB_PC_XATTR_ENABLED\fR1
+_
+{\fBSATTR_ENABLED\fR}\fB_PC_SATTR_ENABLED\fR
+_
+{\fBXATTR_EXISTS\fR}\fB_PC_XATTR_EXISTS\fR1
+_
+{\fBSATTR_EXISTS\fR}\fB_PC_SATTR_EXISTS\fR
+_
+{\fBACCESS_FILTERING\fR}\fB_PC_ACCESS_FILTERING\fR12
+_
+\fB_POSIX_CHOWN_RESTRICTED\fR\fB_PC_CHOWN_RESTRICTED\fR7
+_
+\fB_POSIX_NO_TRUNC\fR\fB_PC_NO_TRUNC\fR3, 4
+_
+\fB_POSIX_VDISABLE\fR\fB_PC_VDISABLE\fR2
+_
+\fB_POSIX_ASYNC_IO\fR\fB_PC_ASYNC_IO\fR8
+_
+\fB_POSIX_PRIO_IO\fR\fB_PC_PRIO_IO\fR8
+_
+\fB_POSIX_SYNC_IO\fR\fB_PC_SYNC_IO\fR8
+_
+\fB_POSIX_TIMESTAMP_RESOLUTION\fR\fB_PC_TIMESTAMP_RESOLUTION\fR1
+.TE
+
+.sp
+.LP
+\fBNotes:\fR
+.RS +4
+.TP
+1.
+If \fIpath\fR or \fIfildes\fR refers to a directory, the value returned
+applies to the directory itself.
+.RE
+.RS +4
+.TP
+2.
+If \fIpath\fR or \fIfildes\fR does not refer to a terminal file, it is
+unspecified whether an implementation supports an association of the variable
+name with the specified file.
+.RE
+.RS +4
+.TP
+3.
+If \fIpath\fR or \fIfildes\fR refers to a directory, the value returned
+applies to filenames within the directory.
+.RE
+.RS +4
+.TP
+4.
+If \fIpath\fR or \fIfildes\fR does not refer to a directory, it is
+unspecified whether an implementation supports an association of the variable
+name with the specified file.
+.RE
+.RS +4
+.TP
+5.
+If \fIpath\fR or \fIfildes\fR refers to a directory, the value returned is
+the maximum length of a relative pathname when the specified directory is the
+working directory.
+.RE
+.RS +4
+.TP
+6.
+If \fIpath\fR refers to a FIFO, or \fIfildes\fR refers to a pipe or FIFO,
+the value returned applies to the referenced object. If \fIpath\fR or
+\fIfildes\fR refers to a directory, the value returned applies to any FIFO that
+exists or can be created within the directory. If \fIpath\fR or \fIfildes\fR
+refers to any other type of file, it is unspecified whether an implementation
+supports an association of the variable name with the specified file.
+.RE
+.RS +4
+.TP
+7.
+If \fIpath\fR or \fIfildes\fR refers to a directory, the value returned
+applies to any files, other than directories, that exist or can be created
+within the directory.
+.RE
+.RS +4
+.TP
+8.
+If \fIpath\fR or \fIfildes\fR refers to a directory, it is unspecified
+whether an implementation supports an association of the variable name with the
+specified file.
+.RE
+.RS +4
+.TP
+9.
+If \fIpath\fR or \fIfildes\fR refers to a directory, the value returned is
+the maximum length of the string that a symbolic link in that directory can
+contain.
+.RE
+.RS +4
+.TP
+10.
+If \fIpath\fR or \fIfildes\fR refers to a file or directory in a file
+system that supports ACLs, the value returned is the bitwise inclusive OR of
+the following flags associated with ACL types supported by the file system;
+otherwise 0 is returned.
+.sp
+.ne 2
+.mk
+.na
+\fB\fB_ACL_ACE_ENABLED\fR\fR
+.ad
+.RS 23n
+.rt
+The file system supports ACE ACLs.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB_ACL_ACLENT_ENABLED\fR\fR
+.ad
+.RS 23n
+.rt
+The file system supports UFS aclent ACLs.
+.RE
+
+.RE
+.RS +4
+.TP
+11.
+If a filesystem supports the reporting of holes (see \fBlseek\fR(2),
+\fBpathconf()\fR and \fBfpathconf()\fR return a positive number that represents
+the minimum hole size returned in bytes. The offsets of holes returned will be
+aligned to this same value. A special value of 1 is returned if the filesystem
+does not specify the minimum hole size but still reports holes.
+.RE
+.RS +4
+.TP
+12.
+If \fIpath\fR or \fIfildes\fR refers to a directory and the file system in
+which the directory resides supports access filtering, a non-zero value is
+returned. Otherwise, 0 is returned.
+.RE
+.SH RETURN VALUES
+.sp
+.LP
+If \fIname\fR is an invalid value, both \fBpathconf()\fR and \fBfpathconf()\fR
+return \fB\(mi1\fR and \fBerrno\fR is set to indicate the error.
+.sp
+.LP
+If the variable corresponding to \fIname\fR has no limit for the \fIpath\fR or
+file descriptor, both \fBpathconf()\fR and \fBfpathconf()\fR return \fB\(mi1\fR
+without changing \fBerrno\fR. If \fBpathconf()\fR needs to use \fIpath\fR to
+determine the value of \fIname\fR and \fBpathconf()\fR does not support the
+association of \fIname\fR with the file specified by \fIpath\fR, or if the
+process did not have appropriate privileges to query the file specified by
+\fIpath\fR, or \fIpath\fR does not exist, \fBpathconf()\fR returns \fB\(mi1\fR
+and \fBerrno\fR is set to indicate the error.
+.sp
+.LP
+If \fBfpathconf()\fR needs to use \fIfildes\fR to determine the value of
+\fIname\fR and \fBfpathconf()\fR does not support the association of \fIname\fR
+with the file specified by \fIfildes\fR, or if \fIfildes\fR is an invalid file
+descriptor, \fBfpathconf()\fR returns \fB\(mi1\fR and \fBerrno\fR is set to
+indicate the error.
+.sp
+.LP
+Otherwise \fBpathconf()\fR or \fBfpathconf()\fR returns the current variable
+value for the file or directory without changing \fBerrno\fR. The value
+returned will not be more restrictive than the corresponding value available to
+the application when it was compiled with <\fBlimits.h\fR> or <\fBunistd.h\fR>.
+.SH ERRORS
+.sp
+.LP
+The \fBpathconf()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIname\fR is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 10n
+.rt
+A loop exists in symbolic links encountered during resolution of the \fIpath\fR
+argument.
+.RE
+
+.sp
+.LP
+The \fBfpathconf()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIname\fR is not valid.
+.RE
+
+.sp
+.LP
+The \fBpathconf()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+An association of the variable \fIname\fR with the specified file is not
+supported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR} or a pathname
+component is longer than {\fBNAME_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+As a result of encountering a symbolic link in resolution of the \fIpath\fR
+argument, the length of the substituted pathname string exceeded
+{\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of \fIpath\fR does not name an existing file or \fIpath\fR is an
+empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.LP
+The \fBfpathconf()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+An association of the variable \fIname\fR with the specified file is not
+supported.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The {\fBSYMLINK_MAX\fR} variable applies only to the \fBfpathconf()\fR
+function.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBlseek\fR(2), \fBconfstr\fR(3C), \fBlimits.h\fR(3HEAD), \fBsysconf\fR(3C),
+\fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/getacct.2 b/usr/src/man/man2/getacct.2
new file mode 100644
index 0000000000..62cbabeb6e
--- /dev/null
+++ b/usr/src/man/man2/getacct.2
@@ -0,0 +1,180 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getacct 2 "20 Jan 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+getacct, putacct, wracct \- get, put, or write extended accounting data
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/exacct.h>
+
+\fBsize_t\fR \fBgetacct\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIbufsize\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBputacct\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIbufsize\fR, \fBint\fR \fIflags\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBwracct\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBint\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+These functions provide access to the extended accounting facility.
+.sp
+.LP
+The \fBgetacct()\fR function returns extended accounting buffers from the
+kernel for currently executing tasks and processes. The resulting data buffer
+is a packed \fBexacct\fR object that can be unpacked using
+\fBea_unpack_object()\fR (see \fBea_pack_object\fR(3EXACCT)) and subsequently
+manipulated using the functions of the extended accounting library,
+\fBlibexacct\fR(3LIB).
+.sp
+.LP
+The \fBputacct()\fR function provides privileged processes the ability to tag
+accounting records with additional data specific to that process. For
+instance, a queueing facility might want to record to which queue a given task
+or process was submitted prior to running. The \fIflags\fR argument determines
+whether the contents of \fIbuf\fR should be treated as raw data (\fBEP_RAW\fR)
+or as an embedded \fBexacct\fR structure (\fBEP_EXACCT_OBJECT\fR). In the case
+of \fBEP_EXACCT_OBJECT\fR, \fIbuf\fR must be a packed \fBexacct\fR object as
+returned by \fBea_pack_object\fR(3EXACCT). The use of an inappropriate flag or
+the inclusion of corrupt \fBexacct\fR data will likely corrupt the enclosing
+\fBexacct\fR file.
+.sp
+.LP
+The \fBwracct()\fR function requests the kernel to write, given its internal
+state of resource usage, the appropriate data for the specified task or
+process. The flags field determines whether a partial (\fBEW_PARTIAL\fR) or
+interval record (\fBEW_INTERVAL\fR) is written.
+.sp
+.LP
+These functions require root privilege, as they allow inquiry or reporting
+relevant to system tasks and processes other than the invoking process. The
+\fBputacct()\fR and \fBwracct()\fR functions also cause the kernel to write
+records to the system's extended accounting files.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBgetacct()\fR function returns the number of bytes required to represent
+the extended accounting record for the requested system task or process. If
+\fIbufsize\fR exceeds the returned size, \fIbuf\fR will contain a valid
+accounting record buffer. If \fIbufsize\fR is less than the return value,
+\fIbuf\fR will contain the first \fIbufsize\fR bytes of the record. If
+\fIbufsize\fR is 0, \fBgetacct()\fR returns only the number of bytes required
+to represent the extended accounting record. In the event of failure,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.sp
+.LP
+The \fBputacct()\fR and \fBwracct()\fR functions return \fB0\fR if the record
+was successfully written. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is
+set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetacct()\fR, \fBputacct()\fR, and \fBwracct()\fR functions will fail
+if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIidtype\fR argument was not \fBP_TASKID\fR or \fBP_PID\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 14n
+.rt
+The file system containing the extended accounting file is full. The
+\fBwracct()\fR or \fBputacct()\fR function will fail if the record size would
+exceed the amount of space remaining on the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTACTIVE\fR\fR
+.ad
+.RS 14n
+.rt
+The extended accounting facility for the requested \fBidtype_t\fR is not
+active. Either \fBputacct()\fR attempted to write a task record when the task
+accounting file was unset, or \fBgetacct()\fR attempted to retrieve accounting
+data for a process when extended process accounting was inactive.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 14n
+.rt
+The {\fBPRIV_SYS_ACCT\fR} privilege is not asserted in the effective set of the
+calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERSCH\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIid\fR argument does not refer to a presently active system task \fBID\fR
+or process \fBID\fR.
+.RE
+
+.sp
+.LP
+The \fBputacct()\fR and \fBwracct()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIflags\fR argument is neither \fBEW_PARTIAL\fR nor \fBEW_INTERVAL\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+lw(2.75i) |lw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBea_pack_object\fR(3EXACCT), \fBlibexacct\fR(3LIB)\fBattributes\fR(5)
diff --git a/usr/src/man/man2/getaudit.2 b/usr/src/man/man2/getaudit.2
new file mode 100644
index 0000000000..09167e3cca
--- /dev/null
+++ b/usr/src/man/man2/getaudit.2
@@ -0,0 +1,156 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getaudit 2 "16 Apr 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+getaudit, setaudit, getaudit_addr, setaudit_addr \- get or set process audit
+information
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR ... ]
+#include <sys/param.h>
+#include <bsm/libbsm.h>
+
+\fBint\fR \fBgetaudit\fR(\fBstruct auditinfo *\fR\fIinfo\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetaudit\fR(\fBstruct auditinfo *\fR\fIinfo\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBgetaudit_addr\fR(\fBstruct auditinfo_addr *\fR\fIinfo\fR, \fBint\fR \fIlength\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetaudit_addr\fR(\fBstruct auditinfo_addr *\fR\fIinfo\fR, \fBint\fR \fIlength\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetaudit()\fR function gets the audit \fBID\fR, the preselection mask,
+the terminal \fBID\fR and the audit session \fBID\fR for the current process.
+.sp
+.LP
+The \fBgetaudit()\fR function can fail and return an \fBE2BIG\fR errno if the
+address field in the terminal \fBID\fR is larger than 32 bits. In this case,
+\fBgetaudit_addr()\fR should be used.
+.sp
+.LP
+The \fBsetaudit()\fR function sets the audit \fBID\fR, the preselection mask,
+the terminal \fBID\fR and the audit session \fBID\fR for the current process.
+.sp
+.LP
+The \fBgetaudit_addr()\fR function returns a variable length
+\fBauditinfo_addr\fR structure that contains the audit \fBID\fR, the
+preselection mask, the terminal \fBID\fR, and the audit session \fBID\fR for
+the current process. The terminal \fBID\fR contains a size field that indicates
+the size of the network address.
+.sp
+.LP
+The \fBsetaudit_addr()\fR function sets the audit \fBID\fR, the preselection
+mask, the terminal \fBID\fR, and the audit session \fBID\fR for the current
+process. The values are taken from the variable length struture
+\fBauditinfo_addr\fR. The terminal \fBID\fR contains a size field that
+indicates the size of the network address.
+.sp
+.LP
+The \fBauditinfo\fR structure is used to pass the process audit information and
+contains the following members:
+.sp
+.in +2
+.nf
+au_id_t ai_auid; /* audit user ID */
+au_mask_t ai_mask; /* preselection mask */
+au_tid_t ai_termid; /* terminal ID */
+au_asid_t ai_asid; /* audit session ID */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBauditinfo_addr\fR structure is used to pass the process audit
+information and contains the following members:
+.sp
+.in +2
+.nf
+au_id_t ai_auid; /* audit user ID */
+au_mask_t ai_mask; /* preselection mask */
+au_tid_addr_t ai_termid; /* terminal ID */
+au_asid_t ai_asid; /* audit session ID */
+.fi
+.in -2
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBgetaudit()\fR and \fBsetaudit()\fR return
+\fB0\fR. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate
+the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetaudit()\fR and \fBsetaudit()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIinfo\fR parameter points outside the process's allocated address space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_AUDIT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The calling process must have the {\fBPRIV_SYS_AUDIT\fR} privilege asserted in
+its effective set.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStable
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBbsmconv\fR(1M), \fBaudit\fR(2), \fBattributes\fR(5)
+.SH NOTES
+.sp
+.LP
+The functionality described in this man page is available only if the Solaris
+Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.
diff --git a/usr/src/man/man2/getauid.2 b/usr/src/man/man2/getauid.2
new file mode 100644
index 0000000000..db296be13e
--- /dev/null
+++ b/usr/src/man/man2/getauid.2
@@ -0,0 +1,105 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getauid 2 "16 Apr 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+getauid, setauid \- get or set user audit identity
+.SH SYNOPSIS
+.LP
+.nf
+cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lbsm\fR \fB -lsocket \fR \fB -lnsl \fR [ \fIlibrary\fR ... ]
+#include <sys/param.h>
+#include <bsm/libbsm.h>
+
+\fBint\fR \fBgetauid\fR(\fBau_id_t *\fR\fIauid\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetauid\fR(\fBau_id_t *\fR\fIauid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetauid()\fR function returns the audit user \fBID\fR for the current
+process. This value is initially set at login time and inherited by all child
+processes. This value does not change when the real/effective user \fBIDs\fR
+change, so it can be used to identify the logged-in user even when running a
+setuid program. The audit user \fBID\fR governs audit decisions for a process.
+.sp
+.LP
+The \fBsetauid()\fR function sets the audit user \fBID\fR for the current
+process.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the \fBgetauid()\fR function returns the audit user
+\fBID\fR of the current process on success. Otherwise, it returns \fB\(mi1\fR
+and sets \fBerrno\fR to indicate the error.
+.sp
+.LP
+Upon successful completion the \fBsetauid()\fR function returns \fB0\fR.
+Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetauid()\fR and \fBsetauid()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIauid\fR argument points to an invalid address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_AUDIT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.LP
+The \fBgetauid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The {\fBPRIV_PROC_AUDIT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Only a process with appropriate privileges can successfully execute these
+calls.
+.SH SEE ALSO
+.sp
+.LP
+\fBbsmconv\fR(1M), \fBaudit\fR(2), \fBgetaudit\fR(2), \fBprivileges\fR(5)
+.SH NOTES
+.sp
+.LP
+The functionality described on this manual page is available only if the
+Solaris Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.
+.sp
+.LP
+These functions have been superseded by \fBgetaudit\fR(2) and \fBsetaudit()\fR.
diff --git a/usr/src/man/man2/getcontext.2 b/usr/src/man/man2/getcontext.2
new file mode 100644
index 0000000000..7a713d95ce
--- /dev/null
+++ b/usr/src/man/man2/getcontext.2
@@ -0,0 +1,104 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getcontext 2 "5 Feb 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+getcontext, setcontext \- get and set current user context
+.SH SYNOPSIS
+.LP
+.nf
+#include <ucontext.h>
+
+\fBint\fR \fBgetcontext\fR(\fBucontext_t *\fR\fIucp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetcontext\fR(\fBconst ucontext_t *\fR\fIucp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetcontext()\fR function initializes the structure pointed to by
+\fIucp\fR to the current user context of the calling process. The
+\fBucontext_t\fR type that \fIucp\fR points to defines the user context and
+includes the contents of the calling process' machine registers, the signal
+mask, and the current execution stack.
+.sp
+.LP
+The \fBsetcontext()\fR function restores the user context pointed to by
+\fIucp\fR. A successful call to \fBsetcontext()\fR does not return; program
+execution resumes at the point specified by the \fIucp\fR argument passed to
+\fBsetcontext()\fR. The \fIucp\fR argument should be created either by a prior
+call to \fBgetcontext()\fR, or by being passed as an argument to a signal
+handler. If the \fIucp\fR argument was created with \fBgetcontext()\fR, program
+execution continues as if the corresponding call of \fBgetcontext()\fR had just
+returned. If the \fIucp\fR argument was created with \fBmakecontext\fR(3C),
+program execution continues with the function passed to \fBmakecontext\fR(3C).
+When that function returns, the process continues as if after a call to
+\fBsetcontext()\fR with the \fIucp\fR argument that was input to
+\fBmakecontext\fR(3C). If the \fIucp\fR argument was passed to a signal
+handler, program execution continues with the program instruction following the
+instruction interrupted by the signal. If the \fBuc_link\fR member of the
+\fBucontext_t\fR structure pointed to by the \fIucp\fR argument is equal to 0,
+then this context is the main context, and the process will exit when this
+context returns. The effects of passing a \fIucp\fR argument obtained from any
+other source are unspecified.
+.SH RETURN VALUES
+.sp
+.LP
+On successful completion, \fBsetcontext()\fR does not return and
+\fBgetcontext()\fR returns \fB0\fR. Otherwise, \fB\(mi1\fR is returned.
+.SH ERRORS
+.sp
+.LP
+No errors are defined.
+.SH USAGE
+.sp
+.LP
+When a signal handler is executed, the current user context is saved and a new
+context is created. If the thread leaves the signal handler via
+\fBlongjmp\fR(3UCB), then it is unspecified whether the context at the time of
+the corresponding \fBsetjmp\fR(3UCB) call is restored and thus whether future
+calls to \fBgetcontext()\fR will provide an accurate representation of the
+current context, since the context restored by \fBlongjmp\fR(3UCB) may not
+contain all the information that \fBsetcontext()\fR requires. Signal handlers
+should use \fBsiglongjmp\fR(3C) instead.
+.sp
+.LP
+Portable applications should not modify or access the \fBuc_mcontext\fR member
+of \fBucontext_t\fR. A portable application cannot assume that context
+includes any process-wide static data, possibly including \fBerrno\fR. Users
+manipulating contexts should take care to handle these explicitly when
+required.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+\fBATTRIBUTE TYPE\fRATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsigaction\fR(2), \fBsigaltstack\fR(2), \fBsigprocmask\fR(2),
+\fBbsd_signal\fR(3C), \fBmakecontext\fR(3C), \fBsetjmp\fR(3UCB),
+\fBsigsetjmp\fR(3C), \fBucontext.h\fR(3HEAD), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/getdents.2 b/usr/src/man/man2/getdents.2
new file mode 100644
index 0000000000..0dbb1bf6f5
--- /dev/null
+++ b/usr/src/man/man2/getdents.2
@@ -0,0 +1,146 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getdents 2 "17 Jul 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+getdents \- read directory entries and put in a file system independent format
+.SH SYNOPSIS
+.LP
+.nf
+#include <dirent.h>
+
+\fBint\fR \fBgetdents\fR(\fBint\fR \fIfildes\fR, \fBstruct dirent *\fR\fIbuf\fR, \fBsize_t\fR \fInbyte\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetdents()\fR function attempts to read \fInbyte\fR bytes from the
+directory associated with the file descriptor \fIfildes\fR and to format them
+as file system independent directory entries in the buffer pointed to by
+\fIbuf\fR. Since the file system independent directory entries are of variable
+lengths, in most cases the actual number of bytes returned will be less than
+\fInbyte\fR. The file system independent directory entry is specified by the
+\fBdirent\fR structure. See \fBdirent.h\fR(3HEAD).
+.sp
+.LP
+On devices capable of seeking, \fBgetdents()\fR starts at a position in the
+file given by the file pointer associated with \fIfildes\fR. Upon return from
+\fBgetdents()\fR, the file pointer is incremented to point to the next
+directory entry.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative integer is returned indicating the
+number of bytes actually read. A return value of \fB0\fR indicates the end of
+the directory has been reached. Otherwise, \fB\(mi1\fR is returned and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetdents()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor open for reading.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fInbyte\fR argument is not large enough for one directory entry.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 13n
+.rt
+An I/O error occurred while accessing the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 13n
+.rt
+The current file pointer for the directory is not located at a valid entry.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument points to a remote machine and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The value of the \fBdirent\fR structure member \fBd_ino\fR or \fBd_off\fR
+cannot be represented in an \fBino_t\fR or \fBoff_t\fR.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBgetdents()\fR function was developed to implement the \fBreaddir\fR(3C)
+function and should not be used for other purposes.
+.sp
+.LP
+The \fBgetdents()\fR function has a transitional interface for 64-bit file
+offsets. See \fBlf64\fR(5).
+.SH SEE ALSO
+.sp
+.LP
+\fBreaddir\fR(3C), \fBdirent.h\fR(3HEAD), \fBlf64\fR(5)
diff --git a/usr/src/man/man2/getgroups.2 b/usr/src/man/man2/getgroups.2
new file mode 100644
index 0000000000..886c99109e
--- /dev/null
+++ b/usr/src/man/man2/getgroups.2
@@ -0,0 +1,132 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getgroups 2 "8 Sep 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+getgroups, setgroups \- get or set supplementary group access list IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBgetgroups\fR(\fBint\fR \fIgidsetsize\fR, \fBgid_t *\fR\fIgrouplist\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetgroups\fR(\fBint\fR \fIngroups\fR, \fBconst gid_t *\fR\fIgrouplist\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetgroups()\fR function gets the current supplemental group access list
+of the calling process and stores the result in the array of group IDs
+specified by \fIgrouplist\fR. This array has \fIgidsetsize\fR entries and must
+be large enough to contain the entire list. This list cannot be larger than
+\fBNGROUPS_UMAX\fR. If \fIgidsetsize\fR equals 0, \fBgetgroups()\fR will return
+the number of groups to which the calling process belongs without modifying the
+array pointed to by \fIgrouplist\fR.
+.sp
+.LP
+The \fBsetgroups()\fR function sets the supplementary group access list of the
+calling process from the array of group IDs specified by \fIgrouplist\fR. The
+number of entries is specified by \fIngroups\fR and can not be greater than
+\fBNGROUPS_MAX\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBgetgroups()\fR returns the number of
+supplementary group IDs set for the calling process and \fBsetgroups()\fR
+returns \fB0\fR. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetgroups()\fR and \fBsetgroups()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+A referenced part of the array pointed to by \fIgrouplist\fR is an illegal
+address.
+.RE
+
+.sp
+.LP
+The \fBgetgroups()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIgidsetsize\fR is non-zero and less than the number of
+supplementary group IDs set for the calling process.
+.RE
+
+.sp
+.LP
+The \fBsetgroups()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIngroups\fR is greater than {\fBNGROUPS_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Use of the \fBsetgroups()\fR function requires the {\fBPRIV_PROC_SETID\fR}
+privilege.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface Stability\fBgetgroups()\fR is Standard.
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgroups\fR(1), \fBchown\fR(2), \fBgetuid\fR(2), \fBsetuid\fR(2),
+\fBgetgrnam\fR(3C), \fBinitgroups\fR(3C), \fBattributes\fR(5),
+\fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/getisax.2 b/usr/src/man/man2/getisax.2
new file mode 100644
index 0000000000..a53ff55659
--- /dev/null
+++ b/usr/src/man/man2/getisax.2
@@ -0,0 +1,88 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getisax 2 "7 bNov 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+getisax \- extract valid instruction set extensions
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/auxv.h>
+
+\fBuint_t\fR \fBgetisax\fR(\fBuint32_t *\fR\fIarray\fR, \fBuint_t\fR \fIn\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetisax()\fR function sets the vector \fIarray\fR of \fIn\fR 32-bit
+integers to contain the bits from the \fBAV\fR_\fIxxx\fR_\fIyyy\fR namespace of
+the given instruction set architecture.
+.sp
+.LP
+Values for \fBAV\fR_\fIxxx\fR_\fIyyy\fR for SPARC and SPARCV9, and their
+associated descriptions, can be found in \fB<sys/auxv_SPARC.h>\fR.
+.sp
+.LP
+Values for \fBAV\fR_\fIxxx\fR_\fIyyy\fR for i386 and AMD64, and their
+associated descriptions, can be found in \fB<sys/auxv_386.h>\fR.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBgetisax()\fR function returns the number of array elements that contain
+non-zero values.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUse \fBgetisax()\fR to determine if the SSE2 instruction set is
+present.
+.sp
+.LP
+In the following example, if the message is written, the SSE2 instruction set
+is present and fully supportred by the operating system.
+
+.sp
+.in +2
+.nf
+uint_t ui;
+
+(void) getisax(&ui, 1);
+
+if (ui & AV_386_SSE2)
+ printf("SSE2 instruction set extension is present.\en");
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelSafe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBisainfo\fR(1), \fBld\fR(1), \fBpargs\fR(1), \fBattributes\fR(5)
+.sp
+.LP
+\fILinker and Libraries Guide\fR
+.sp
+.LP
+\fISPARC Assembly Language Reference Manual\fR
+.sp
+.LP
+\fIx86 Assembly Language Reference Manual\fR
diff --git a/usr/src/man/man2/getitimer.2 b/usr/src/man/man2/getitimer.2
new file mode 100644
index 0000000000..b21f0b8005
--- /dev/null
+++ b/usr/src/man/man2/getitimer.2
@@ -0,0 +1,197 @@
+'\" te
+.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
+.TH getitimer 2 "15 Jun 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+getitimer, setitimer \- get or set value of interval timer
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/time.h>
+
+\fBint\fR \fBgetitimer\fR(\fBint\fR \fIwhich\fR, \fBstruct itimerval *\fR\fIvalue\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetitimer\fR(\fBint\fR \fIwhich\fR, \fBconst struct itimerval *\fR\fIvalue\fR,
+ \fBstruct itimerval *\fR\fIovalue\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The system provides each process with four interval timers, defined in
+<\fBsys/time.h\fR>. The \fBgetitimer()\fR function stores the current value of
+the timer specified by \fIwhich\fR into the structure pointed to by
+\fIvalue\fR. The \fBsetitimer()\fR function call sets the value of the timer
+specified by \fIwhich\fR to the value specified in the structure pointed to by
+\fIvalue\fR, and if \fIovalue\fR is not \fINULL\fR, stores the previous value
+of the timer in the structure pointed to by \fIovalue\fR.
+.sp
+.LP
+A timer value is defined by the \fBitimerval\fR structure (see
+\fBgettimeofday\fR(3C)) for the definition of \fBtimeval\fR), which includes
+the following members:
+.sp
+.in +2
+.nf
+struct timeval it_interval; /* timer interval */
+struct timeval it_value; /* current value */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBit_value\fR member indicates the time to the next timer expiration. The
+\fBit_interval\fR member specifies a value to be used in reloading
+\fBit_value\fR when the timer expires. Setting \fBit_value\fR to 0 disables a
+timer, regardless of the value of \fBit_interval\fR. Setting \fBit_interval\fR
+to 0 disables a timer after its next expiration (assuming \fBit_value\fR is
+non-zero).
+.sp
+.LP
+Time values smaller than the resolution of the system clock are rounded up to
+the resolution of the system clock, except for \fBITIMER_REALPROF\fR, whose
+values are rounded up to the resolution of the profiling clock. The four timers
+are as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBITIMER_REAL\fR\fR
+.ad
+.RS 19n
+.rt
+Decrements in real time. A \fBSIGALRM\fR signal is delivered to the process
+when this timer expires.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBITIMER_VIRTUAL\fR\fR
+.ad
+.RS 19n
+.rt
+Decrements in lightweight process (lwp) virtual time. It runs only when the
+calling lwp is executing. A \fBSIGVTALRM\fR signal is delivered to the calling
+lwp when it expires.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBITIMER_PROF\fR\fR
+.ad
+.RS 19n
+.rt
+Decrements both in lightweight process (lwp) virtual time and when the system
+is running on behalf of the lwp. It is designed to be used by interpreters in
+statistically profiling the execution of interpreted programs. Each time the
+\fBITIMER_PROF\fR timer expires, the \fBSIGPROF\fR signal is delivered to the
+calling lwp. Because this signal may interrupt in-progress functions, programs
+using this timer must be prepared to restart interrupted functions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBITIMER_REALPROF\fR\fR
+.ad
+.RS 19n
+.rt
+Decrements in real time. It is designed to be used for real-time profiling of
+multithreaded programs. Each time the \fBITIMER_REALPROF\fR timer expires, one
+counter in a set of counters maintained by the system for each lightweight
+process (lwp) is incremented. The counter corresponds to the state of the lwp
+at the time of the timer tick. All lwps executing in user mode when the timer
+expires are interrupted into system mode. When each lwp resumes execution in
+user mode, if any of the elements in its set of counters are non-zero, the
+\fBSIGPROF\fR signal is delivered to the lwp. The \fBSIGPROF\fR signal is
+delivered before any other signal except \fBSIGKILL\fR. This signal does not
+interrupt any in-progress function. A \fBsiginfo\fR structure, defined in
+\fB<sys/siginfo.h>\fR, is associated with the delivery of the \fBSIGPROF\fR
+signal, and includes the following members:
+.sp
+.in +2
+.nf
+si_tstamp; /* high resolution timestamp */
+si_syscall; /* current syscall */
+si_nsysarg; /* number of syscall arguments */
+si_sysarg[\|]; /* actual syscall arguments */
+si_fault; /* last fault type */
+si_faddr; /* last fault address */
+si_mstate[\|]; /* ticks in each microstate */
+.fi
+.in -2
+
+The enumeration of microstates (indices into \fBsi_mstate\fR) is defined in
+\fB<sys/msacct.h>\fR.
+.sp
+Unlike the other interval timers, the \fBITIMER_REALPROF\fR interval timer is
+not inherited across a call to one of the \fBexec\fR(2) family of functions.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetitimer()\fR and \fBsetitimer()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The specified number of seconds is greater than 100,000,000, the number of
+microseconds is greater than or equal to 1,000,000, or the \fIwhich\fR argument
+is unrecognized.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBalarm\fR(2), \fBexec\fR(2), \fBgettimeofday\fR(3C), \fBsleep\fR(3C),
+\fBsysconf\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The \fBsetitimer()\fR function is independent of the \fBalarm\fR(2) and
+\fBsleep\fR(3C) functions.
+.sp
+.LP
+The \fBITIMER_PROF\fR and \fBITIMER_REALPROF\fR timers deliver the same signal
+and have different semantics. They cannot be used together.
+.sp
+.LP
+The granularity of the resolution of alarm time is platform-dependent.
diff --git a/usr/src/man/man2/getlabel.2 b/usr/src/man/man2/getlabel.2
new file mode 100644
index 0000000000..75436dd510
--- /dev/null
+++ b/usr/src/man/man2/getlabel.2
@@ -0,0 +1,200 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getlabel 2 "20 Jul 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+getlabel, fgetlabel \- get file sensitivity label
+.SH SYNOPSIS
+.LP
+.nf
+\fBcc\fR [\fIflags\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
+.fi
+
+.LP
+.nf
+#include <tsol/label.h>
+
+\fBint\fR \fBgetlabel\fR(\fBconst char *\fR\fIpath\fR, \fBm_label_t *\fR\fIlabel_p\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfgetlabel\fR(\fBint\fR \fIfd\fR, \fBm_label_t *\fR\fIlabel_p\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetlabel()\fR function obtains the sensitivity label of the file that is
+named by \fIpath\fR. Discretionary read, write or execute permission to the
+final component of \fIpath\fR is not required, but all directories in the path
+prefix of \fIpath\fR must be searchable.
+.sp
+.LP
+The \fBfgetlabel()\fR function obtains the label of an open file that is
+referred to by the argument descriptor, such as would be obtained by an
+\fBopen\fR(2) call.
+.sp
+.LP
+The \fIlabel_p\fR argument is a pointer to an opaque label structure. The
+caller must allocate space for \fIlabel_p\fR by using
+\fBm_label_alloc\fR(3TSOL).
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBgetlabel()\fR and \fBfgetlabel()\fR return 0.
+Otherwise they return \(mi1 and set \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetlabel()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix of \fIpath\fR.
+To override this restriction, the calling process can assert the
+\fBPRIV_FILE_DAC_SEARCH\fR privilege.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+\fIlabel_p\fR or \fIpath\fR points to an invalid address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An \fBI/O\fR error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the path argument exceeds \fIPATH_MAX\fR, or a pathname component
+is longer than \fINAME_MAX\fR while \fI_POSIX_NO_TRUNC\fR is in effect (see
+\fBpathconf\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The file referred to by \fIpath\fR does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIpath\fR is not a directory.
+.RE
+
+.sp
+.LP
+The \fBfgetlabel()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfd\fR argument is not a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIlabel_p\fR argument points to an invalid address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 10n
+.rt
+An \fBI/O\fR error occurred while reading from or writing to the file system.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBopen\fR(2), \fBpathconf\fR(2), \fBm_label_alloc\fR(3TSOL),
+\fBattributes\fR(5), \fBlabels\fR(5)
+.sp
+.LP
+\fIObtaining a File Label\fR in \fISolaris Trusted Extensions Developer\&'s
+Guide\fR
+.SH NOTES
+.sp
+.LP
+The functionality described on this manual page is available only if the system
+is configured with Trusted Extensions.
diff --git a/usr/src/man/man2/getmsg.2 b/usr/src/man/man2/getmsg.2
new file mode 100644
index 0000000000..110a14fe81
--- /dev/null
+++ b/usr/src/man/man2/getmsg.2
@@ -0,0 +1,256 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getmsg 2 "1 Nov 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+getmsg, getpmsg \- get next message off a stream
+.SH SYNOPSIS
+.LP
+.nf
+#include <stropts.h>
+
+\fBint\fR \fBgetmsg\fR(\fBint\fR \fIfildes\fR, \fBstruct strbuf *restrict\fR \fIctlptr\fR,
+ \fBstruct strbuf *restrict\fR \fIdataptr\fR, \fBint *restrict\fR \fIflagsp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBgetpmsg\fR(\fBint\fR \fIfildes\fR, \fBstruct strbuf *restrict\fR \fIctlptr\fR,
+ \fBstruct strbuf *restrict\fR \fIdataptr\fR, \fBint *restrict\fR \fIbandp\fR,
+ \fBint *restrict\fR \fIflagsp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetmsg()\fR function retrieves the contents of a message (see
+\fBIntro\fR(2)) located at the stream head read queue from a STREAMS file, and
+places the contents into user specified buffer(s). The message must contain
+either a data part, a control part, or both. The data and control parts of the
+message are placed into separate buffers, as described below. The semantics of
+each part is defined by the STREAMS module that generated the message.
+.sp
+.LP
+The \fBgetpmsg()\fR function behaved like \fBgetmsg()\fR, but provides finer
+control over the priority of the messages received. Except where noted, all
+information pertaining to \fBgetmsg()\fR also pertains to \fBgetpmsg()\fR.
+.sp
+.LP
+The \fIfildes\fR argument specifies a file descriptor referencing an open
+stream. The \fIctlptr\fR and \fIdataptr\fR arguments each point to a
+\fBstrbuf\fR structure, which contains the following members:
+.sp
+.in +2
+.nf
+int maxlen; /* maximum buffer length */
+int len; /* length of data */
+char *buf; /* ptr to buffer */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBbuf\fR member points to a buffer into which the data or control
+information is to be placed, and the \fBmaxlen\fR member indicates the maximum
+number of bytes this buffer can hold. On return, the \fBlen\fR member contains
+the number of bytes of data or control information actually received; 0 if
+there is a zero-length control or data part; or \(mi1 if no data or control
+information is present in the message. The \fIflagsp\fR argument should point
+to an integer that indicates the type of message the user is able to receive,
+as described below.
+.sp
+.LP
+The \fIctlptr\fR argument holds the control part from the message and the
+\fIdataptr\fR argument holds the data part from the message. If \fIctlptr\fR
+(or \fIdataptr\fR) is \fINULL\fR or the \fBmaxlen\fR member is \(mi1, the
+control (or data) part of the message is not processed and is left on the
+stream head read queue. If \fIctlptr\fR (or \fIdataptr\fR) is not \fINULL\fR
+and there is no corresponding control (or data) part of the messages on the
+stream head read queue, \fBlen\fR is set to \(mi1. If the \fBmaxlen\fR member
+is set to 0 and there is a zero-length control (or data) part, that
+zero-length part is removed from the read queue and \fBlen\fR is set to 0. If
+the \fBmaxlen\fR member is set to 0 and there are more than zero bytes of
+control (or data) information, that information is left on the read queue and
+\fBlen\fR is set to 0. If the \fBmaxlen\fR member in \fIctlptr\fR or
+\fIdataptr\fR is less than, respectively, the control or data part of the
+message, \fBmaxlen\fR bytes are retrieved. In this case, the remainder of the
+message is left on the stream head read queue and a non-zero return value is
+provided, as described below under \fBRETURN VALUES\fR.
+.sp
+.LP
+By default, \fBgetmsg()\fR processes the first available message on the stream
+head read queue. A user may, however, choose to retrieve only high priority
+messages by setting the integer pointed to by \fIflagsp\fR to \fBRS_HIPRI\fR.
+In this case, \fBgetmsg()\fR processes the next message only if it is a high
+priority message.
+.sp
+.LP
+If the integer pointed to by \fIflagsp\fR is 0, \fBgetmsg()\fR retrieves any
+message available on the stream head read queue. In this case, on return, the
+integer pointed to by \fIflagsp\fR will be set to \fBRS_HIPRI\fR if a high
+priority message was retrieved, or to 0 otherwise.
+.sp
+.LP
+For \fBgetpmsg()\fR, the \fIflagsp\fR argument points to a bitmask with the
+following mutually-exclusive flags defined: \fBMSG_HIPRI\fR, \fBMSG_BAND\fR,
+and \fBMSG_ANY\fR. Like \fBgetmsg()\fR, \fBgetpmsg()\fR processes the first
+available message on the stream head read queue. A user may choose to retrieve
+only high-priority messages by setting the integer pointed to by \fIflagsp\fR
+to \fBMSG_HIPRI\fR and the integer pointed to by \fIbandp\fR to 0. In this
+case, \fBgetpmsg()\fR will only process the next message if it is a
+high-priority message. In a similar manner, a user may choose to retrieve a
+message from a particular priority band by setting the integer pointed to by
+\fIflagsp\fR to \fBMSG_BAND\fR and the integer pointed to by \fIbandp\fR to the
+priority band of interest. In this case, \fBgetpmsg()\fR will only process the
+next message if it is in a priority band equal to, or greater than, the integer
+pointed to by \fIbandp\fR, or if it is a high-priority message. If a user just
+wants to get the first message off the queue, the integer pointed to by
+\fIflagsp\fR should be set to \fBMSG_ANY\fR and the integer pointed to by
+\fIbandp\fR should be set to 0. On return, if the message retrieved was a
+high-priority message, the integer pointed to by \fIflagsp\fR will be set to
+\fBMSG_HIPRI\fR and the integer pointed to by \fIbandp\fR will be set to 0.
+Otherwise, the integer pointed to by \fIflagsp\fR will be set to \fBMSG_BAND\fR
+and the integer pointed to by \fIbandp\fR will be set to the priority band of
+the message.
+.sp
+.LP
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear, \fBgetmsg()\fR blocks until a
+message of the type specified by \fIflagsp\fR is available on the stream head
+read queue. If \fBO_NDELAY\fR or \fBO_NONBLOCK\fR has been set and a message
+of the specified type is not present on the read queue, \fBgetmsg()\fR fails
+and sets \fBerrno\fR to \fBEAGAIN\fR.
+.sp
+.LP
+If a hangup occurs on the stream from which messages are to be retrieved,
+\fBgetmsg()\fR continues to operate normally, as described above, until the
+stream head read queue is empty. Thereafter, it returns 0 in the \fBlen\fR
+member of \fIctlptr\fR and \fIdataptr\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative value is returned. A return value of
+\fB0\fR indicates that a full message was read successfully. A return value of
+\fBMORECTL\fR indicates that more control information is waiting for retrieval.
+A return value of \fBMOREDATA\fR indicates that more data are waiting for
+retrieval. A return value of \fBMORECTL\fR | \fBMOREDATA\fR indicates that both
+types of information remain. Subsequent \fBgetmsg()\fR calls retrieve the
+remainder of the message. However, if a message of higher priority has been
+received by the stream head read queue, the next call to \fBgetmsg()\fR will
+retrieve that higher priority message before retrieving the remainder of the
+previously received partial message.
+.SH ERRORS
+.sp
+.LP
+The \fBgetmsg()\fR and \fBgetpmsg()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 11n
+.rt
+The \fBO_NDELAY\fR or \fBO_NONBLOCK\fR flag is set and no messages are
+available.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor open for reading.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADMSG\fR\fR
+.ad
+.RS 11n
+.rt
+Queued message to be read is not valid for \fBgetmsg\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIctlptr\fR, \fIdataptr\fR, \fIbandp\fR, or \fIflagsp\fR argument points
+to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during the execution of the \fBgetmsg\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+An illegal value was specified in \fIflagsp\fR, or the stream referenced by
+\fIfildes\fR is linked under a multiplexor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSTR\fR\fR
+.ad
+.RS 11n
+.rt
+A stream is not associated with \fIfildes\fR.
+.RE
+
+.sp
+.LP
+The \fBgetmsg()\fR function can also fail if a STREAMS error message had been
+received at the stream head before the call to \fBgetmsg()\fR. The error
+returned is the value contained in the STREAMS error message.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+\fBATTRIBUTE TYPE\fRATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBpoll\fR(2), \fBputmsg\fR(2), \fBread\fR(2), \fBwrite\fR(2),
+\fBattributes\fR(5), \fBstandards\fR(5)
+.sp
+.LP
+\fISTREAMS Programming Guide\fR
diff --git a/usr/src/man/man2/getpflags.2 b/usr/src/man/man2/getpflags.2
new file mode 100644
index 0000000000..dc1df505c4
--- /dev/null
+++ b/usr/src/man/man2/getpflags.2
@@ -0,0 +1,168 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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. 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. 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]
+.TH getpflags 2 "4 Jun 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+getpflags, setpflags \- get or set process flags
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <priv.h>
+
+\fBuint_t\fR \fBgetpflags\fR(\fBuint_t\fR \fIflag\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetpflags\fR(\fBuint_t\fR \fIflag\fR, \fBuint_t\fR \fIvalue\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetpflags()\fR and \fBsetpflags()\fR functions obtain and modify the
+current per-process flags.
+.sp
+.LP
+The following values for \fIflag\fR are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPRIV_AWARE\fR\fR
+.ad
+.sp .6
+.RS 4n
+This one bit flag takes the value of 0 (unset) or 1 (set). Only if this flag
+is set is the current process privilege-aware. A process can attempt to unset
+this flag but might fail silently if the observed set invariance condition
+cannot be met. Setting this flag is always successful. See \fBprivileges\fR(5)
+for a discussion of this flag.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPRIV_AWARE_RESET\fR\fR
+.ad
+.sp .6
+.RS 4n
+This one bit flag takes the value of 0 (unset) or 1 (set). This causes a
+process to pretend it is non- privilege aware. The effective and permitted
+privilege set change on the change of the effective uid. When all the uid sets
+become the same through \fBsetuid\fR(\fIuid\fR) or through
+\fBsetreuid\fR(\fIuid\fR, \fIuid\fR), the effective and permitted set are set
+to the intersection between the limit set and the inheritable set. At that
+point, both \fBPRIV_AWARE\fR and \fBPRIV_AWARE_RESET\fR are unset.
+.sp
+This flag gets automatically reset when a file becomes privilege aware, either
+through calling \fBsetppriv\fR(2) or by setting \fBPRIV_AWARE\fR to 1.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPRIV_DEBUG\fR\fR
+.ad
+.sp .6
+.RS 4n
+This one bit flag takes the value of 0 (unset) or 1 (set). Only if this flag
+is set does the current process have privilege debugging enabled. Processes can
+set and unset this flag at will.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBNET_MAC_AWARE\fR\fR
+.ad
+.br
+.na
+\fB\fBNET_MAC_AWARE_INHERIT\fR\fR
+.ad
+.sp .6
+.RS 4n
+These flags are available only if the system is configured with Trusted
+Extensions. These one bit flags each take the value of 0 (unset) or 1 (set). If
+the \fBNET_MAC_AWARE\fR flag is set then the current process is allowed to
+communicate with peers at labels that are different than its own, subject to
+MAC policy.
+.sp
+The \fBNET_MAC_AWARE_INHERIT\fR flag controls the propagation of the
+\fBNET_MAC_AWARE\fR flag. When a process performs one of the \fBexec\fR(2)
+functions, the \fBNET_MAC_AWARE\fR flag is unset unless the
+\fBNET_MAC_AWARE_INHERIT\fR is set. \fBNET_MAC_AWARE_INHERIT\fR is always unset
+on one of the \fBexec\fR functions. The \fBPRIV_NET_MAC_AWARE\fR privilege is
+required to set either of these flags.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+The \fBgetpflags()\fR returns the value associated with a given per-process
+flag. If the \fIflag\fR argument is invalid, (\fBuint_t\fR)-1 is returned and
+\fBerrno\fR is set to indicate the error.
+.sp
+.LP
+Upon successful completion, \fBsetpflags()\fR returns 0. Otherwise, -1 is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetpflags()\fR and \fBsetpflags()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIflag\fR or the value to which the \fIflag\fR is set is out of
+range.
+.RE
+
+.sp
+.LP
+The \fBsetpflags()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+An attempt was made to unset \fBPRIV_AWARE\fR but the observed set invariance
+condition was not met.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBppriv\fR(1), \fBsetppriv\fR(2), \fBattributes\fR(5), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/getpid.2 b/usr/src/man/man2/getpid.2
new file mode 100644
index 0000000000..35f91af4aa
--- /dev/null
+++ b/usr/src/man/man2/getpid.2
@@ -0,0 +1,136 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
+.\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
+.\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getpid 2 "27 Jan 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+getpid, getpgrp, getppid, getpgid \- get process, process group, and parent
+process IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBpid_t\fR \fBgetpid\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBpid_t\fR \fBgetpgrp\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBpid_t\fR \fBgetppid\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBpid_t\fR \fBgetpgid\fR(\fBpid_t\fR \fIpid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetpid()\fR function returns the process \fBID\fR of the calling
+process.
+.sp
+.LP
+The \fBgetpgrp()\fR function returns the process group \fBID\fR of the calling
+process.
+.sp
+.LP
+The \fBgetppid()\fR function returns the parent process \fBID\fR of the calling
+process.
+.sp
+.LP
+The \fBgetpgid()\fR function returns the process group \fBID\fR of the process
+whose process \fBID\fR is equal to \fIpid,\fR or the process group \fBID\fR of
+the calling process, if \fIpid\fR is equal to 0.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBgetpid()\fR, \fBgetpgrp()\fR, and \fBgetppid()\fR functions are always
+successful and no return value is reserved to indicate an error.
+.sp
+.LP
+Upon successful completion, \fBgetpgid()\fR returns the process group ID.
+Otherwise, \fBgetpgid()\fR returns \fB(pid_t)\(mi1\fR and sets \fBerrno\fR to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetpgid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The process whose process \fBID\fR is equal to \fIpid\fR is not in the same
+session as the calling process, and the implementation does not allow access to
+the process group \fBID\fR of that process from the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 9n
+.rt
+There is no process with a process \fBID\fR equal to \fIpid\fR.
+.RE
+
+.sp
+.LP
+The \fBgetpgid()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of the \fIpid\fR argument is invalid.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBgetsid\fR(2),
+\fBsetpgid\fR(2), \fBsetpgrp\fR(2), \fBsetsid\fR(2), \fBsignal\fR(3C),
+\fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/getppriv.2 b/usr/src/man/man2/getppriv.2
new file mode 100644
index 0000000000..b1622d2c7d
--- /dev/null
+++ b/usr/src/man/man2/getppriv.2
@@ -0,0 +1,156 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getppriv 2 "10 Sep 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+getppriv, setppriv \- get or set a privilege set
+.SH SYNOPSIS
+.LP
+.nf
+#include <priv.h>
+
+\fBint\fR \fBgetppriv\fR(\fBpriv_ptype_t\fR \fIwhich\fR, \fBpriv_set_t *\fR\fIset\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetppriv\fR(\fBpriv_op_t\fR \fIop\fR, \fBpriv_ptype_t\fR \fIwhich\fR, \fBpriv_set_t *\fR\fIset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetppriv()\fR function returns the process privilege set specified by
+\fIwhich\fR in the set pointed to by \fIset\fR. The memory for \fIset\fR is
+allocated with \fBpriv_allocset()\fR and freed with \fBpriv_freeset()\fR. Both
+functions are documented on the \fBpriv_addset\fR(3C) manual page.
+.sp
+.LP
+The \fBsetppriv()\fR function sets or changes the process privilege set. The
+\fIop\fR argument specifies the operation and can be one of \fBPRIV_OFF\fR,
+\fBPRIV_ON\fR or \fBPRIV_SET\fR. The \fIwhich\fR argument specifies the name of
+the privilege set. The \fIset\fR argument specifies the set.
+.sp
+.LP
+If \fIop\fR is \fBPRIV_OFF\fR, the privileges in \fIset\fR are removed from the
+process privilege set specified by \fIwhich\fR. There are no restrictions on
+removing privileges from process privileges sets, but the following apply:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Privileges removed from \fBPRIV_PERMITTED\fR are silently removed from
+\fBPRIV_EFFECTIVE\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If privileges are removed from \fBPRIV_LIMIT\fR, they are not removed from the
+other sets until one of \fBexec\fR(2) functions has successfully completed.
+.RE
+.sp
+.LP
+If \fIop\fR is \fBPRIV_ON\fR, the privileges in \fIset\fR are added to the
+process privilege set specified by \fIwhich\fR. The following operations are
+permitted:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Privileges in \fBPRIV_PERMITTED\fR can be added to \fBPRIV_EFFECTIVE\fR without
+restriction.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Privileges in \fBPRIV_PERMITTED\fR can be added to \fBPRIV_INHERITABLE\fR
+without restriction.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+All operations that attempt to add privileges that are already present are
+permitted.
+.RE
+.sp
+.LP
+If \fIop\fR is \fBPRIV_SET\fR, the privileges in \fIset\fR replace completely
+the process privilege set specified by \fIwhich\fR. \fBPRIV_SET\fR is
+implemented in terms of \fBPRIV_OFF\fR and \fBPRIV_ON\fR. The same restrictions
+apply.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, -1 is returned and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetppriv()\fR and \fBsetppriv()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIop\fR or \fIwhich\fR is out of range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIset\fR argument points to an illegal address.
+.RE
+
+.sp
+.LP
+The \fBsetppriv()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The application attempted to add privileges to \fBPRIV_LIMIT\fR or
+\fBPRIV_PERMITTED\fR, or the application attempted to add privileges to
+\fBPRIV_INHERITABLE\fR or \fBPRIV_EFFECTIVE\fR which were not in
+\fBPRIV_PERMITTED\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpriv_addset\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/getrlimit.2 b/usr/src/man/man2/getrlimit.2
new file mode 100644
index 0000000000..1d55e05651
--- /dev/null
+++ b/usr/src/man/man2/getrlimit.2
@@ -0,0 +1,336 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1994, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getrlimit 2 "21 Aug 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+getrlimit, setrlimit \- control maximum system resource consumption
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/resource.h>
+
+\fBint\fR \fBgetrlimit\fR(\fBint\fR \fIresource\fR, \fBstruct rlimit *\fR\fIrlp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetrlimit\fR(\fBint\fR \fIresource\fR, \fBconst struct rlimit *\fR\fIrlp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+Limits on the consumption of a variety of system resources by a process and
+each process it creates may be obtained with the \fBgetrlimit()\fR and set with
+\fBsetrlimit()\fR functions.
+.sp
+.LP
+Each call to either \fBgetrlimit()\fR or \fBsetrlimit()\fR identifies a
+specific resource to be operated upon as well as a resource limit. A resource
+limit is a pair of values: one specifying the current (soft) limit, the other
+a maximum (hard) limit. Soft limits may be changed by a process to any value
+that is less than or equal to the hard limit. A process may (irreversibly)
+lower its hard limit to any value that is greater than or equal to the soft
+limit. Only a process with {\fBPRIV_SYS_RESOURCE\fR} asserted in the effective
+set can raise a hard limit. Both hard and soft limits can be changed in a
+single call to \fBsetrlimit()\fR subject to the constraints described above.
+Limits may have an "infinite" value of \fBRLIM_INFINITY\fR. The \fIrlp\fR
+argument is a pointer to \fBstruct\fR \fBrlimit\fR that includes the following
+members:
+.sp
+.in +2
+.nf
+rlim_t rlim_cur; /* current (soft) limit */
+rlim_t rlim_max; /* hard limit */
+.fi
+.in -2
+
+.sp
+.LP
+The type \fBrlim_t\fR is an arithmetic data type to which objects of type
+\fBint\fR, \fBsize_t\fR, and \fBoff_t\fR can be cast without loss of
+information.
+.sp
+.LP
+The possible resources, their descriptions, and the actions taken when the
+current limit is exceeded are summarized as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_CORE\fR\fR
+.ad
+.RS 17n
+.rt
+The maximum size of a core file in bytes that may be created by a process. A
+limit of \fB0\fR will prevent the creation of a core file. The writing of a
+core file will terminate at this size.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_CPU\fR\fR
+.ad
+.RS 17n
+.rt
+The maximum amount of CPU time in seconds used by a process. This is a soft
+limit only. The \fBSIGXCPU\fR signal is sent to the process. If the process is
+holding or ignoring \fBSIGXCPU\fR, the behavior is scheduling class defined.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_DATA\fR\fR
+.ad
+.RS 17n
+.rt
+The maximum size of a process's heap in bytes. The \fBbrk\fR(2) function will
+fail with \fBerrno\fR set to \fBENOMEM\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_FSIZE\fR\fR
+.ad
+.RS 17n
+.rt
+The maximum size of a file in bytes that may be created by a process. A limit
+of \fB0\fR will prevent the creation of a file. The \fBSIGXFSZ\fR signal is
+sent to the process. If the process is holding or ignoring \fBSIGXFSZ\fR,
+continued attempts to increase the size of a file beyond the limit will fail
+with \fBerrno\fR set to \fBEFBIG\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_NOFILE\fR\fR
+.ad
+.RS 17n
+.rt
+One more than the maximum value that the system may assign to a newly created
+descriptor. This limit constrains the number of file descriptors that a process
+may create.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_STACK\fR\fR
+.ad
+.RS 17n
+.rt
+The maximum size of a process's stack in bytes. The system will not
+automatically grow the stack beyond this limit.
+.sp
+Within a process, \fBsetrlimit()\fR will increase the limit on the size of your
+stack, but will not move current memory segments to allow for that growth. To
+guarantee that the process stack can grow to the limit, the limit must be
+altered prior to the execution of the process in which the new stack size is to
+be used.
+.sp
+Within a multithreaded process, \fBsetrlimit()\fR has no impact on the stack
+size limit for the calling thread if the calling thread is not the main thread.
+A call to \fBsetrlimit()\fR for \fBRLIMIT_STACK\fR impacts only the main
+thread's stack, and should be made only from the main thread, if at all.
+.sp
+The \fBSIGSEGV\fR signal is sent to the process. If the process is holding or
+ignoring \fBSIGSEGV\fR, or is catching \fBSIGSEGV\fR and has not made
+arrangements to use an alternate stack (see \fBsigaltstack\fR(2)), the
+disposition of \fBSIGSEGV\fR will be set to \fBSIG_DFL\fR before it is sent.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_VMEM\fR\fR
+.ad
+.RS 17n
+.rt
+The maximum size of a process's mapped address space in bytes. If this limit
+is exceeded, the \fBbrk\fR(2) and \fBmmap\fR(2) functions will fail with
+\fBerrno\fR set to \fBENOMEM\fR. In addition, the automatic stack growth will
+fail with the effects outlined above.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRLIMIT_AS\fR\fR
+.ad
+.RS 17n
+.rt
+This is the maximum size of a process's total available memory, in bytes. If
+this limit is exceeded, the \fBbrk\fR(2), \fBmalloc\fR(3C), \fBmmap\fR(2) and
+\fBsbrk\fR(2) functions will fail with \fBerrno\fR set to \fBENOMEM\fR. In
+addition, the automatic stack growth will fail with the effects outlined above.
+.RE
+
+.sp
+.LP
+Because limit information is stored in the per-process information, the shell
+builtin \fBulimit\fR command must directly execute this system call if it is to
+affect all future processes created by the shell.
+.sp
+.LP
+The value of the current limit of the following resources affect these
+implementation defined parameters:
+.sp
+
+.sp
+.TS
+tab();
+cw(2.75i) cw(2.75i)
+lw(2.75i) lw(2.75i)
+.
+LimitImplementation Defined Constant
+\fBRLIMIT_FSIZE\fR\fBFCHR_MAX\fR
+\fBRLIMIT_NOFILE\fR\fBOPEN_MAX\fR
+.TE
+
+.sp
+.LP
+When using the \fBgetrlimit()\fR function, if a resource limit can be
+represented correctly in an object of type \fBrlim_t\fR, then its
+representation is returned; otherwise, if the value of the resource limit is
+equal to that of the corresponding saved hard limit, the value returned is
+\fBRLIM_SAVED_MAX\fR; otherwise the value returned is \fBRLIM_SAVED_CUR\fR.
+.sp
+.LP
+When using the \fBsetrlimit()\fR function, if the requested new limit is
+\fBRLIM_INFINITY\fR, the new limit will be "no limit"; otherwise if the
+requested new limit is \fBRLIM_SAVED_MAX\fR, the new limit will be the
+corresponding saved hard limit; otherwise, if the requested new limit is
+\fBRLIM_SAVED_CUR\fR, the new limit will be the corresponding saved soft limit;
+otherwise, the new limit will be the requested value. In addition, if the
+corresponding saved limit can be represented correctly in an object of type
+\fBrlim_t\fR, then it will be overwritten with the new limit.
+.sp
+.LP
+The result of setting a limit to \fBRLIM_SAVED_MAX\fR or \fBRLIM_SAVED_CUR\fR
+is unspecified unless a previous call to \fBgetrlimit()\fR returned that value
+as the soft or hard limit for the corresponding resource limit.
+.sp
+.LP
+A limit whose value is greater than \fBRLIM_INFINITY\fR is permitted.
+.sp
+.LP
+The \fBexec\fR family of functions also cause resource limits to be saved. See
+\fBexec\fR(2).
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBgetrlimit()\fR and \fBsetrlimit()\fR return
+\fB0\fR. Otherwise, these functions return \fB\(mi1\fR and set \fBerrno\fR to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetrlimit()\fR and \fBsetrlimit()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIrlp\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+An invalid \fIresource\fR was specified; or in a \fBsetrlimit()\fR call, the
+new \fBrlim_cur\fR exceeds the new \fBrlim_max\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The limit specified to \fBsetrlimit()\fR would have raised the maximum limit
+value and {\fBPRIV_SYS_RESOURCE\fR} is not asserted in the effective set of the
+current process.
+.RE
+
+.sp
+.LP
+The \fBsetrlimit()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The limit specified cannot be lowered because current usage is already higher
+than the limit.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBgetrlimit()\fR and \fBsetrlimit()\fR functions have transitional
+interfaces for 64-bit file offsets. See \fBlf64\fR(5).
+.sp
+.LP
+The rlimit functionality is now provided by the more general resource control
+facility described on the \fBsetrctl\fR(2) manual page. The actions associated
+with the resource limits described above are true at system boot, but an
+administrator can modify the local configuration to modify signal delivery or
+type. Application authors that utilize rlimits for the purposes of resource
+awareness should investigate the resource controls facility.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+\fBATTRIBUTE TYPE\fRATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBrctladm\fR(1M), \fBbrk\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBopen\fR(2),
+\fBsetrctl\fR(2), \fBsigaltstack\fR(2), \fBulimit\fR(2),
+\fBgetdtablesize\fR(3C), \fBmalloc\fR(3C), \fBsignal\fR(3C),
+\fBsignal.h\fR(3HEAD), \fBsysconf\fR(3C), \fBattributes\fR(5), \fBlf64\fR(5),
+\fBprivileges\fR(5), \fBresource_controls\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/getsid.2 b/usr/src/man/man2/getsid.2
new file mode 100644
index 0000000000..bf2851d2ed
--- /dev/null
+++ b/usr/src/man/man2/getsid.2
@@ -0,0 +1,82 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getsid 2 "22 Jan 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+getsid \- get process group ID of session leader
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBpid_t\fR \fBgetsid\fR(\fBpid_t\fR \fIpid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetsid()\fR function obtains the process group \fBID\fR of the process
+that is the session leader of the process specified by \fIpid\fR. If \fIpid\fR
+is \fB(pid_t)\|0\fR, it specifies the calling process.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBgetsid()\fR returns the process group \fBID\fR
+of the session leader of the specified process. Otherwise, it returns
+\fB(pid_t)\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBgetsid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The process specified by \fIpid\fR is not in the same session as the calling
+process, and the implementation does not allow access to the process group
+\fBID\fR of the session leader of that process from the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 9n
+.rt
+There is no process with a process \fBID\fR equal to \fIpid\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+\fBATTRIBUTE TYPE\fRATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBfork\fR(2), \fBgetpid\fR(2), \fBgetpgid\fR(2),
+\fBsetpgid\fR(2), \fBsetsid\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/getuid.2 b/usr/src/man/man2/getuid.2
new file mode 100644
index 0000000000..4a61a6de0d
--- /dev/null
+++ b/usr/src/man/man2/getuid.2
@@ -0,0 +1,76 @@
+'\" te
+.\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getuid 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+getuid, geteuid, getgid, getegid \- get real user, effective user, real group,
+and effective group IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBuid_t\fR \fBgetuid\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBuid_t\fR \fBgeteuid\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBgid_t\fR \fBgetgid\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+\fBgid_t\fR \fBgetegid\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetuid()\fR function returns the real user \fBID\fR of the calling
+process. The real user \fBID\fR identifies the person who is logged in.
+.sp
+.LP
+The \fBgeteuid()\fR function returns the effective user \fBID\fR of the calling
+process. The effective user \fBID\fR gives the process various permissions
+during execution of "set-user-ID" mode processes which use \fBgetuid()\fR to
+determine the real user \fBID\fR of the process that invoked them.
+.sp
+.LP
+The \fBgetgid()\fR function returns the real group \fBID\fR of the calling
+process.
+.sp
+.LP
+The \fBgetegid()\fR function returns the effective group \fBID\fR of the
+calling process.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBsetuid\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/getustack.2 b/usr/src/man/man2/getustack.2
new file mode 100644
index 0000000000..2fe573beed
--- /dev/null
+++ b/usr/src/man/man2/getustack.2
@@ -0,0 +1,84 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH getustack 2 "2 Nov 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+getustack, setustack \- retrieve or change the address of per-LWP stack
+boundary information
+.SH SYNOPSIS
+.LP
+.nf
+#include <ucontext.h>
+
+\fBint\fR \fBgetustack\fR(\fBstack_t **\fR\fIspp\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetustack\fR(\fBstack_t *\fR\fIsp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBgetustack()\fR function retrieves the address of per-LWP stack boundary
+information. The address is stored at the location pointed to by \fIspp\fR. If
+this address has not been defined using a previous call to \fBsetustack()\fR,
+\fINULL\fR is stored at the location pointed to by \fIspp\fR.
+.sp
+.LP
+The \fBsetustack()\fR function changes the address of the current thread's
+stack boundary information to the value of \fIsp\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, these functions return 0. Otherwise, \(mi1 is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+These functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIspp\fR or \fIsp\fR argument does not refer to a valid address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Only implementors of custom threading libraries should use these functions to
+get and set the address of the stack bound to an internal per-thread data
+structure. Other users should use \fBstack_getbounds\fR(3C) and
+\fBstack_setbounds\fR(3C).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(5.5i) |cw(0i)
+lw(5.5i) |lw(0i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fB_stack_grow\fR(3C), \fBstack_getbounds\fR(3C), \fBstack_inbounds\fR(3C),
+\fBstack_setbounds\fR(3C), \fBstack_violation\fR(3C), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/ioctl.2 b/usr/src/man/man2/ioctl.2
new file mode 100644
index 0000000000..f3a0e86e09
--- /dev/null
+++ b/usr/src/man/man2/ioctl.2
@@ -0,0 +1,204 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH ioctl 2 "15 Feb 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+ioctl \- control device
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+#include <stropts.h>
+
+\fBint\fR \fBioctl\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIrequest\fR, \fB/*\fR \fIarg\fR */ ...);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBioctl()\fR function performs a variety of control functions on devices
+and streams. For non-streams files, the functions performed by this call are
+device-specific control functions. The \fIrequest\fR argument and an optional
+third argument with varying type are passed to the file designated by
+\fIfildes\fR and are interpreted by the device driver.
+.sp
+.LP
+For streams files, specific functions are performed by the \fBioctl()\fR
+function as described in \fBstreamio\fR(7I).
+.sp
+.LP
+The \fIfildes\fR argument is an open file descriptor that refers to a device.
+The \fIrequest\fR argument selects the control function to be performed and
+depends on the device being addressed. The \fIarg\fR argument represents a
+third argument that has additional information that is needed by this specific
+device to perform the requested function. The data type of \fIarg\fR depends
+upon the particular control request, but it is either an \fBint\fR or a pointer
+to a device-specific data structure.
+.sp
+.LP
+In addition to device-specific and streams functions, generic functions are
+provided by more than one device driver (for example, the general terminal
+interface.) See \fBtermio\fR(7I)).
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the value returned depends upon the device control
+function, but must be a non-negative integer. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBioctl()\fR function will fail for any type of file if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is not a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+A signal was caught during the execution of the \fBioctl()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The stream or multiplexer referenced by \fIfildes\fR is linked (directly or
+indirectly) downstream from a multiplexer.
+.RE
+
+.sp
+.LP
+The \fBioctl()\fR function will also fail if the device driver detects an
+error. In this case, the error is passed through \fBioctl()\fR without change
+to the caller. A particular driver might not have all of the following error
+cases. Under the following conditions, requests to device drivers may fail and
+set \fBerrno\fR to indicate the error
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIrequest\fR argument requires a data transfer to or from a buffer pointed
+to by \fIarg\fR, but \fIarg\fR points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIrequest\fR or \fIarg\fR argument is not valid for this device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 11n
+.rt
+Some physical I/O error has occurred.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is on a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTTY\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not associated with a streams device that accepts
+control functions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIrequest\fR and \fIarg\fR arguments are valid for this device driver, but
+the service requested can not be performed on this particular subdevice.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENODEV\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument refers to a valid streams device, but the
+corresponding device driver does not support the \fBioctl()\fR function.
+.RE
+
+.sp
+.LP
+Streams errors are described in \fBstreamio\fR(7I).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBattributes\fR(5), \fBstandards\fR(5), \fBstreamio\fR(7I), \fBtermio\fR(7I)
diff --git a/usr/src/man/man2/issetugid.2 b/usr/src/man/man2/issetugid.2
new file mode 100644
index 0000000000..e06f632de5
--- /dev/null
+++ b/usr/src/man/man2/issetugid.2
@@ -0,0 +1,85 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH issetugid 2 "19 Feb 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+issetugid \- determine if current executable is running setuid or setgid
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBissetugid\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBissetugid()\fR function enables library functions (in \fBlibtermlib\fR,
+\fBlibc\fR, or other libraries) to guarantee safe behavior when used in
+\fBsetuid\fR or \fBsetgid\fR programs or programs that run with more privileges
+after a succesful \fBexec\fR(2). Some library functions might be passed
+insufficient information and not know whether the current program was started
+\fBsetuid\fR or \fBsetgid\fR because a higher level calling code might have
+made changes to the \fBuid\fR, \fBeuid\fR, \fBgid\fR, or \fBegid\fR. These
+low-level library functions are therefore unable to determine if they are being
+run with elevated or normal privileges.
+.sp
+.LP
+The \fBissetugid()\fR function should be used to determine if a path name
+returned from a \fBgetenv\fR(3C) call can be used safely to open the specified
+file. It is often not safe to open such a file because the status of the
+effective \fBuid\fR is not known.
+.sp
+.LP
+The result of a call to \fBissetugid()\fR is unaffected by calls to
+\fBsetuid()\fR, \fBsetgid()\fR, or other such calls. In case of a call to
+\fBfork\fR(2), the child process inherits the same status.
+.sp
+.LP
+The status of \fBissetugid()\fR is affected only by \fBexecve()\fR (see
+\fBexec\fR(2)). If a child process executes a new executable file, a new
+\fBissetugid()\fR status will be based on the existing process's \fBuid\fR,
+\fBeuid\fR, \fBgid\fR, and \fBegid\fR permissions and on the modes of the
+executable file. If the new executable file modes are \fBsetuid\fR or
+\fBsetgid\fR, or if the existing process is executing the new image with
+\fBuid\fR != \fBeuid\fR or \fBgid\fR != \fBegid\fR, or if the permitted set
+before the call to the \fBexec\fR function is not a superset of the inheritable
+set at that time, \fBissetugid()\fR returns 1 in the new process.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBissetugid()\fR function returns 1 if the process was made \fBsetuid\fR
+or \fBsetgid\fR as the result of the last or a previous call to \fBexecve()\fR.
+Otherwise it returns 0.
+.SH ERRORS
+.sp
+.LP
+The \fBissetugid()\fR function is always successful. No return value is
+reserved to indicate an error.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBfork\fR(2), \fBsetuid\fR(2), \fBgetenv\fR(3C),
+\fBattributes\fR(5), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/kill.2 b/usr/src/man/man2/kill.2
new file mode 100644
index 0000000000..6f15904f49
--- /dev/null
+++ b/usr/src/man/man2/kill.2
@@ -0,0 +1,145 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH kill 2 "22 Mar 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+kill \- send a signal to a process or a group of processes
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <signal.h>
+
+\fBint\fR \fBkill\fR(\fBpid_t\fR \fIpid\fR, \fBint\fR \fIsig\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBkill()\fR function sends a signal to a process or a group of processes.
+The process or group of processes to which the signal is to be sent is
+specified by \fIpid\fR. The signal that is to be sent is specified by \fIsig\fR
+and is either one from the list given in \fBsignal\fR (see
+\fBsignal.h\fR(3HEAD)), or 0. If \fIsig\fR is 0 (the null signal), error
+checking is performed but no signal is actually sent. This can be used to check
+the validity of \fIpid\fR.
+.sp
+.LP
+The real or effective user ID of the sending process must match the real or
+saved (from one of functions in the \fBexec\fR(2) family) user ID of the
+receiving process, unless the privilege {\fBPRIV_PROC_OWNER\fR} is asserted in
+the effective set of the sending process (see \fBIntro\fR(2)), or \fIsig\fR is
+\fBSIGCONT\fR and the sending process has the same session \fBID\fR as the
+receiving process. A process needs the basic privilege
+{\fBPRIV_PROC_SESSION\fR} to send signals to a process with a different session
+ID. See \fBprivileges\fR(5).
+.sp
+.LP
+If \fIpid\fR is greater than 0, \fIsig\fR will be sent to the process whose
+process ID is equal to \fIpid\fR.
+.sp
+.LP
+If \fIpid\fR is negative but not \fB(pid_t)\(mi1\fR, \fIsig\fR will be sent to
+all processes whose process group ID is equal to the absolute value of
+\fIpid\fR and for which the process has permission to send a signal.
+.sp
+.LP
+If \fIpid\fR is 0, \fIsig\fR will be sent to all processes excluding special
+processes (see \fBIntro\fR(2)) whose process group ID is equal to the process
+group ID of the sender.
+.sp
+.LP
+If \fIpid\fR is \fB(pid_t)\(mi1\fR and the {\fBPRIV_PROC_OWNER\fR} privilege is
+not asserted in the effective set of the sending process, \fIsig\fR will be
+sent to all processes excluding special processes whose real user ID is equal
+to the effective user \fBID\fR of the sender.
+.sp
+.LP
+If \fIpid\fR is \fB(pid_t)\(mi1\fR and the {\fBPRIV_PROC_OWNER\fR} privilege is
+asserted in the effective set of the sending process, \fIsig\fR will be sent to
+all processes excluding special processes.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned, no
+signal is sent, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBkill()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsig\fR argument is not a valid signal number.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsig\fR argument is \fBSIGKILL\fR and the \fIpid\fR argument is
+\fB(pid_t)-1\fR (that is, the calling process does not have permission to send
+the signal to any of the processes specified by \fIpid\fR).
+.sp
+The effective user of the calling process does not match the real or saved user
+and the calling process does not have the {\fBPRIV_PROC_OWNER\fR} privilege
+asserted in the effective set, and the calling process either is not sending
+\fBSIGCONT\fR to a process that shares the same session \fBID\fR or does not
+have the {\fBPRIV_PROC_SESSION\fR} privilege asserted and is trying to send a
+signal to a process with a different session ID.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+No process or process group can be found corresponding to that specified by
+\fIpid\fR.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBsigsend\fR(2) function provides a more versatile way to send signals to
+processes.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBkill\fR(1), \fBIntro\fR(2), \fBexec\fR(2), \fBgetpid\fR(2), \fBgetsid\fR(2),
+\fBsetpgrp\fR(2), \fBsigaction\fR(2), \fBsigsend\fR(2), \fBsignal\fR(3C),
+\fBsignal.h\fR(3HEAD), \fBattributes\fR(5), \fBprivileges\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/link.2 b/usr/src/man/man2/link.2
new file mode 100644
index 0000000000..bb2491913e
--- /dev/null
+++ b/usr/src/man/man2/link.2
@@ -0,0 +1,260 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH link 2 "18 May 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+link \- link to a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBlink\fR(\fBconst char *\fR\fIexisting\fR, \fBconst char *\fR\fInew\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBlink()\fR function creates a new link (directory entry) for the existing
+file and increments its link count by one. The \fIexisting\fR argument points
+to a path name naming an existing file. The \fInew\fR argument points to a
+pathname naming the new directory entry to be created.
+.sp
+.LP
+To create hard links, both files must be on the same file system. Both the old
+and the new link share equal access and rights to the underlying object.
+Privileged processes can make multiple links to a directory. Unless the caller
+is privileged, the file named by \fIexisting\fR must not be a directory.
+.sp
+.LP
+Upon successful completion, \fBlink()\fR marks for update the \fBst_ctime\fR
+field of the file. Also, the \fBst_ctime\fR and \fBst_mtime\fR fields of the
+directory that contains the new entry are marked for update.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, no link is created, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBlink()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+A component of either path prefix denies search permission, or the requested
+link requires writing in a directory with a mode that denies write permission.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 16n
+.rt
+The directory where the entry for the new link is being placed cannot be
+extended because the user's quota of disk blocks on that file system has been
+exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The link named by \fInew\fR exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIexisting\fR or \fInew\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The path argument includes non-UTF8 characters and the file system accepts only
+file names where all characters are part of the UTF-8 character codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBlink()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The maximum number of links to a file would be exceeded.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIexisting\fR or \fInew\fR argument exceeds \fBPATH_MAX\fR,
+or the length of a \fIexisting\fR or \fInew\fR component exceeds \fBNAME_MAX\fR
+while \fB_POSIX_NO_TRUNC\fR is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIexisting\fR or \fInew\fR argument is a null pathname; a component of
+either path prefix does not exist; or the file named by \fIexisting\fR does not
+exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIexisting\fR or \fInew\fR argument points to a remote machine and the
+link to that machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+The directory that would contain the link cannot be extended.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of either path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The file named by \fIexisting\fR is a directory and the
+{\fBPRIV_SYS_LINKDIR\fR} privilege is not asserted in the effective set of the
+calling process.
+.sp
+The effective user ID does not match the owner of the file and the
+{\fBPRIV_FILE_LINK_ANY\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The requested link requires writing in a directory on a read-only file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEXDEV\fR\fR
+.ad
+.RS 16n
+.rt
+The link named by \fInew\fR and the file named by \fIexisting\fR are on
+different logical devices (file systems).
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsymlink\fR(2), \fBunlink\fR(2), \fBattributes\fR(5), \fBprivileges\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/llseek.2 b/usr/src/man/man2/llseek.2
new file mode 100644
index 0000000000..f1f30652ca
--- /dev/null
+++ b/usr/src/man/man2/llseek.2
@@ -0,0 +1,146 @@
+'\" te
+.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH llseek 2 "1 Apr 2005" "SunOS 5.11" "System Calls"
+.SH NAME
+llseek \- move extended read/write file pointer
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBoffset_t\fR \fBllseek\fR(\fBint\fR \fIfildes\fR, \fBoffset_t\fR \fIoffset\fR, \fBint\fR \fIwhence\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBllseek()\fR function sets the 64-bit extended file pointer associated
+with the open file descriptor specified by \fIfildes\fR as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_SET\fR, the pointer is set to \fIoffset\fR bytes.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_CUR\fR, the pointer is set to its current location
+plus \fIoffset\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_END\fR, the pointer is set to the size of the file
+plus \fIoffset\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_HOLE\fR, the offset of the start of the next hole
+greater than or equal to the supplied offset is returned. The definition of a
+hole immediately follows this list.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_DATA\fR, the file pointer is set to the start of the
+next non-hole file region greater than or equal to the supplied offset.
+.RE
+.sp
+.LP
+A "hole" is defined as a contiguous range of bytes in a file, all having the
+value of zero, but not all zeros in a file are guaranteed to be represented as
+holes returned with \fBSEEK_HOLE\fR. Filesystems are allowed to expose ranges
+of zeros with \fBSEEK_HOLE\fR, but not required to. Applications can use
+\fBSEEK_HOLE\fR to optimise their behavior for ranges of zeros, but must not
+depend on it to find all such ranges in a file. The existence of a hole at the
+end of every data region allows for easy programming and implies that a virtual
+hole exists at the end of the file.
+.sp
+.LP
+For filesystems that do not supply information about holes, the file will be
+represented as one entire data region.
+.sp
+.LP
+Although each file has a 64-bit file pointer associated with it, some existing
+file system types (such as \fBtmpfs\fR) do not support the full range of 64-bit
+offsets. In particular, on such file systems, non-device files remain limited
+to offsets of less than two gigabytes. Device drivers may support offsets of
+up to 1024 gigabytes for device special files.
+.sp
+.LP
+Some devices are incapable of seeking. The value of the file pointer associated
+with such a device is undefined.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBllseek()\fR returns the resulting pointer
+location as measured in bytes from the beginning of the file. Remote file
+descriptors are the only ones that allow negative file pointers. Otherwise,
+\fB\(mi1\fR is returned, the file pointer remains unchanged, and \fBerrno\fR is
+set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBllseek()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is not an open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIwhence\fR argument is not \fBSEEK_SET\fR, \fBSEEK_CUR\fR, or
+\fBSEEK_END\fR; the \fIoffset\fR argument is not a valid offset for this file
+system type; or the \fIfildes\fR argument is not a remote file descriptor and
+the resulting file pointer would be negative.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 10n
+.rt
+For \fBSEEK_DATA\fR, there are no more data regions past the supplied offset.
+For \fBSEEK_HOLE\fR, there are no more holes past the supplied offset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESPIPE\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is associated with a pipe or FIFO.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2), \fBlseek\fR(2), \fBopen\fR(2)
diff --git a/usr/src/man/man2/lseek.2 b/usr/src/man/man2/lseek.2
new file mode 100644
index 0000000000..0f8dedf809
--- /dev/null
+++ b/usr/src/man/man2/lseek.2
@@ -0,0 +1,204 @@
+'\" te
+.\" Copyright 1989, AT&.T. Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH lseek 2 "4 May 2005" "SunOS 5.11" "System Calls"
+.SH NAME
+lseek \- move read/write file pointer
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBoff_t\fR \fBlseek\fR(\fBint\fR \fIfildes\fR, \fBoff_t\fR \fIoffset\fR, \fBint\fR \fIwhence\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBlseek()\fR function sets the file pointer associated with the open file
+descriptor specified by \fIfildes\fR as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_SET\fR, the pointer is set to \fIoffset\fR bytes.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_CUR\fR, the pointer is set to its current location
+plus \fIoffset\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_END\fR, the pointer is set to the size of the file
+plus \fIoffset\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_HOLE\fR, the offset of the start of the next hole
+greater than or equal to the supplied offset is returned. The definition of a
+hole is provided near the end of the DESCRIPTION.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIwhence\fR is \fBSEEK_DATA\fR, the file pointer is set to the start of the
+next non-hole file region greater than or equal to the supplied offset.
+.RE
+.sp
+.LP
+The symbolic constants \fBSEEK_SET\fR, \fBSEEK_CUR\fR, \fBSEEK_END\fR,
+\fBSEEK_HOLE\fR, and \fBSEEK_DATA\fR are defined in the header
+<\fBunistd.h\fR>.
+.sp
+.LP
+Some devices are incapable of seeking. The value of the file pointer associated
+with such a device is undefined.
+.sp
+.LP
+The \fBlseek()\fR function allows the file pointer to be set beyond the
+existing data in the file. If data are later written at this point, subsequent
+reads in the gap between the previous end of data and the newly written data
+will return bytes of value 0 until data are written into the gap.
+.sp
+.LP
+If \fIfildes\fR is a remote file descriptor and \fIoffset\fR is negative,
+\fBlseek()\fR returns the file pointer even if it is negative. The
+\fBlseek()\fR function will not, by itself, extend the size of a file.
+.sp
+.LP
+If \fIfildes\fR refers to a shared memory object, \fBlseek()\fR behaves as if
+\fIfildes\fR referred to a regular file.
+.sp
+.LP
+A "hole" is defined as a contiguous range of bytes in a file, all having the
+value of zero, but not all zeros in a file are guaranteed to be represented as
+holes returned with \fBSEEK_HOLE\fR. Filesystems are allowed to expose ranges
+of zeros with \fBSEEK_HOLE\fR, but not required to. Applications can use
+\fBSEEK_HOLE\fR to optimise their behavior for ranges of zeros, but must not
+depend on it to find all such ranges in a file. The existence of a hole at the
+end of every data region allows for easy programming and implies that a virtual
+hole exists at the end of the file. Applications should use
+\fBfpathconf\fR(\fB_PC_MIN_HOLE_SIZE\fR) or
+\fBpathconf\fR(\fB_PC_MIN_HOLE_SIZE\fR) to determine if a filesystem supports
+\fBSEEK_HOLE\fR. See \fBfpathconf\fR(2).
+.sp
+.LP
+For filesystems that do not supply information about holes, the file will be
+represented as one entire data region.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the resulting offset, as measured in bytes from the
+beginning of the file, is returned. Otherwise, \fB(off_t)\(mi1\fR is returned,
+the file offset remains unchanged, and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBlseek()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument is not an open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIwhence\fR argument is not \fBSEEK_SET\fR, \fBSEEK_CUR\fR, or
+\fBSEEK_END\fR; or the \fIfildes\fR argument is not a remote file descriptor
+and the resulting file pointer would be negative.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 13n
+.rt
+For \fBSEEK_DATA\fR, there are no more data regions past the supplied offset.
+For \fBSEEK_HOLE\fR, there are no more holes past the supplied offset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The resulting file offset would be a value which cannot be represented
+correctly in an object of type \fBoff_t\fR for regular files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESPIPE\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument is associated with a pipe, a FIFO, or a socket.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBlseek()\fR function has a transitional interface for 64-bit file
+offsets. See \fBlf64\fR(5).
+.sp
+.LP
+In multithreaded applications, using \fBlseek()\fR in conjunction with a
+\fBread\fR(2) or \fBwrite\fR(2) call on a file descriptor shared by more than
+one thread is not an atomic operation. To ensure atomicity, use \fBpread()\fR
+or \fBpwrite()\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2), \fBfpathconf\fR(2),
+\fBopen\fR(2), \fBread\fR(2), \fBwrite\fR(2), \fBattributes\fR(5),
+\fBlf64\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/memcntl.2 b/usr/src/man/man2/memcntl.2
new file mode 100644
index 0000000000..12b05bd873
--- /dev/null
+++ b/usr/src/man/man2/memcntl.2
@@ -0,0 +1,473 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH memcntl 2 "10 Apr 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+memcntl \- memory management control
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/mman.h>
+
+\fBint\fR \fBmemcntl\fR(\fBcaddr_t\fR \fIaddr\fR, \fBsize_t\fR \fIlen\fR, \fBint\fR \fIcmd\fR, \fBcaddr_t\fR \fIarg\fR,
+ \fBint\fR \fIattr\fR, \fBint\fR \fImask\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmemcntl()\fR function allows the calling process to apply a variety of
+control operations over the address space identified by the mappings
+established for the address range [\fIaddr\fR, \fIaddr\fR + \fIlen\fR).
+.sp
+.LP
+The \fIaddr\fR argument must be a multiple of the pagesize as returned by
+\fBsysconf\fR(3C). The scope of the control operations can be further defined
+with additional selection criteria (in the form of attributes) according to the
+bit pattern contained in \fIattr\fR.
+.sp
+.LP
+The following attributes specify page mapping selection criteria:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHARED\fR\fR
+.ad
+.RS 11n
+.rt
+Page is mapped shared.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPRIVATE\fR\fR
+.ad
+.RS 11n
+.rt
+Page is mapped private.
+.RE
+
+.sp
+.LP
+The following attributes specify page protection selection criteria. The
+selection criteria are constructed by a bitwise OR operation on the attribute
+bits and must match exactly.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_READ\fR\fR
+.ad
+.RS 14n
+.rt
+Page can be read.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_WRITE\fR\fR
+.ad
+.RS 14n
+.rt
+Page can be written.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_EXEC\fR\fR
+.ad
+.RS 14n
+.rt
+Page can be executed.
+.RE
+
+.sp
+.LP
+The following criteria may also be specified:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROC_TEXT\fR\fR
+.ad
+.RS 13n
+.rt
+Process text.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROC_DATA\fR\fR
+.ad
+.RS 13n
+.rt
+Process data.
+.RE
+
+.sp
+.LP
+The \fBPROC_TEXT\fR attribute specifies all privately mapped segments with read
+and execute permission, and the \fBPROC_DATA\fR attribute specifies all
+privately mapped segments with write permission.
+.sp
+.LP
+Selection criteria can be used to describe various abstract memory objects
+within the address space on which to operate. If an operation shall not be
+constrained by the selection criteria, \fIattr\fR must have the value \fB0\fR.
+.sp
+.LP
+The operation to be performed is identified by the argument \fIcmd\fR. The
+symbolic names for the operations are defined in <\fBsys/mman.h\fR> as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMC_LOCK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Lock in memory all pages in the range with attributes \fIattr\fR. A given page
+may be locked multiple times through different mappings; however, within a
+given mapping, page locks do not nest. Multiple lock operations on the same
+address in the same process will all be removed with a single unlock operation.
+A page locked in one process and mapped in another (or visible through a
+different mapping in the locking process) is locked in memory as long as the
+locking process does neither an implicit nor explicit unlock operation. If a
+locked mapping is removed, or a page is deleted through file removal or
+truncation, an unlock operation is implicitly performed. If a writable
+\fBMAP_PRIVATE\fR page in the address range is changed, the lock will be
+transferred to the private page.
+.sp
+The \fIarg\fR argument is not used, but must be 0 to ensure compatibility with
+potential future enhancements.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMC_LOCKAS\fR\fR
+.ad
+.sp .6
+.RS 4n
+Lock in memory all pages mapped by the address space with attributes
+\fIattr\fR. The \fIaddr\fR and \fIlen\fR arguments are not used, but must be
+\fINULL\fR and \fB0\fR respectively, to ensure compatibility with potential
+future enhancements. The \fIarg\fR argument is a bit pattern built from the
+flags:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMCL_CURRENT\fR\fR
+.ad
+.RS 15n
+.rt
+Lock current mappings.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMCL_FUTURE\fR\fR
+.ad
+.RS 15n
+.rt
+Lock future mappings.
+.RE
+
+The value of \fIarg\fR determines whether the pages to be locked are those
+currently mapped by the address space, those that will be mapped in the future,
+or both. If \fBMCL_FUTURE\fR is specified, then all mappings subsequently added
+to the address space will be locked, provided sufficient memory is available.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMC_SYNC\fR\fR
+.ad
+.sp .6
+.RS 4n
+Write to their backing storage locations all modified pages in the range with
+attributes \fIattr\fR. Optionally, invalidate cache copies. The backing storage
+for a modified \fBMAP_SHARED\fR mapping is the file the page is mapped to; the
+backing storage for a modified \fBMAP_PRIVATE\fR mapping is its swap area. The
+\fIarg\fR argument is a bit pattern built from the flags used to control the
+behavior of the operation:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_ASYNC\fR\fR
+.ad
+.RS 17n
+.rt
+Perform asynchronous writes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_SYNC\fR\fR
+.ad
+.RS 17n
+.rt
+Perform synchronous writes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_INVALIDATE\fR\fR
+.ad
+.RS 17n
+.rt
+Invalidate mappings.
+.RE
+
+\fBMS_ASYNC\fR Return immediately once all write operations are scheduled; with
+\fBMS_SYNC\fR the function will not return until all write operations are
+completed.
+.sp
+\fBMS_INVALIDATE\fR Invalidate all cached copies of data in memory, so that
+further references to the pages will be obtained by the system from their
+backing storage locations. This operation should be used by applications that
+require a memory object to be in a known state.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMC_UNLOCK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Unlock all pages in the range with attributes \fIattr\fR. The \fIarg\fR
+argument is not used, but must be \fB0\fR to ensure compatibility with
+potential future enhancements.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMC_UNLOCKAS\fR\fR
+.ad
+.sp .6
+.RS 4n
+Remove address space memory locks and locks on all pages in the address space
+with attributes \fIattr\fR. The \fIaddr\fR, \fIlen\fR, and \fIarg\fR arguments
+are not used, but must be \fINULL\fR, 0 and 0, respectively, to ensure
+compatibility with potential future enhancements.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMC_HAT_ADVISE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Advise system how a region of user-mapped memory will be accessed. The
+\fIarg\fR argument is interpreted as a "\fBstruct memcntl_mha *\fR". The
+following members are defined in a \fBstruct memcntl_mha\fR:
+.sp
+.in +2
+.nf
+uint_t mha_cmd;
+uint_t mha_flags;
+size_t mha_pagesize;
+.fi
+.in -2
+
+The accepted values for \fBmha_cmd\fR are:
+.sp
+.in +2
+.nf
+MHA_MAPSIZE_VA
+MHA_MAPSIZE_STACK
+MHA_MAPSIZE_BSSBRK
+.fi
+.in -2
+
+The \fBmha_flags\fR member is reserved for future use and must always be set to
+0. The \fBmha_pagesize\fR member must be a valid size as obtained from
+\fBgetpagesizes\fR(3C) or the constant value 0 to allow the system to choose an
+appropriate hardware address translation mapping size.
+.sp
+\fBMHA_MAPSIZE_VA\fR sets the preferred hardware address translation mapping
+size of the region of memory from \fIaddr\fR to \fIaddr\fR + \fIlen\fR. Both
+\fIaddr\fR and \fIlen\fR must be aligned to an \fBmha_pagesize\fR boundary. The
+entire virtual address region from \fIaddr\fR to \fIaddr\fR + \fIlen\fR must
+not have any holes. Permissions within each \fBmha_pagesize\fR-aligned portion
+of the region must be consistent. When a size of 0 is specified, the system
+selects an appropriate size based on the size and alignment of the memory
+region, type of processor, and other considerations.
+.sp
+\fBMHA_MAPSIZE_STACK\fR sets the preferred hardware address translation mapping
+size of the process main thread stack segment. The \fIaddr\fR and \fIlen\fR
+arguments must be \fINULL\fR and 0, respectively.
+.sp
+\fBMHA_MAPSIZE_BSSBRK\fR sets the preferred hardware address translation
+mapping size of the process heap. The \fIaddr\fR and \fIlen\fR arguments must
+be \fINULL\fR and 0, respectively. See the NOTES section of the \fBppgsz\fR(1)
+manual page for additional information on process heap alignment.
+.sp
+The \fIattr\fR argument must be 0 for all \fBMC_HAT_ADVISE\fR operations.
+.RE
+
+.sp
+.LP
+The \fImask\fR argument must be \fB0\fR; it is reserved for future use.
+.sp
+.LP
+Locks established with the lock operations are not inherited by a child process
+after \fBfork\fR(2). The \fBmemcntl()\fR function fails if it attempts to lock
+more memory than a system-specific limit.
+.sp
+.LP
+Due to the potential impact on system resources, the operations
+\fBMC_LOCKAS\fR, \fBMC_LOCK\fR, \fBMC_UNLOCKAS\fR, and \fBMC_UNLOCK\fR are
+restricted to privileged processes.
+.SH USAGE
+.sp
+.LP
+The \fBmemcntl()\fR function subsumes the operations of \fBplock\fR(3C) and
+\fBmctl\fR(3UCB).
+.sp
+.LP
+\fBMC_HAT_ADVISE\fR is intended to improve performance of applications that use
+large amounts of memory on processors that support multiple hardware address
+translation mapping sizes; however, it should be used with care. Not all
+processors support all sizes with equal efficiency. Use of larger sizes may
+also introduce extra overhead that could reduce performance or available
+memory. Using large sizes for one application may reduce available resources
+for other applications and result in slower system wide performance.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmemcntl()\fR returns \fB0\fR; otherwise, it
+returns \fB\(mi1\fR and sets \fBerrno\fR to indicate an error.
+.SH ERRORS
+.sp
+.LP
+The \fBmemcntl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+When the selection criteria match, some or all of the memory identified by the
+operation could not be locked when \fBMC_LOCK\fR or \fBMC_LOCKAS\fR was
+specified, some or all mappings in the address range [\fIaddr\fR, \fIaddr\fR +
+\fIlen\fR) are locked for I/O when \fBMC_HAT_ADVISE\fR was specified, or the
+system has insufficient resources when \fBMC_HAT_ADVISE\fR was specified.
+.sp
+The \fIcmd\fR is \fBMC_LOCK\fR or \fBMC_LOCKAS\fR and locking the memory
+identified by this operation would exceed a limit or resource control on locked
+memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 10n
+.rt
+When the selection criteria match, some or all of the addresses in the range
+[\fIaddr, addr + len\fR) are locked and \fBMC_SYNC\fR with the
+\fBMS_INVALIDATE\fR option was specified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIaddr\fR argument specifies invalid selection criteria or is not a
+multiple of the page size as returned by \fBsysconf\fR(3C); the \fIaddr\fR
+and/or \fIlen\fR argument does not have the value \fB0\fR when \fBMC_LOCKAS\fR
+or \fBMC_UNLOCKAS\fR is specified; the \fIarg\fR argument is not valid for the
+function specified; \fBmha_pagesize\fR or \fBmha_cmd\fR is invalid; or
+\fBMC_HAT_ADVISE\fR is specified and not all pages in the specified region have
+the same access permissions within the given size boundaries.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+When the selection criteria match, some or all of the addresses in the range
+[\fIaddr\fR, \fIaddr\fR + \fIlen\fR) are invalid for the address space of a
+process or specify one or more pages which are not mapped.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_LOCK_MEMORY\fR} privilege is not asserted in the effective
+set of the calling process and \fBMC_LOCK\fR, \fBMC_LOCKAS\fR, \fBMC_UNLOCK\fR,
+or \fBMC_UNLOCKAS\fR was specified.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBppgsz\fR(1), \fBfork\fR(2), \fBmmap\fR(2), \fBmprotect\fR(2),
+\fBgetpagesizes\fR(3C), \fBmctl\fR(3UCB), \fBmlock\fR(3C), \fBmlockall\fR(3C),
+\fBmsync\fR(3C), \fBplock\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(5),
+\fBprivileges\fR(5)
diff --git a/usr/src/man/man2/meminfo.2 b/usr/src/man/man2/meminfo.2
new file mode 100644
index 0000000000..0de1e3768a
--- /dev/null
+++ b/usr/src/man/man2/meminfo.2
@@ -0,0 +1,299 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH meminfo 2 "21 Feb 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+meminfo \- provide information about memory
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/mman.h>
+
+\fBint\fR \fBmeminfo\fR(\fBconst uint64_t\fR \fIinaddr\fR[], \fBint\fR \fIaddr_count\fR,
+ \fBconst uint_t\fR \fIinfo_req\fR[], \fBint\fR \fIinfo_count\fR, \fBuint64_t\fR \fIoutdata\fR[],
+ \fBuint_t\fR \fIvalidity\fR[]);
+.fi
+
+.SH PARAMETERS
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinaddr\fR\fR
+.ad
+.RS 14n
+.rt
+array of input addresses; the maximum number of addresses that can be processed
+for each call is \fBMAX_MEMINFO_CNT\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIaddr_count\fR\fR
+.ad
+.RS 14n
+.rt
+number of addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinfo_req\fR\fR
+.ad
+.RS 14n
+.rt
+array of types of information requested
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIinfo_count\fR\fR
+.ad
+.RS 14n
+.rt
+number of pieces of information requested for each address in \fIinaddr\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIoutdata\fR\fR
+.ad
+.RS 14n
+.rt
+array into which results are placed; array size must be the product of
+\fIinfo_count\fR and \fIaddr_count\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIvalidity\fR\fR
+.ad
+.RS 14n
+.rt
+array of size \fIaddr_count\fR containing bitwise result codes; 0th bit
+evaluates validity of corresponding input address, 1st bit validity of response
+to first member of \fIinfo_req\fR, and so on
+.RE
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmeminfo()\fR function provides information about virtual and physical
+memory particular to the calling process. The user or developer of performance
+utilities can use this information to analyze system memory allocations and
+develop a better understanding of the factors affecting application
+performance.
+.sp
+.LP
+The caller of \fBmeminfo()\fR can obtain the following types of information
+about both virtual and physical memory.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_VPHYSICAL\fR\fR
+.ad
+.RS 26n
+.rt
+physical address corresponding to virtual address
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_VLGRP\fR\fR
+.ad
+.RS 26n
+.rt
+locality group of physical page corresponding to virtual address
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_VPAGESIZE\fR\fR
+.ad
+.RS 26n
+.rt
+size of physical page corresponding to virtual address
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_VREPLCNT\fR\fR
+.ad
+.RS 26n
+.rt
+number of replicated physical pages corresponding to specified virtual address
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_VREPL\fR | \fIn\fR\fR
+.ad
+.RS 26n
+.rt
+\fIn\fRth physical replica of specified virtual address
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_VREPL_LGRP\fR | \fIn\fR\fR
+.ad
+.RS 26n
+.rt
+lgrp of \fIn\fRth physical replica of specified virtual address
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMEMINFO_PLGRP\fR\fR
+.ad
+.RS 26n
+.rt
+locality group of specified physical address
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion \fBmeminfo()\fR returns 0. Otherwise \(mi1 is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmeminfo()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The area pointed to by \fIoutdata\fR or \fIvalidity\fR could not be written, or
+the data pointed to by \fIinfo_req\fR or \fIinaddr\fR could not be read.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIinfo_count\fR is greater than 31 or less than 1, or the value
+of \fIaddr_count\fR is less than 1.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRPrint physical pages and page sizes corresponding to a set of
+virtual addresses.
+.sp
+.LP
+The following example prints the physical pages and page sizes corresponding to
+a set of virtual addresses.
+
+.sp
+.in +2
+.nf
+void
+print_info(void **addrvec, int how_many)
+{
+ static const uint_t info[] = {
+ MEMINFO_VPHYSICAL,
+ MEMINFO_VPAGESIZE
+ };
+
+ int info_num = sizeof (info) / sizeof (info[0]);
+ int i;
+
+ uint64_t *inaddr = alloca(sizeof (uint64_t) * how_many);
+ uint64_t *outdata = alloca(sizeof (uint64_t) * how_many * info_num);
+ uint_t *validity = alloca(sizeof (uint_t) * how_many);
+
+ for (i = 0; i < how_many; i++)
+ inaddr[i] = (uint64_t)addrvec[i];
+
+ if (meminfo(inaddr, how_many, info, info_num, outdata,
+ validity) < 0) {
+ perror("meminfo");
+ return;
+ }
+
+ for (i = 0; i < how_many; i++) {
+ if ((validity[i] & 1) == 0)
+ printf("address 0x%llx not part of address space\en",
+ inaddr[i]);
+
+ else if ((validity[i] & 2) == 0)
+ printf("address 0x%llx has no physical page "
+ "associated with it\en", inaddr[i]);
+
+ else {
+ char buff[80];
+ if ((validity[i] & 4) == 0)
+ strcpy(buff, "<Unknown>");
+ else
+ sprintf(buff, "%lld",
+ outdata[i * info_num + 1]);
+
+ printf("address 0x%llx is backed by physical "
+ "page 0x%llx of size %s\en",
+ inaddr[i], outdata[i * info_num], buff);
+ }
+ }
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStable
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBmemcntl\fR(2), \fBmmap\fR(2), \fBgethomelgroup\fR(3C),
+\fBgetpagesize\fR(3C), \fBmadvise\fR(3C), \fBsysconf\fR(3C),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/mincore.2 b/usr/src/man/man2/mincore.2
new file mode 100644
index 0000000000..661eba5a71
--- /dev/null
+++ b/usr/src/man/man2/mincore.2
@@ -0,0 +1,82 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mincore 2 "12 Aug 1990" "SunOS 5.11" "System Calls"
+.SH NAME
+mincore \- determine residency of memory pages
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+
+\fBint\fR \fBmincore\fR(\fBcaddr_t\fR \fIaddr\fR, \fBsize_t\fR \fIlen\fR, \fBchar *\fR\fIvec\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmincore()\fR function determines the residency of the memory pages in
+the address space covered by mappings in the range [\fIaddr\fR, \fIaddr\fR +
+\fIlen\fR]. The status is returned as a character-per-page in the character
+array referenced by \fI*vec\fR (which the system assumes to be large enough to
+encompass all the pages in the address range). The least significant bit of
+each character is set to 1 to indicate that the referenced page is in primary
+memory, and to 0 to indicate that it is not. The settings of other bits in each
+character are undefined and may contain other information in future
+implementations.
+.sp
+.LP
+Because the status of a page can change between the time \fBmincore()\fR checks
+and returns the information, returned information might be outdated. Only
+locked pages are guaranteed to remain in memory; see \fBmlock\fR(3C).
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmincore()\fR returns \fB0\fR. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmincore()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIvec\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIaddr\fR argument is not a multiple of the page size as returned by
+\fBsysconf\fR(3C), or the \fIlen\fR argument has a value less than or equal to
+0.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+Addresses in the range [\fIaddr, addr + len\fR] are invalid for the address
+space of a process or specify one or more pages which are not mapped.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBmmap\fR(2), \fBmlock\fR(3C), \fBsysconf\fR(3C)
diff --git a/usr/src/man/man2/mkdir.2 b/usr/src/man/man2/mkdir.2
new file mode 100644
index 0000000000..6ee00617cc
--- /dev/null
+++ b/usr/src/man/man2/mkdir.2
@@ -0,0 +1,298 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mkdir 2 "18 May 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+mkdir \- make a directory
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+
+\fBint\fR \fBmkdir\fR(\fBconst char *\fR\fIpath\fR, \fBmode_t\fR \fImode\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmkdir()\fR function creates a new directory named by the path name
+pointed to by \fIpath\fR. The mode of the new directory is initialized from
+\fImode\fR (see \fBchmod\fR(2) for values of mode). The protection part of the
+\fImode\fR argument is modified by the process's file creation mask (see
+\fBumask\fR(2)).
+.sp
+.LP
+The directory's owner \fBID\fR is set to the process's effective user ID. The
+directory's group \fBID\fR is set to the process's effective group ID, or if
+the \fBS_ISGID\fR bit is set in the parent directory, then the group \fBID\fR
+of the directory is inherited from the parent. The \fBS_ISGID\fR bit of the
+new directory is inherited from the parent directory.
+.sp
+.LP
+If \fIpath\fR names a symbolic link, \fBmkdir()\fR fails and sets errno to
+\fBEEXIST\fR.
+.sp
+.LP
+The newly created directory is empty with the exception of entries for itself
+(\fB\&.\fR) and its parent directory (\fB\&..\fR).
+.sp
+.LP
+Upon successful completion, \fBmkdir()\fR marks for update the \fBst_atime\fR,
+\fBst_ctime\fR and \fBst_mtime\fR fields of the directory. Also, the
+\fBst_ctime\fR and \fBst_mtime\fR fields of the directory that contains the new
+entry are marked for update.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, no directory is created, and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBmkdir()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Either a component of the path prefix denies search permission or write
+permission is denied on the parent directory of the directory to be created.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 16n
+.rt
+The directory where the new file entry is being placed cannot be extended
+because the user's quota of disk blocks on that file system has been exhausted;
+the new directory cannot be created because the user's quota of disk blocks on
+that file system has been exhausted; or the user's quota of inodes on the file
+system where the file is being created has been exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The named file already exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+An attempt was made to create an extended attribute that is a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error has occurred while accessing the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The path argument includes non-UTF8 characters and the file system accepts only
+file names where all characters are part of the UTF-8 character codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR, or a loop
+exists in symbolic links encountered during resolution of \fIpath\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The maximum number of links to the parent directory would be exceeded.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix does not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+No free space is available on the device containing the directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The path prefix resides on a read-only file system.
+.RE
+
+.sp
+.LP
+The \fBmkdir()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+As a result of encountering a symbolic link in resolution of the \fIpath\fR
+argument, the length of the substituted pathname string exceeded
+{\fBPATH_MAX\fR}.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRCreate a directory.
+.sp
+.LP
+The following example demonstrates how to create a directory named
+\fB/home/cnd/mod1\fR, with read, write, and search permissions for owner and
+group, and with read and search permissions for others.
+
+.sp
+.in +2
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+int status;
+\&...
+status = mkdir("/home/cnd/mod1",
+ S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchmod\fR(2), \fBmknod\fR(2), \fBumask\fR(2), \fBmkdirp\fR(3GEN),
+\fBstat.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/mknod.2 b/usr/src/man/man2/mknod.2
new file mode 100644
index 0000000000..bc33328fb0
--- /dev/null
+++ b/usr/src/man/man2/mknod.2
@@ -0,0 +1,382 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mknod 2 "19 Feb 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+mknod \- make a directory, a special file, or a regular file
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/stat.h>
+
+\fBint\fR \fBmknod\fR(\fBconst char *\fR\fIpath\fR, \fBmode_t\fR \fImode\fR, \fBdev_t\fR \fIdev\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmknod()\fR function creates a new file named by the path name pointed to
+by \fIpath\fR. The file type and permissions of the new file are initialized
+from \fImode\fR.
+.sp
+.LP
+The file type is specified in \fImode\fR by the \fBS_IFMT\fR bits, which must
+be set to one of the following values:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS_IFIFO\fR\fR
+.ad
+.RS 11n
+.rt
+fifo special
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS_IFCHR\fR\fR
+.ad
+.RS 11n
+.rt
+character special
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS_IFDIR\fR\fR
+.ad
+.RS 11n
+.rt
+directory
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS_IFBLK\fR\fR
+.ad
+.RS 11n
+.rt
+block special
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBS_IFREG\fR\fR
+.ad
+.RS 11n
+.rt
+ordinary file
+.RE
+
+.sp
+.LP
+The file access permissions are specified in \fImode\fR by the 0007777 bits,
+and may be constructed by a bitwise \fBOR\fR operation of the following values:
+.sp
+
+.sp
+.TS
+tab();
+lw(1.08i) lw(.89i) lw(3.53i)
+lw(1.08i) lw(.89i) lw(3.53i)
+.
+\fBS_ISUID\fR04000Set user ID on execution.
+\fBS_ISGID\fR020#0T{
+Set group ID on execution if # is \fB7\fR, \fB5\fR, \fB3\fR, or \fB1\fR. Enable mandatory file/record locking if # is \fB6\fR, \fB4\fR, \fB2\fR, or \fB0\fR
+T}
+\fBS_ISVTX\fR01000T{
+On directories, restricted deletion flag; on regular files on a UFS file system, do not cache flag.
+T}
+\fBS_IRWXU\fR00700Read, write, execute by owner.
+\fBS_IRUSR\fR00400Read by owner.
+\fBS_IWUSR\fR00200Write by owner.
+\fBS_IXUSR\fR00100T{
+Execute (search if a directory) by owner.
+T}
+\fBS_IRWXG\fR00070Read, write, execute by group.
+\fBS_IRGRP\fR00040Read by group.
+\fBS_IWGRP\fR00020Write by group.
+\fBS_IXGRP\fR00010Execute by group.
+\fBS_IRWXO\fR00007Read, write, execute (search) by others.
+\fBS_IROTH\fR00004Read by others.
+\fBS_IWOTH\fR00002Write by others
+\fBS_IXOTH\fR00001Execute by others.
+.TE
+
+.sp
+.LP
+The owner \fBID\fR of the file is set to the effective user \fBID\fR of the
+process. The group \fBID\fR of the file is set to the effective group \fBID\fR
+of the process. However, if the \fBS_ISGID\fR bit is set in the parent
+directory, then the group \fBID\fR of the file is inherited from the parent.
+If the group \fBID\fR of the new file does not match the effective group
+\fBID\fR or one of the supplementary group IDs, the \fBS_ISGID\fR bit is
+cleared.
+.sp
+.LP
+The access permission bits of \fImode\fR are modified by the process's file
+mode creation mask: all bits set in the process's file mode creation mask are
+cleared (see \fBumask\fR(2)). If \fImode\fR indicates a block or character
+special file, \fIdev\fR is a configuration-dependent specification of a
+character or block I/O device. If \fImode\fR does not indicate a block special
+or character special device, \fIdev\fR is ignored. See \fBmakedev\fR(3C).
+.sp
+.LP
+If \fIpath\fR is a symbolic link, it is not followed.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmknod()\fR returns \fB0\fR. Otherwise, it
+returns \fB\(mi1\fR, the new file is not created, and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmknod()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix denies search permission, or write permission is
+denied on the parent directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 16n
+.rt
+The directory where the new file entry is being placed cannot be extended
+because the user's quota of disk blocks on that file system has been exhausted,
+or the user's quota of inodes on the file system where the file is being
+created has been exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The named file exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBmknod()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+An invalid argument exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while accessing the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fB\fR\fBPATH_MAX\fR}, or the
+length of a \fIpath\fR component exceeds {\fB\fR\fBNAME_MAX\fR} while
+\fB\fR\fB_POSIX_NO_TRUNC\fR is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix specified by \fIpath\fR does not name an
+existing directory or \fIpath\fR is an empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+The directory that would contain the new file cannot be extended or the file
+system is out of file allocation resources.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+Not all privileges are asserted in the effective set of the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The directory in which the file is to be created is located on a read-only file
+system.
+.RE
+
+.sp
+.LP
+The \fBmknod()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+Pathname resolution of a symbolic link produced an intermediate result whose
+length exceeds {\fBPATH_MAX\fR}.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Applications should use the \fBmkdir\fR(2) function to create a directory
+because appropriate permissions are not required and because \fBmknod()\fR
+might not establish directory entries for the directory itself (\fB\&.\fR) and
+the parent directory (\fB\&.\|.\fR). The \fBmknod()\fR function can be invoked
+only by a privileged user for file types other than FIFO special. The
+\fBmkfifo\fR(3C) function should be used to create FIFOs.
+.sp
+.LP
+Doors are created using \fBdoor_create\fR(3C) and can be attached to the file
+system using \fBfattach\fR(3C). Symbolic links can be created using
+\fBsymlink\fR(2). An endpoint for communication can be created using
+\fBsocket\fR(3SOCKET).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchmod\fR(2), \fBcreat\fR(2), \fBexec\fR(2), \fBmkdir\fR(2), \fBopen\fR(2),
+\fBstat\fR(2), \fBsymlink\fR(2), \fBumask\fR(2), \fBdoor_create\fR(3C),
+\fBfattach\fR(3C), \fBmakedev\fR(3C), \fBmkfifo\fR(3C), \fBsocket\fR(3SOCKET),
+\fBstat.h\fR(3HEAD), \fBattributes\fR(5), \fBprivileges\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/mmap.2 b/usr/src/man/man2/mmap.2
new file mode 100644
index 0000000000..b3c9a1f0f8
--- /dev/null
+++ b/usr/src/man/man2/mmap.2
@@ -0,0 +1,954 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mmap 2 "4 Feb 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+mmap \- map pages of memory
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/mman.h>
+
+\fBvoid *\fR\fBmmap\fR(\fBvoid *\fR\fIaddr\fR, \fBsize_t\fR \fIlen\fR, \fBint\fR \fIprot\fR, \fBint\fR \fIflags\fR,
+ \fBint\fR \fIfildes\fR, \fBoff_t\fR \fIoff\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmmap()\fR function establishes a mapping between a process's address
+space and a file or shared memory object. The format of the call is as follows:
+.sp
+.LP
+\fIpa\fR = \fBmmap(\fR\fIaddr\fR\fB, \fR\fIlen\fR\fB, \fR\fIprot\fR\fB,
+\fR\fIflags\fR\fB, \fR\fIfildes\fR\fB, \fR\fIoff\fR\fB);\fR
+.sp
+.LP
+The \fBmmap()\fR function establishes a mapping between the address space of
+the process at an address \fIpa\fR for \fIlen\fR bytes to the memory object
+represented by the file descriptor \fIfildes\fR at offset \fIoff\fR for
+\fIlen\fR bytes. The value of \fIpa\fR is a function of the \fIaddr\fR
+argument and values of \fIflags\fR, further described below. A successful
+\fBmmap()\fR call returns \fIpa\fR as its result. The address range starting at
+\fIpa\fR and continuing for \fIlen\fR bytes will be legitimate for the possible
+(not necessarily current) address space of the process. The range of bytes
+starting at \fIoff\fR and continuing for \fIlen\fR bytes will be legitimate for
+the possible (not necessarily current) offsets in the file or shared memory
+object represented by \fIfildes\fR.
+.sp
+.LP
+The \fBmmap()\fR function allows [\fIpa, pa + len\fR) to extend beyond the end
+of the object both at the time of the \fBmmap()\fR and while the mapping
+persists, such as when the file is created prior to the \fBmmap()\fR call and
+has no contents, or when the file is truncated. Any reference to addresses
+beyond the end of the object, however, will result in the delivery of a
+\fBSIGBUS\fR or \fBSIGSEGV\fR signal. The \fBmmap()\fR function cannot be used
+to implicitly extend the length of files.
+.sp
+.LP
+The mapping established by \fBmmap()\fR replaces any previous mappings for
+those whole pages containing any part of the address space of the process
+starting at \fIpa\fR and continuing for \fIlen\fR bytes.
+.sp
+.LP
+If the size of the mapped file changes after the call to \fBmmap()\fR as a
+result of some other operation on the mapped file, the effect of references to
+portions of the mapped region that correspond to added or removed portions of
+the file is unspecified.
+.sp
+.LP
+The \fBmmap()\fR function is supported for regular files and shared memory
+objects. Support for any other type of file is unspecified.
+.sp
+.LP
+The \fIprot\fR argument determines whether read, write, execute, or some
+combination of accesses are permitted to the data being mapped. The \fIprot\fR
+argument should be either \fBPROT_NONE\fR or the bitwise inclusive \fBOR\fR of
+one or more of the other flags in the following table, defined in the header
+<\fBsys/mman.h\fR>.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_READ\fR\fR
+.ad
+.RS 14n
+.rt
+Data can be read.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_WRITE\fR\fR
+.ad
+.RS 14n
+.rt
+Data can be written.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_EXEC\fR\fR
+.ad
+.RS 14n
+.rt
+Data can be executed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_NONE\fR\fR
+.ad
+.RS 14n
+.rt
+Data cannot be accessed.
+.RE
+
+.sp
+.LP
+If an implementation of \fBmmap()\fR for a specific platform cannot support the
+combination of access types specified by \fIprot\fR, the call to \fBmmap()\fR
+fails. An implementation may permit accesses other than those specified by
+\fIprot\fR; however, the implementation will not permit a write to succeed
+where \fBPROT_WRITE\fR has not been set or permit any access where
+\fBPROT_NONE\fR alone has been set. Each platform-specific implementation of
+\fBmmap()\fR supports the following values of \fIprot\fR: \fBPROT_NONE\fR,
+\fBPROT_READ\fR, \fBPROT_WRITE\fR, and the inclusive \fBOR\fR of
+\fBPROT_READ\fR and \fBPROT_WRITE\fR. On some platforms, the \fBPROT_WRITE\fR
+protection option is implemented as \fBPROT_READ|PROT_WRITE\fR and
+\fBPROT_EXEC\fR as \fBPROT_READ|PROT_EXEC\fR. The file descriptor \fIfildes\fR
+is opened with read permission, regardless of the protection options specified.
+If \fBPROT_WRITE\fR is specified, the application must have opened the file
+descriptor \fIfildes\fR with write permission unless \fBMAP_PRIVATE\fR is
+specified in the \fIflags\fR argument as described below.
+.sp
+.LP
+The \fIflags\fR argument provides other information about the handling of the
+mapped data. The value of \fIflags\fR is the bitwise inclusive \fBOR\fR of
+these options, defined in <\fBsys/mman.h\fR>:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_SHARED\fR\fR
+.ad
+.RS 17n
+.rt
+Changes are shared.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_PRIVATE\fR\fR
+.ad
+.RS 17n
+.rt
+Changes are private.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_FIXED\fR\fR
+.ad
+.RS 17n
+.rt
+Interpret \fIaddr\fR exactly.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_NORESERVE\fR\fR
+.ad
+.RS 17n
+.rt
+Do not reserve swap space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_ANON\fR\fR
+.ad
+.RS 17n
+.rt
+Map anonymous memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_ALIGN\fR\fR
+.ad
+.RS 17n
+.rt
+Interpret \fIaddr\fR as required aligment.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_TEXT\fR\fR
+.ad
+.RS 17n
+.rt
+Map text.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMAP_INITDATA\fR\fR
+.ad
+.RS 17n
+.rt
+Map initialized data segment.
+.RE
+
+.sp
+.LP
+The \fBMAP_SHARED\fR and \fBMAP_PRIVATE\fR options describe the disposition of
+write references to the underlying object. If \fBMAP_SHARED\fR is specified,
+write references will change the memory object. If \fBMAP_PRIVATE\fR is
+specified, the initial write reference will create a private copy of the memory
+object page and redirect the mapping to the copy. The private copy is not
+created until the first write; until then, other users who have the object
+mapped \fBMAP_SHARED\fR can change the object. Either \fBMAP_SHARED\fR or
+\fBMAP_PRIVATE\fR must be specified, but not both. The mapping type is retained
+across \fBfork\fR(2).
+.sp
+.LP
+When \fBMAP_FIXED\fR is set in the \fIflags\fR argument, the system is informed
+that the value of \fIpa\fR must be \fIaddr\fR, exactly. If \fBMAP_FIXED\fR is
+set, \fBmmap()\fR may return (\fBvoid *\fR)\(mi1 and set \fBerrno\fR to
+\fBEINVAL\fR. If a \fBMAP_FIXED\fR request is successful, the mapping
+established by \fBmmap()\fR replaces any previous mappings for the process's
+pages in the range [\fIpa, pa + len\fR). The use of \fBMAP_FIXED\fR is
+discouraged, since it may prevent a system from making the most effective use
+of its resources.
+.sp
+.LP
+When \fBMAP_FIXED\fR is set and the requested address is the same as previous
+mapping, the previous address is unmapped and the new mapping is created on top
+of the old one.
+.sp
+.LP
+When \fBMAP_FIXED\fR is not set, the system uses \fIaddr\fR to arrive at
+\fIpa\fR. The \fIpa\fR so chosen will be an area of the address space that the
+system deems suitable for a mapping of \fIlen\fR bytes to the file. The
+\fBmmap()\fR function interprets an \fIaddr\fR value of 0 as granting the
+system complete freedom in selecting \fIpa\fR, subject to constraints described
+below. A non-zero value of \fIaddr\fR is taken to be a suggestion of a process
+address near which the mapping should be placed. When the system selects a
+value for \fIpa\fR, it will never place a mapping at address 0, nor will it
+replace any extant mapping, nor map into areas considered part of the potential
+data or stack "segments".
+.sp
+.LP
+When \fBMAP_ALIGN\fR is set, the system is informed that the alignment of
+\fIpa\fR must be the same as \fIaddr\fR. The alignment value in \fIaddr\fR must
+be 0 or some power of two multiple of page size as returned by
+\fBsysconf\fR(3C). If addr is 0, the system will choose a suitable alignment.
+.sp
+.LP
+The \fBMAP_NORESERVE\fR option specifies that no swap space be reserved for a
+mapping. Without this flag, the creation of a writable \fBMAP_PRIVATE\fR
+mapping reserves swap space equal to the size of the mapping; when the mapping
+is written into, the reserved space is employed to hold private copies of the
+data. A write into a \fBMAP_NORESERVE\fR mapping produces results which depend
+on the current availability of swap space in the system. If space is
+available, the write succeeds and a private copy of the written page is
+created; if space is not available, the write fails and a \fBSIGBUS\fR or
+\fBSIGSEGV\fR signal is delivered to the writing process. \fBMAP_NORESERVE\fR
+mappings are inherited across \fBfork()\fR; at the time of the \fBfork()\fR,
+swap space is reserved in the child for all private pages that currently exist
+in the parent; thereafter the child's mapping behaves as described above.
+.sp
+.LP
+When \fBMAP_ANON\fR is set in \fIflags\fR, and \fIfildes\fR is set to -1,
+\fBmmap()\fR provides a direct path to return anonymous pages to the caller.
+This operation is equivalent to passing \fBmmap()\fR an open file descriptor on
+\fB/dev/zero\fR with \fBMAP_ANON\fR elided from the \fIflags\fR argument.
+.sp
+.LP
+The \fBMAP_TEXT\fR option informs the system that the mapped region will be
+used primarily for executing instructions. This information can help the system
+better utilize MMU resources on some platforms. This flag is always passed by
+the dynamic linker when it maps text segments of shared objects. When the
+\fBMAP_TEXT\fR option is used for regular file mappings on some platforms, the
+system can choose a mapping size larger than the page size returned by
+\fBsysconf\fR(3C). The specific page sizes that are used depend on the platform
+and the alignment of the addr and len arguments. Several diffrent mapping sizes
+can be used to map the region with larger page sizes used in the parts of the
+region that meet alignment and size requirements for those page sizes.
+.sp
+.LP
+The \fBMAP_INITDATA\fR option informs the system that the mapped region is an
+initialized data segment of an executable or shared object. When the
+\fBMAP_INITDATA\fR option is used for regular file mappings on some platforms,
+the system can choose a mapping size larger than the page size returned by
+\fBsysconf()\fR. The \fBMAP_INITDATA\fR option should be used only by the
+dynamic linker for mapping initialized data of shared objects.
+.sp
+.LP
+The \fIoff\fR argument is constrained to be aligned and sized according to the
+value returned by \fBsysconf()\fR when passed \fB_SC_PAGESIZE\fR or
+\fB_SC_PAGE_SIZE\fR. When \fBMAP_FIXED\fR is specified, the \fIaddr\fR argument
+must also meet these constraints. The system performs mapping operations over
+whole pages. Thus, while the \fIlen\fR argument need not meet a size or
+alignment constraint, the system will include, in any mapping operation, any
+partial page specified by the range [\fIpa, pa + len\fR).
+.sp
+.LP
+The system will always zero-fill any partial page at the end of an object.
+Further, the system will never write out any modified portions of the last page
+of an object which are beyond its end. References to whole pages following the
+end of an object will result in the delivery of a \fBSIGBUS\fR or \fBSIGSEGV\fR
+signal. \fBSIGBUS\fR signals may also be delivered on various file system
+conditions, including quota exceeded errors.
+.sp
+.LP
+The \fBmmap()\fR function adds an extra reference to the file associated with
+the file descriptor \fIfildes\fR which is not removed by a subsequent
+\fBclose\fR(2) on that file descriptor. This reference is removed when there
+are no more mappings to the file by a call to the \fBmunmap\fR(2) function.
+.sp
+.LP
+The \fBst_atime\fR field of the mapped file may be marked for update at any
+time between the \fBmmap()\fR call and the corresponding \fBmunmap\fR(2) call.
+The initial read or write reference to a mapped region will cause the file's
+\fBst_atime\fR field to be marked for update if it has not already been marked
+for update.
+.sp
+.LP
+The \fBst_ctime\fR and \fBst_mtime\fR fields of a file that is mapped with
+\fBMAP_SHARED\fR and \fBPROT_WRITE\fR, will be marked for update at some point
+in the interval between a write reference to the mapped region and the next
+call to \fBmsync\fR(3C) with \fBMS_ASYNC\fR or \fBMS_SYNC\fR for that portion
+of the file by any process. If there is no such call, these fields may be
+marked for update at any time after a write reference if the underlying file is
+modified as a result.
+.sp
+.LP
+If the process calls \fBmlockall\fR(3C) with the \fBMCL_FUTURE\fR flag, the
+pages mapped by all future calls to \fBmmap()\fR will be locked in memory. In
+this case, if not enough memory could be locked, \fBmmap()\fR fails and sets
+\fBerrno\fR to \fBEAGAIN\fR.
+.sp
+.LP
+The \fBmmap()\fR function aligns based on the length of the mapping. When
+determining the amount of space to add to the address space, \fBmmap()\fR
+includes two 8-Kbyte pages, one at each end of the mapping that are not mapped
+and are therefore used as "red-zone" pages. Attempts to reference these pages
+result in access violations.
+.sp
+.LP
+The size requested is incremented by the 16 Kbytes for these pages and is then
+subject to rounding constraints. The constraints are:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+For 32-bit processes:
+.sp
+.in +2
+.nf
+If length > 4 Mbytes
+ round to 4-Mbyte multiple
+elseif length > 512 Kbytes
+ round to 512-Kbyte multiple
+else
+ round to 64-Kbyte multiple
+.fi
+.in -2
+
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+For 64-bit processes:
+.sp
+.in +2
+.nf
+If length > 4 Mbytes
+ round to 4-Mbyte multiple
+else
+ round to 1-Mbyte multiple
+.fi
+.in -2
+
+.RE
+.sp
+.LP
+The net result is that for a 32-bit process:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If an \fBmmap()\fR request is made for 4 Mbytes, it results in 4 Mbytes + 16
+Kbytes and is rounded up to 8 Mbytes.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If an \fBmmap()\fR request is made for 512 Kbytes, it results in 512 Kbytes +
+16 Kbytes and is rounded up to 1 Mbyte.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If an \fBmmap()\fR request is made for 1 Mbyte, it results in 1 Mbyte + 16
+Kbytes and is rounded up to 1.5 Mbytes.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Each 8-Kbyte mmap request "consumes" 64 Kbytes of virtual address space.
+.RE
+.sp
+.LP
+To obtain maximal address space usage for a 32-bit process:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Combine 8-Kbyte requests up to a limit of 48 Kbytes.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Combine amounts over 48 Kbytes into 496-Kbyte chunks.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Combine amounts over 496 Kbytes into 4080-Kbyte chunks.
+.RE
+.sp
+.LP
+To obtain maximal address space usage for a 64-bit process:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Combine amounts < 1008 Kbytes into chunks <= 1008 Kbytes.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Combine amounts over 1008 Kbytes into 4080-Kbyte chunks.
+.RE
+.sp
+.LP
+The following is the output from a 32-bit program demonstrating this:
+.sp
+.ne 2
+.mk
+.na
+\fBmap 8192 bytes: \fB0xff390000\fR\fR
+.ad
+.br
+.na
+\fBmap 8192 bytes: \fB0xff380000\fR\fR
+.ad
+.sp .6
+.RS 4n
+64-Kbyte delta between starting addresses.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 512 Kbytes: \fB0xff180000\fR\fR
+.ad
+.br
+.na
+\fBmap 512 Kbytes: \fB0xff080000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1-Mbyte delta between starting addresses.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 496 Kbytes: \fB0xff000000\fR\fR
+.ad
+.br
+.na
+\fBmap 496 Kbytes: \fB0xfef80000\fR\fR
+.ad
+.sp .6
+.RS 4n
+512-Kbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 1 Mbyte: \fB0xfee00000\fR\fR
+.ad
+.br
+.na
+\fBmap 1 Mbyte: \fB0xfec80000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1536-Kbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 1008 Kbytes: \fB0xfeb80000\fR\fR
+.ad
+.br
+.na
+\fBmap 1008 Kbytes: \fB0xfea80000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 4 Mbytes: \fB0xfe400000\fR\fR
+.ad
+.br
+.na
+\fBmap 4 Mbytes: \fB0xfdc00000\fR\fR
+.ad
+.sp .6
+.RS 4n
+8-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 4080 Kbytes: \fB0xfd800000\fR\fR
+.ad
+.br
+.na
+\fBmap 4080 Kbytes: \fB0xfd400000\fR\fR
+.ad
+.sp .6
+.RS 4n
+4-Mbyte delta between starting addresses
+.RE
+
+.sp
+.LP
+The following is the output of the same program compiled as a 64-bit
+application:
+.sp
+.ne 2
+.mk
+.na
+\fBmap 8192 bytes: \fB0xffffffff7f000000\fR\fR
+.ad
+.br
+.na
+\fBmap 8192 bytes: \fB0xffffffff7ef00000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 512 Kbytes: \fB0xffffffff7ee00000\fR\fR
+.ad
+.br
+.na
+\fBmap 512 Kbytes: \fB0xffffffff7ed00000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 496 Kbytes: \fB0xffffffff7ec00000\fR\fR
+.ad
+.br
+.na
+\fBmap 496 Kbytes: \fB0xffffffff7eb00000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 1 Mbyte: \fB0xffffffff7e900000\fR\fR
+.ad
+.br
+.na
+\fBmap 1 Mbyte: \fB0xffffffff7e700000\fR\fR
+.ad
+.sp .6
+.RS 4n
+2-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 1008 Kbytes: \fB0xffffffff7e600000\fR\fR
+.ad
+.br
+.na
+\fBmap 1008 Kbytes: \fB0xffffffff7e500000\fR\fR
+.ad
+.sp .6
+.RS 4n
+1-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 4 Mbytes: \fB0xffffffff7e000000\fR\fR
+.ad
+.br
+.na
+\fBmap 4 Mbytes: \fB0xffffffff7d800000\fR\fR
+.ad
+.sp .6
+.RS 4n
+8-Mbyte delta between starting addresses
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBmap 4080 Kbytes: \fB0xffffffff7d400000\fR\fR
+.ad
+.br
+.na
+\fBmap 4080 Kbytes: \fB0xffffffff7d000000\fR\fR
+.ad
+.sp .6
+.RS 4n
+4-Mbyte delta between starting addresses
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the \fBmmap()\fR function returns the address at
+which the mapping was placed (\fIpa\fR); otherwise, it returns a value of
+\fBMAP_FAILED\fR and sets \fBerrno\fR to indicate the error. The symbol
+\fBMAP_FAILED\fR is defined in the header <\fBsys/mman.h\fR>. No successful
+return from \fBmmap()\fR will return the value \fBMAP_FAILED\fR.
+.sp
+.LP
+If \fBmmap()\fR fails for reasons other than \fBEBADF\fR, \fBEINVAL\fR or
+\fBENOTSUP\fR, some of the mappings in the address range starting at \fIaddr\fR
+and continuing for \fIlen\fR bytes may have been unmapped.
+.SH ERRORS
+.sp
+.LP
+The \fBmmap()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR file descriptor is not open for read, regardless of the
+protection specified; or \fIfildes\fR is not open for write and
+\fBPROT_WRITE\fR was specified for a \fBMAP_SHARED\fR type mapping.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 13n
+.rt
+The mapping could not be locked in memory.
+.sp
+There was insufficient room to reserve swap space for the mapping.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR file descriptor is not open (and \fBMAP_ANON\fR was not
+specified).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The arguments \fIaddr\fR (if \fBMAP_FIXED\fR was specified) or \fIoff\fR are
+not multiples of the page size as returned by \fBsysconf()\fR.
+.sp
+The argument \fIaddr\fR (if \fBMAP_ALIGN\fR was specified) is not 0 or some
+power of two multiple of page size as returned by \fBsysconf\fR(3C).
+.sp
+\fBMAP_FIXED\fR and \fBMAP_ALIGN\fR are both specified.
+.sp
+The field in \fIflags\fR is invalid (neither \fBMAP_PRIVATE\fR or
+\fBMAP_SHARED\fR is set).
+.sp
+The argument \fIlen\fR has a value equal to 0.
+.sp
+\fBMAP_ANON\fR was specified, but the file descriptor was not \(mi1.
+.sp
+\fBMAP_TEXT\fR was specified but \fBPROT_EXEC\fR was not.
+.sp
+\fBMAP_TEXT\fR and \fBMAP_INITDATA\fR were both specified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 13n
+.rt
+The number of mapped regions would exceed an implementation-dependent limit
+(per process or per system).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENODEV\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIfildes\fR argument refers to an object for which \fBmmap()\fR is
+meaningless, such as a terminal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 13n
+.rt
+The \fBMAP_FIXED\fR option was specified and the range [\fIaddr, addr + len\fR)
+exceeds that allowed for the address space of a process.
+.sp
+The \fBMAP_FIXED\fR option was \fInot\fR specified and there is insufficient
+room in the address space to effect the mapping.
+.sp
+The mapping could not be locked in memory, if required by \fBmlockall\fR(3C),
+because it would require more space than the system is able to supply.
+.sp
+The composite size of \fIlen\fR plus the lengths obtained from all previous
+calls to \fBmmap()\fR exceeds \fBRLIMIT_VMEM\fR (see \fBgetrlimit\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 13n
+.rt
+The system does not support the combination of accesses requested in the
+\fIprot\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 13n
+.rt
+Addresses in the range [\fIoff, off + len\fR) are invalid for the object
+specified by \fIfildes\fR.
+.sp
+The \fBMAP_FIXED\fR option was specified in \fIflags\fR and the combination of
+\fIaddr\fR, \fIlen\fR and \fIoff\fR is invalid for the object specified by
+\fIfildes\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The file is a regular file and the value of \fIoff\fR plus \fIlen\fR exceeds
+the offset maximum establish in the open file description associated with
+\fIfildes\fR.
+.RE
+
+.sp
+.LP
+The \fBmmap()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+The file to be mapped is already locked using advisory or mandatory record
+locking. See \fBfcntl\fR(2).
+.RE
+
+.SH USAGE
+.sp
+.LP
+Use of \fBmmap()\fR may reduce the amount of memory available to other memory
+allocation functions.
+.sp
+.LP
+\fBMAP_ALIGN\fR is useful to assure a properly aligned value of \fIpa\fR for
+subsequent use with \fBmemcntl\fR(2) and the \fBMC_HAT_ADVISE\fR command. This
+is best used for large, long-lived, and heavily referenced regions.
+\fBMAP_FIXED\fR and \fBMAP_ALIGN\fR are always mutually-exclusive.
+.sp
+.LP
+Use of \fBMAP_FIXED\fR may result in unspecified behavior in further use of
+\fBbrk\fR(2), \fBsbrk\fR(2), \fBmalloc\fR(3C), and \fBshmat\fR(2). The use of
+\fBMAP_FIXED\fR is discouraged, as it may prevent an implementation from making
+the most effective use of resources.
+.sp
+.LP
+The application must ensure correct synchronization when using \fBmmap()\fR in
+conjunction with any other file access method, such as \fBread\fR(2) and
+\fBwrite\fR(2), standard input/output, and \fBshmat\fR(2).
+.sp
+.LP
+The \fBmmap()\fR function has a transitional interface for 64-bit file offsets.
+See \fBlf64\fR(5).
+.sp
+.LP
+The \fBmmap()\fR function allows access to resources using address space
+manipulations instead of the \fBread()\fR/\fBwrite()\fR interface. Once a file
+is mapped, all a process has to do to access it is use the data at the address
+to which the object was mapped.
+.sp
+.LP
+Consider the following pseudo-code:
+.sp
+.in +2
+.nf
+fildes = open(\|.\|.\|.)
+lseek(fildes, offset, whence)
+read(fildes, buf, len)
+/* use data in buf */
+.fi
+.in -2
+
+.sp
+.LP
+The following is a rewrite using \fBmmap()\fR:
+.sp
+.in +2
+.nf
+fildes = open(\|.\|.\|.)
+address = mmap((caddr_t) 0, len, (PROT_READ | PROT_WRITE),
+ MAP_PRIVATE, fildes, offset)
+/* use data at address */
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBclose\fR(2), \fBexec\fR(2), \fBfcntl\fR(2), \fBfork\fR(2),
+\fBgetrlimit\fR(2), \fBmemcntl\fR(2), \fBmmapobj\fR(2), \fBmprotect\fR(2),
+\fBmunmap\fR(2), \fBshmat\fR(2), \fBlockf\fR(3C), \fBmlockall\fR(3C),
+\fBmsync\fR(3C), \fBplock\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(5),
+\fBlf64\fR(5), \fBstandards\fR(5), \fBnull\fR(7D), \fBzero\fR(7D)
diff --git a/usr/src/man/man2/mmapobj.2 b/usr/src/man/man2/mmapobj.2
new file mode 100644
index 0000000000..036d97fdaa
--- /dev/null
+++ b/usr/src/man/man2/mmapobj.2
@@ -0,0 +1,407 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems Inc. All
+.\" Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mmapobj 2 "1 Dec 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+mmapobj \- map a file object in the appropriate manner
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/mman.h>
+
+\fBint\fR \fBmmapobj\fR(\fBint\fR \fIfd\fR, \fBuint_t\fR \fIflags\fR, \fBmmapobj_result_t *\fR\fIstorage\fR,
+ \fBuint_t *\fR\fIelements\fR, \fBvoid *\fR\fIarg\fR);
+.fi
+
+.SH PARAMETERS
+.sp
+.ne 2
+.mk
+.na
+\fB\fIfd\fR\fR
+.ad
+.RS 12n
+.rt
+The open file descriptor for the file to be mapped.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIflags\fR\fR
+.ad
+.RS 12n
+.rt
+Indicates that the default behavior of \fBmmapobj()\fR should be modified
+accordingly. Available flags are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMMOBJ_INTERPRET\fR\fR
+.ad
+.sp .6
+.RS 4n
+Interpret the contents of the file descriptor instead of just mapping it as a
+single image. This flag can be used only with \fBELF\fR and \fBAOUT\fR files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMMOBJ_PADDING\fR\fR
+.ad
+.sp .6
+.RS 4n
+When mapping in the file descriptor, add an additional mapping before the
+lowest mapping and after the highest mapping. The size of this padding is at
+least as large as the amount pointed to by \fIarg\fR. These mappings will be
+private to the process, will not reserve any swap space and will have no
+protections. To use this address space, the protections for it will need to be
+changed. This padding request will be ignored for the \fBAOUT\fR format.
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIstorage\fR\fR
+.ad
+.RS 12n
+.rt
+A pointer to the \fBmmapobj_result_t\fR array where the mapping data will be
+copied out after a successful mapping of \fIfd\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIelements\fR\fR
+.ad
+.RS 12n
+.rt
+A pointer to the number of \fBmmapobj_result_t\fR elements pointed to by
+\fIstorage\fR. On return, \fIelements\fR contains the number of mappings
+required to fully map the requested object. If the original value of
+\fIelements\fR is too small, \fBE2BIG\fR is returned and \fIelements\fR is
+modified to contain the number of mappings necessary.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fIarg\fR\fR
+.ad
+.RS 12n
+.rt
+A pointer to additional information that might be associated with the specific
+request. Only the \fBMMOBJ_PADDING\fR request uses this argument. If
+\fBMMOBJ_PADDING\fR is not specified, \fIarg\fR must be \fINULL\fR.
+.RE
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmmapobj()\fR function establishes a set of mappings between a process's
+address space and a file. By default, \fBmmapobj()\fR maps the whole file as a
+single, private, read-only mapping. The \fBMMOBJ_INTERPRET\fR flag instructs
+\fBmmapobj()\fR to attempt to interpret the file and map the file according to
+the rules for that file format. The following \fBELF\fR and \fBAOUT\fR formats
+are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBET_EXEC\fR and \fBAOUT\fR executables\fR
+.ad
+.sp .6
+.RS 4n
+This format results in one or more mappings whose size, alignment and
+protections are as described by the file's program header information. The
+address of each mapping is explicitly defined by the file's program headers.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBET_DYN\fR and \fBAOUT\fR shared objects\fR
+.ad
+.sp .6
+.RS 4n
+This format results in one or more mappings whose size, alignment and
+protections are as described by the file's program header information. The base
+address of the initial mapping is chosen by \fBmmapobj()\fR. The addresses of
+adjacent mappings are based off of this base address as defined by the file's
+program headers.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBET_REL\fR and \fBET_CORE\fR\fR
+.ad
+.sp .6
+.RS 4n
+This format results in a single, read-only mapping that covers the whole file.
+The base address of this mapping is chosen by \fBmmapobj()\fR.
+.RE
+
+.sp
+.LP
+The \fBmmapobj()\fR function will not map over any currently used mappings
+within the process, except for the case of an \fBELF ET_EXEC\fR file for which
+a previous reservation has been made via \fB/dev/null\fR. The most common way
+to make such a reservation would be with an \fBmmap()\fR of \fB/dev/null\fR.
+.sp
+.LP
+Mappings created with \fBmmapobj()\fR can be processed individually by other
+system calls such as \fBmunmap\fR(2).
+.sp
+.LP
+The \fBmmapobj_result\fR structure contains the following members:
+.sp
+.in +2
+.nf
+typedef struct mmapobj_result {
+ caddr_t mr_addr; /* mapping address */
+ size_t mr_msize; /* mapping size */
+ size_t mr_fsize; /* file size */
+ size_t mr_offset; /* offset into file */
+ uint_t mr_prot; /* the protections provided */
+ uint_t mr_flags; /* info on the mapping */
+} mmapobj_result_t;
+.fi
+.in -2
+
+.sp
+.LP
+The macro \fBMR_GET_TYPE\fR(\fImr_flags\fR) must be used when looking for the
+above flags in the value of \fImr_flags\fR.
+.sp
+.LP
+Values for \fImr_flags\fR include:
+.sp
+.in +2
+.nf
+MR_PADDING 0x1 /* this mapping represents requested padding */
+MR_HDR_ELF 0x2 /* the ELF header is mapped at mr_addr */
+MR_HDR_AOU 0x3 /* the AOUT header is mapped at mr_addr */
+.fi
+.in -2
+
+.sp
+.LP
+When \fBMR_PADDING\fR is set, \fImr_fsize\fR and \fImr_offset\fR will both be
+0.
+.sp
+.LP
+The \fImr_fsize\fR member represents the amount of the file that is mapped into
+memory with this mapping.
+.sp
+.LP
+The \fImr_offset\fR member is the offset into the mapping where valid data
+begins.
+.sp
+.LP
+The \fImr_msize\fR member represents the size of the memory mapping starting at
+\fImr_addr\fR. This size may include unused data prior to \fImr_offset\fR that
+exists to satisfy the alignment requirements of this segment. This size may
+also include any non-file data that are required to provide \fBNOBITS\fR data
+(typically .\fBbss\fR). The system reserves the right to map more than
+\fImr_msize\fR bytes of memory but only \fImr_msize\fR bytes will be available
+to the caller of \fBmmapobj()\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned and \fIelements\fR contains the
+number of program headers that are mapped for \fIfd\fR. The data describing
+these elements are copied to storage such that the first \fIelements\fR members
+of the storage array contain valid mapping data.
+.sp
+.LP
+On failure, -1 is returned and \fBerrno\fR is set to indicate the error. No
+data is copied to storage.
+.SH ERRORS
+.sp
+.LP
+The \fBmmapobj()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE2BIG\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIelements\fR argument was not large enough to hold the number of loadable
+segments in \fIfd\fR. The \fIelements\fR argument will be modified to contain
+the number of segments required.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 14n
+.rt
+The file system containing the \fIfd\fR to be mapped does not allow execute
+access, or the file descriptor pointed to by \fIfd\fR is not open for reading.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEADDRINUSE\fR\fR
+.ad
+.RS 14n
+.rt
+The mapping requirements overlap an object that is already used by the process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 14n
+.rt
+There is insufficient room to reserve swap space for the mapping.
+.sp
+The file to be mapped is already locked using advisory or mandatory record
+locking. See \fBfcntl\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIfd\fR argument is not a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIstorage\fR, \fIarg\fR, or \fIelements\fR argument points to an invalid
+address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIflags\fR argument contains an invalid flag.
+.sp
+\fBMMOBJ_PADDING\fR was not specified in \fIflags\fRand \fIarg\fR was non-null.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENODEV\fR\fR
+.ad
+.RS 14n
+.rt
+The \fIfd\fR argument refers to an object for which \fBmmapobj()\fR is
+meaningless, such as a terminal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 14n
+.rt
+Insufficient memory is available to hold the program headers.
+.sp
+Insufficient memory is available in the address space to create the mapping.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 14n
+.rt
+The current user data model does not match the \fIfd\fR to be interpreted;
+thus, a 32-bit process that tried to use \fBmmapobj()\fR to interpret a 64-bit
+object would return \fBENOTSUP\fR.
+.sp
+The \fIfd\fR argument is a file whose type can not be interpreted and
+\fBMMOBJ_INTERPRET\fR was specified in \fIflags\fR.
+.sp
+The \fBELF\fR header contains an unaligned \fIe_phentsize\fR value.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSYS\fR\fR
+.ad
+.RS 14n
+.rt
+An unsupported filesystem operation was attempted while trying to map in the
+object.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityPrivate
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBld.so.1\fR(1), \fBfcntl\fR(2), \fBmemcntl\fR(2), \fBmmap\fR(2),
+\fBmprotect\fR(2), \fBmunmap\fR(2), \fBelf\fR(3ELF), \fBmadvise\fR(3C),
+\fBmlockall\fR(3C), \fBmsync\fR(3C), \fBa.out\fR(4), \fBattributes\fR(5)
+.sp
+.LP
+\fILinker and Libraries Guide\fR
diff --git a/usr/src/man/man2/mount.2 b/usr/src/man/man2/mount.2
new file mode 100644
index 0000000000..8eb7428e26
--- /dev/null
+++ b/usr/src/man/man2/mount.2
@@ -0,0 +1,411 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mount 2 "26 Feb 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+mount \- mount a file system
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/mntent.h>
+
+\fBint\fR \fBmount\fR(\fBconst char *\fR\fIspec\fR, \fBconst char *\fR\fIdir\fR, \fBint\fR \fImflag\fR,
+ \fBchar *\fR\fIfstype\fR, \fBchar *\fR\fIdataptr\fR,\fBint\fR \fIdatalen\fR, \fBchar *\fR\fIoptptr\fR,
+ \fBint\fR \fIoptlen\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmount()\fR function requests that a removable file system contained on
+the block special file identified by \fIspec\fR be mounted on the directory
+identified by \fIdir\fR. The \fIspec\fR and \fIdir\fR arguments are pointers to
+path names.
+.sp
+.LP
+After a successful call to \fBmount()\fR, all references to the file \fIdir\fR
+refer to the root directory on the mounted file system. The mounted file system
+is inserted into the kernel list of all mounted file systems. This list can be
+examined through the mounted file system table (see \fBmnttab\fR(4)).
+.sp
+.LP
+The \fIfstype\fR argument is the file system type name. Standard file system
+names are defined with the prefix \fBMNTTYPE_\fR in <\fBsys/mntent.h\fR>. If
+neither \fBMS_DATA\fR nor \fBMS_OPTIONSTR\fR is set in \fImflag\fR, then
+\fIfstype\fR is ignored and the type of the root file system is assumed.
+.sp
+.LP
+The \fIdataptr\fR argument is 0 if no file system-specific data is to be
+passed; otherwise it points to an area of size \fIdatalen\fR that contains the
+file system-specific data for this mount and the \fBMS_DATA\fR flag should be
+set.
+.sp
+.LP
+If the \fBMS_OPTIONSTR\fR flag is set, then \fIoptptr\fR points to a buffer
+containing the list of options to be used for this mount. The \fIoptlen\fR
+argument specifies the length of the buffer. On completion of the \fBmount()\fR
+call, the options in effect for the mounted file system are returned in this
+buffer. If \fBMS_OPTIONSTR\fR is not specified, then the options for this mount
+will not appear in the mounted file systems table.
+.sp
+.LP
+If the caller does not have all privileges available in the current zone, the
+\fBnosuid\fR option is automatically set on the mount point. The \fBrestrict\fR
+option is automatically added for \fBautofs\fR mounts.
+.sp
+.LP
+If the caller is not in the global zone, the \fBnodevices\fR option is
+automatically set.
+.sp
+.LP
+The \fImflag\fR argument is constructed by a bitwise-inclusive-OR of flags from
+the following list, defined in <\fBsys/mount.h\fR>.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_DATA\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIdataptr\fR and \fIdatalen\fR arguments describe a block of file
+system-specific binary data at address \fIdataptr\fR of length \fIdatalen\fR.
+This is interpreted by file system-specific code within the operating system
+and its format depends on the file system type. If a particular file system
+type does not require this data, \fIdataptr\fR and \fIdatalen\fR should both be
+0.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_GLOBAL\fR\fR
+.ad
+.RS 16n
+.rt
+Mount a file system globally if the system is configured and booted as part of
+a cluster (see \fBclinfo\fR(1M)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_NOSUID\fR\fR
+.ad
+.RS 16n
+.rt
+Prevent programs that are marked set-user-\fBID\fR or set-group-\fBID\fR from
+executing (see \fBchmod\fR(1)). It also causes \fBopen\fR(2) to return
+\fBENXIO\fR when attempting to open block or character special files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_OPTIONSTR\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIoptptr\fR and \fIoptlen\fR arguments describe a character buffer at
+address \fIoptptr\fR of size \fIoptlen\fR. When calling \fBmount()\fR, the
+character buffer should contain a null-terminated string of options to be
+passed to the file system-specific code within the operating system. On a
+successful return, the file system-specific code will return the list of
+options recognized. Unrecognized options are ignored. The format of the string
+is a list of option names separated by commas. Options that have values (rather
+than binary options such as \fBsuid\fR or \fBnosuid\fR), are separated by
+"\fB=\fR" such as \fBdev=2c4046c\fR. Standard option names are defined in
+<\fBsys/mntent.h\fR>. Only strings defined in the "C" locale are supported. The
+maximum length option string that can be passed to or returned from a
+\fBmount()\fR call is defined by the \fBMAX_MNTOPT_STR\fR constant. The buffer
+should be long enough to contain more options than were passed in, as the state
+of any default options that were not passed in the input option string may also
+be returned in the recognized options list that is returned.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_OVERLAY\fR\fR
+.ad
+.RS 16n
+.rt
+Allow the file system to be mounted over an existing file system mounted on
+\fIdir\fR, making the underlying file system inaccessible. If a mount is
+attempted on a pre-existing mount point without setting this flag, the mount
+will fail.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_RDONLY\fR\fR
+.ad
+.RS 16n
+.rt
+Mount the file system for reading only. This flag should also be specified for
+file systems that are incapable of writing (for example, CDROM). Without this
+flag, writing is permitted according to individual file accessibility.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_REMOUNT\fR\fR
+.ad
+.RS 16n
+.rt
+Remount a read-only file system as read-write.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmount()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+The permission bits of the mount point do not permit read/write access or
+search permission is denied on a component of the path prefix.
+.sp
+The calling process is not the owner of the mountpoint.
+.sp
+The mountpoint is not a regular file or a directory and the caller does not
+have all privileges available in a its zone.
+.sp
+The special device device does not permit read access in the case of read-only
+mounts or read-write access in the case of read/write mounts.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIdir\fR argument is currently mounted on, is someone's current working
+directory, or is otherwise busy; or the device associated with \fIspec\fR is
+currently mounted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIspec\fR, \fIdir\fR, \fIfstype\fR, \fIdataptr\fR, or \fIoptptr\fR
+argument points outside the allocated address space of the process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The super block has an invalid magic number, the \fIfstype\fR is invalid, or
+\fIdir\fR is not an absolute path.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIspec\fR or
+\fIdir\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fIPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+None of the named files exists or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+The file system state in the super-block is not \fBFsOKAY\fR and \fImflag\fR
+requests write permission.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTBLK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIspec\fR argument is not a block special device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIdir\fR argument is not a directory, or a component of a path prefix is
+not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 16n
+.rt
+A global mount is attempted (the \fBMS_GLOBAL\fR flag is set in \fImflag\fR) on
+a machine which is not booted as a cluster; a local mount is attempted and
+\fIdir\fR is within a globally mounted file system; or a remount was attempted
+on a file system that does not support remounting.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 16n
+.rt
+The device associated with \fIspec\fR does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the option string to be returned in the \fIoptptr\fR argument
+exceeds the size of the buffer specified by \fIoptlen\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The {\fBPRIV_SYS_MOUNT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEREMOTE\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIspec\fR argument is remote and cannot be mounted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIspec\fR argument is write protected and \fImflag\fR requests write
+permission.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBmount()\fR function can be invoked only by processes with appropriate
+privileges.
+.SH SEE ALSO
+.sp
+.LP
+\fBmount\fR(1M), \fBumount\fR(2), \fBmnttab\fR(4)
+.SH NOTES
+.sp
+.LP
+\fBMS_OPTIONSTR\fR-type option strings should be used.
+.sp
+.LP
+Some flag bits set file system options that can also be passed in an option
+string. Options are first set from the option string with the last setting of
+an option in the string determining the value to be set by the option string.
+Any options controlled by flags are then applied, overriding any value set by
+the option string.
diff --git a/usr/src/man/man2/mprotect.2 b/usr/src/man/man2/mprotect.2
new file mode 100644
index 0000000000..1ebaafcec4
--- /dev/null
+++ b/usr/src/man/man2/mprotect.2
@@ -0,0 +1,165 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH mprotect 2 "12 Jan 1998" "SunOS 5.11" "System Calls"
+.SH NAME
+mprotect \- set protection of memory mapping
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/mman.h>
+
+\fBint\fR \fBmprotect\fR(\fBvoid *\fR\fIaddr\fR, \fBsize_t\fR \fIlen\fR, \fBint\fR \fIprot\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmprotect()\fR function changes the access protections on the mappings
+specified by the range [\fIaddr, addr + len\fR\|), rounding \fIlen\fR up to the
+next multiple of the page size as returned by \fBsysconf\fR(3C), to be that
+specified by \fIprot\fR. Legitimate values for \fIprot\fR are the same as those
+permitted for \fBmmap\fR(2) and are defined in <\fBsys/mman.h\fR> as:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_READ\fR\fR
+.ad
+.RS 14n
+.rt
+\fB/* page can be read */\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_WRITE\fR\fR
+.ad
+.RS 14n
+.rt
+\fB/* page can be written */\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_EXEC\fR\fR
+.ad
+.RS 14n
+.rt
+\fB/* page can be executed */\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPROT_NONE\fR\fR
+.ad
+.RS 14n
+.rt
+\fB/* page can not be accessed */\fR
+.RE
+
+.sp
+.LP
+When \fBmprotect()\fR fails for reasons other than \fBEINVAL\fR, the
+protections on some of the pages in the range [\fIaddr, addr + len\fR) may have
+been changed. If the error occurs on some page at \fIaddr2\fR, then the
+protections of all whole pages in the range [\fIaddr, addr2\fR] will have been
+modified.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmprotect()\fR returns \fB0\fR. Otherwise, it
+returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmprotect()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIprot\fR argument specifies a protection that violates the access
+permission the process has to the underlying memory object.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIlen\fR argument has a value equal to 0, or \fIaddr\fR is not a multiple
+of the page size as returned by \fBsysconf\fR(3C).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+Addresses in the range [\fIaddr, addr + len\fR) are invalid for the address
+space of a process, or specify one or more pages which are not mapped.
+.RE
+
+.sp
+.LP
+The \fBmprotect()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+The address range [\fIaddr, addr + len\fR) includes one or more pages that have
+been locked in memory and that were mapped \fB\fR\fBMAP_PRIVATE\fR\fB;\fR
+\fIprot\fR includes \fB\fR\fBPROT_WRITE\fR\fB;\fR and the system has
+insufficient resources to reserve memory for the private pages that may be
+created. These private pages may be created by store operations in the
+now-writable address range.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+\fBATTRIBUTE TYPE\fRATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBmmap\fR(2), \fBplock\fR(3C), \fBmlock\fR(3C), \fBmlockall\fR(3C),
+\fBsysconf\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/msgctl.2 b/usr/src/man/man2/msgctl.2
new file mode 100644
index 0000000000..fd65c0a00a
--- /dev/null
+++ b/usr/src/man/man2/msgctl.2
@@ -0,0 +1,179 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH msgctl 2 "22 Mar 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+msgctl \- message control operations
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/msg.h>
+
+\fBint\fR \fBmsgctl\fR(\fBint\fR \fImsqid\fR, \fBint\fR \fIcmd\fR, \fBstruct msqid_ds *\fR\fIbuf\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmsgctl()\fR function provides a variety of message control operations as
+specified by \fIcmd\fR. The following \fIcmd\fRs are available:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_STAT\fR\fR
+.ad
+.RS 12n
+.rt
+Place the current value of each member of the data structure associated with
+\fImsqid\fR into the structure pointed to by \fIbuf\fR. The contents of this
+structure are defined in \fBIntro\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_SET\fR\fR
+.ad
+.RS 12n
+.rt
+Set the value of the following members of the data structure associated with
+\fImsqid\fR to the corresponding value found in the structure pointed to by
+\fIbuf\fR:
+.sp
+.in +2
+.nf
+msg_perm.uid
+msg_perm.gid
+msg_perm.mode /* access permission bits only */
+msg_qbytes
+.fi
+.in -2
+
+This command can be executed only by a process that has either the
+{\fBPRIV_IPC_OWNER\fR} privilege or an effective user \fBID\fR equal to the
+value of \fBmsg_perm.cuid\fR or \fBmsg_perm.uid\fR in the data structure
+associated with \fImsqid\fR. Only a process with the
+{\fBPRIV_SYS_IPC_CONFIG\fR} privilege can raise the value of \fBmsg_qbytes\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_RMID\fR\fR
+.ad
+.RS 12n
+.rt
+Remove the message queue identifier specified by \fImsqid\fR from the system
+and destroy the message queue and data structure associated with it. This
+\fIcmd\fR can only be executed by a process that has an effective user \fBID\fR
+either with appropriate privileges asserted in the effective set or equal to
+the value of \fBmsg_perm.cuid\fR or \fBmsg_perm.uid\fR in the data structure
+associated with \fImsqid\fR. The \fIbuf\fR argument is ignored.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmsgctl()\fR returns \fB0\fR. Otherwise, it
+returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmsgctl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBIPC_STAT\fR and operation permission is denied to
+the calling process (see \fBIntro\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fImsqid\fR argument is not a valid message queue identifier; or the
+\fIcmd\fR argument is not a valid command or is \fBIPC_SET\fR and
+\fBmsg_perm.uid\fR or \fBmsg_perm.gid\fR is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBIPC_STAT\fR and \fIuid\fR or \fIgid\fR is too
+large to be stored in the structure pointed to by \fIbuf\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBIPC_RMID\fR or \fBIPC_SET\fR, the
+{\fBPRIV_SYS_IPC_OWNER\fR} privilege is not asserted in the effective set of
+the calling process, and is not equal to the value of \fBmsg_perm.cuid\fR or
+\fBmsg_perm.uid\fR in the data structure associated with \fImsqid\fR.
+.sp
+The \fIcmd\fR argument is \fBIPC_SET,\fR an attempt is being made to increase
+to the value of \fBmsg_qbytes\fR, and the {\fBPRIV_SYS_IPC_CONFIG\fR} privilege
+is not asserted in the effective set of the calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBmsgget\fR(2), \fBmsgrcv\fR(2), \fBmsgsnd\fR(2),
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/msgget.2 b/usr/src/man/man2/msgget.2
new file mode 100644
index 0000000000..8acc61aa7b
--- /dev/null
+++ b/usr/src/man/man2/msgget.2
@@ -0,0 +1,181 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1994, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH msgget 2 "14 Aug 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+msgget \- get message queue
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/msg.h>
+
+\fBint\fR \fBmsgget\fR(\fBkey_t\fR \fIkey\fR, \fBint\fR \fImsgflg\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmsgget()\fR argument returns the message queue identifier associated
+with \fIkey\fR.
+.sp
+.LP
+A message queue identifier and associated message queue and data structure (see
+\fBIntro\fR(2)) are created for \fIkey\fR if one of the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fIkey\fR is \fBIPC_PRIVATE\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fIkey\fR does not already have a message queue identifier associated with it,
+and (\fImsgflg\fR\fB&IPC_CREAT\fR) is true.
+.RE
+.sp
+.LP
+On creation, the data structure associated with the new message queue
+identifier is initialized as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_perm.cuid\fR, \fBmsg_perm.uid\fR, \fBmsg_perm.cgid\fR, and
+\fBmsg_perm.gid\fR are set to the effective user \fBID\fR and effective group
+\fBID,\fR respectively, of the calling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The low-order 9 bits of \fBmsg_perm.mode\fR are set to the low-order 9 bits of
+\fImsgflg\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_qnum\fR, \fBmsg_lspid\fR, \fBmsg_lrpid\fR, \fBmsg_stime\fR, and
+\fBmsg_rtime\fR are set to 0.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_ctime\fR is set to the current time.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_qbytes\fR is set to the system limit. See NOTES.
+.RE
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative integer representing a message queue
+identifier is returned. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is
+set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmsgget()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+A message queue identifier exists for \fIkey\fR, but operation permission (see
+\fBIntro\fR(2)) as specified by the low-order 9 bits of \fImsgflg\fR would not
+be granted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 10n
+.rt
+A message queue identifier exists for \fIkey\fR but
+(\fImsgflg\fR\fB&IPC_CREAT\fR) and (\fImsgflg\fR\fB&IPC_EXCL\fR) are both true.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 10n
+.rt
+A message queue identifier does not exist for \fIkey\fR and
+(\fImsgflg\fR\fB&IPC_CREAT\fR) is false.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 10n
+.rt
+A message queue identifier is to be created but the system-imposed limit on the
+maximum number of allowed message queue identifiers system wide would be
+exceeded. See NOTES.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBrctladm\fR(1M), \fBIntro\fR(2), \fBmsgctl\fR(2), \fBmsgrcv\fR(2),
+\fBmsgsnd\fR(2), \fBsetrctl\fR(2), \fBftok\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The system-defined limit used to initialize \fBmsg_qbytes\fR is the minimum
+enforced value of the calling process's \fBprocess.max-msg-qbytes\fR resource
+control.
+.sp
+.LP
+The system-imposed limit on the number of message queue identifiers is
+maintained on a per-project basis using the \fBproject.max-msg-ids\fR resource
+control. The \fBzone.max-msg-ids\fR resource control restricts the total amount
+of message queue identifiers that can be allocated by a zone.
+.sp
+.LP
+See \fBrctladm\fR(1M) and \fBsetrctl\fR(2) for information about using resource
+controls.
diff --git a/usr/src/man/man2/msgids.2 b/usr/src/man/man2/msgids.2
new file mode 100644
index 0000000000..1ef775c8bf
--- /dev/null
+++ b/usr/src/man/man2/msgids.2
@@ -0,0 +1,122 @@
+'\" te
+.\" Copyright (c) 2000, Sun Microsystems, Inc.
+.\" All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH msgids 2 "8 Mar 2000" "SunOS 5.11" "System Calls"
+.SH NAME
+msgids \- discover all message queue identifiers
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/msg.h>
+
+\fBint\fR \fBmsgids\fR(\fBint *\fR\fIbuf\fR, \fBuint_t\fR \fInids\fR, \fBuint_t *\fR\fIpnids\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmsgids()\fR function copies all active message queue identifiers from
+the system into the user-defined buffer specified by \fIbuf\fR, provided that
+the number of such identifiers is not greater than the number of integers the
+buffer can contain, as specified by \fInids\fR. If the size of the buffer is
+insufficient to contain all of the active message queue identifiers in the
+system, none are copied.
+.sp
+.LP
+Whether or not the size of the buffer is sufficient to contain all of them, the
+number of active message queue identifiers in the system is copied into the
+unsigned integer pointed to by \fIpnids\fR.
+.sp
+.LP
+If \fInids\fR is 0 or less than the number of active message queue identifiers
+in the system, \fIbuf\fR is ignored.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmsgids()\fR returns \fB0\fR. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmsgids()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR or \fIpnids\fR argument points to an illegal address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBmsgids()\fR function returns a snapshot of all the active message queue
+identifiers in the system. More may be added and some may be removed before
+they can be used by the caller.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fR\fBmsgids()\fR example
+.sp
+.LP
+This is sample C code indicating how to use the \fBmsgids()\fR function (see
+\fBmsgsnap\fR(2)):
+
+.sp
+.in +2
+.nf
+void
+examine_queues()
+{
+ int *ids = NULL;
+ uint_t nids = 0;
+ uint_t n;
+ int i;
+
+ for (;;) {
+ if (msgids(ids, nids, &n) != 0) {
+ perror("msgids");
+ exit(1);
+ }
+ if (n <= nids) /* we got them all */
+ break;
+ /* we need a bigger buffer */
+ ids = realloc(ids, (nids = n) * sizeof (int));
+ }
+
+ for (i = 0; i < n; i++)
+ process_msgid(ids[i]);
+
+ free(ids);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcrm\fR(1), \fBipcs\fR(1), \fBIntro\fR(2), \fBmsgctl\fR(2),
+\fBmsgget\fR(2), \fBmsgsnap\fR(2), \fBmsgrcv\fR(2), \fBmsgsnd\fR(2),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/msgrcv.2 b/usr/src/man/man2/msgrcv.2
new file mode 100644
index 0000000000..6fa0ac3681
--- /dev/null
+++ b/usr/src/man/man2/msgrcv.2
@@ -0,0 +1,261 @@
+'\" te
+.\" Copyright 1989 AT&T @(#)msgrcv.2 1.33 98/05/12 Copyright (c) 1999, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH msgrcv 2 "19 May 1999" "SunOS 5.11" "System Calls"
+.SH NAME
+msgrcv \- message receive operation
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/msg.h>
+
+\fBssize_t\fR \fBmsgrcv\fR(\fBint\fR \fImsqid\fR, \fBvoid *\fR\fImsgp\fR, \fBsize_t\fR \fImsgsz\fR,
+ \fBlong int\fR \fImsgtyp\fR, \fBint\fR \fImsgflg\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmsgrcv()\fR function reads a message from the queue associated with the
+message queue identifier specified by \fImsqid\fR and places it in the
+user-defined buffer pointed to by \fImsgp\fR.
+.sp
+.LP
+The \fImsgp\fR argument points to a user-defined buffer that must contain first
+a field of type \fBlong int\fR that will specify the type of the message, and
+then a data portion that will hold the data bytes of the message. The structure
+below is an example of what this user-defined buffer might look like:
+.sp
+.in +2
+.nf
+struct mymsg {
+ long int mtype; /* message type */
+ char mtext[1]; /* message text */
+}
+.fi
+.in -2
+
+.sp
+.LP
+The \fBmtype\fR member is the received message's type as specified by the
+sending process.
+.sp
+.LP
+The \fBmtext\fR member is the text of the message.
+.sp
+.LP
+The \fImsgsz\fR argument specifies the size in bytes of \fBmtext\fR. The
+received message is truncated to \fImsgsz\fR bytes if it is larger than
+\fImsgsz\fR and (\fImsgflg\fR\fB&MSG_NOERROR\fR) is non-zero. The truncated
+part of the message is lost and no indication of the truncation is given to the
+calling process.
+.sp
+.LP
+The \fImsgtyp\fR argument specifies the type of message requested as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fImsgtyp\fR is 0, the first message on the queue is received.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fImsgtyp\fR is greater than 0, the first message of type \fImsgtyp\fR is
+received.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fImsgtyp\fR is less than 0, the first message of the lowest type that is
+less than or equal to the absolute value of \fImsgtyp\fR is received.
+.RE
+.sp
+.LP
+The \fImsgflg\fR argument specifies which of the following actions is to be
+taken if a message of the desired type is not on the queue:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If (\fImsgflg\fR\fB&IPC_NOWAIT\fR) is non-zero, the calling process will return
+immediately with a return value of \(mi1 and \fBerrno\fR set to \fBENOMSG\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If (\fImsgflg\fR\fB&IPC_NOWAIT\fR) is 0, the calling process will suspend
+execution until one of the following occurs:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+A message of the desired type is placed on the queue.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The message queue identifier \fImsqid\fR is removed from the system (see
+\fBmsgctl\fR(2)); when this occurs, \fBerrno\fR is set equal to \fBEIDRM\fR and
+\fB\(mi1\fR is returned.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The calling process receives a signal that is to be caught; in this case a
+message is not received and the calling process resumes execution in the manner
+prescribed in \fBsigaction\fR(2).
+.RE
+.RE
+.sp
+.LP
+Upon successful completion, the following actions are taken with respect to the
+data structure associated with \fImsqid\fR (see \fBIntro\fR(2)):
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_qnum\fR is decremented by 1.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_lrpid\fR is set equal to the process \fBID\fR of the calling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_rtime\fR is set equal to the current time.
+.RE
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmsgrcv()\fR returns a value equal to the number
+of bytes actually placed into the buffer \fImtext\fR. Otherwise, \fB\(mi1\fR is
+returned, no message is received, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmsgrcv()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE2BIG\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fBmtext\fR is greater than \fImsgsz\fR and
+(\fImsgflg\fR\fB&MSG_NOERROR\fR) is 0.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+Operation permission is denied to the calling process. See \fBIntro\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIDRM\fR\fR
+.ad
+.RS 10n
+.rt
+The message queue identifier \fImsqid\fR is removed from the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBmsgrcv()\fR function was interrupted by a signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fImsqid\fR argument is not a valid message queue identifier.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMSG\fR\fR
+.ad
+.RS 10n
+.rt
+The queue does not contain a message of the desired type and
+(\fImsgflg\fR\fB&IPC_NOWAIT\fR) is non-zero.
+.RE
+
+.sp
+.LP
+The \fBmsgrcv()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB \fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fImsgp\fR argument points to an illegal address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The value passed as the \fImsgp\fR argument should be converted to type \fBvoid
+*\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBmsgctl\fR(2), \fBmsgget\fR(2), \fBmsgsnd\fR(2),
+\fBsigaction\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/msgsnap.2 b/usr/src/man/man2/msgsnap.2
new file mode 100644
index 0000000000..e1f707688f
--- /dev/null
+++ b/usr/src/man/man2/msgsnap.2
@@ -0,0 +1,217 @@
+'\" te
+.\" Copyright (c) 2000, Sun Microsystems, Inc.
+.\" All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH msgsnap 2 "8 Mar 2000" "SunOS 5.11" "System Calls"
+.SH NAME
+msgsnap \- message queue snapshot operation
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/msg.h>
+
+\fB\fR\fBmsgsnap\fR(\fBint\fR \fImsqid\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIbufsz\fR, \fBlong\fR \fImsgtyp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmsgsnap()\fR function reads all of the messages of type \fImsgtyp\fR
+from the queue associated with the message queue identifier specified by
+\fImsqid\fR and places them in the user-defined buffer pointed to by \fIbuf\fR.
+.sp
+.LP
+The \fIbuf\fR argument points to a user-defined buffer that on return will
+contain first a buffer header structure:
+.sp
+.in +2
+.nf
+struct msgsnap_head {
+ size_t msgsnap_size; /* bytes used/required in the buffer */
+ size_t msgsnap_nmsg; /* number of messages in the buffer */
+};
+.fi
+.in -2
+
+.sp
+.LP
+followed by \fBmsgsnap_nmsg\fR messages, each of which starts with a message
+header:
+.sp
+.in +2
+.nf
+struct msgsnap_mhead {
+ size_t msgsnap_mlen; /* number of bytes in the message */
+ long msgsnap_mtype; /* message type */
+};
+.fi
+.in -2
+
+.sp
+.LP
+and followed by \fBmsgsnap_mlen\fR bytes containing the message contents.
+.sp
+.LP
+Each subsequent message header is located at the first byte following the
+previous message contents, rounded up to a \fBsizeof(size_t)\fR boundary.
+.sp
+.LP
+The \fIbufsz\fR argument specifies the size of \fIbuf\fR in bytes. If
+\fIbufsz\fR is less than \fBsizeof(msgsnap_head)\fR, \fBmsgsnap()\fR fails with
+\fBEINVAL\fR. If \fIbufsz\fR is insufficient to contain all of the requested
+messages, \fBmsgsnap()\fR succeeds but returns with \fBmsgsnap_nmsg\fR set to 0
+and with \fBmsgsnap_size\fR set to the required size of the buffer in bytes.
+.sp
+.LP
+The \fImsgtyp\fR argument specifies the types of messages requested as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fImsgtyp\fR is 0, all of the messages on the queue are read.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fImsgtyp\fR is greater than 0, all messages of type \fImsgtyp\fR are read.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fImsgtyp\fR is less than 0, all messages with type less than or equal to
+the absolute value of \fImsgtyp\fR are read.
+.RE
+.sp
+.LP
+The \fBmsgsnap()\fR function is a non-destructive operation. Upon completion,
+no changes are made to the data structures associated with \fImsqid\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmsgsnap()\fR returns \fB0\fR. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmsgsnap()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+Operation permission is denied to the calling process. See \fBIntro\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fImsqid\fR argument is not a valid message queue identifier or the value
+of \fIbufsz\fR is less than \fBsizeof(struct msgsnap_head)\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBmsgsnap()\fR function returns a snapshot of messages on a message queue
+at one point in time. The queue contents can change immediately following
+return from \fBmsgsnap()\fR.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fR\fBmsgsnap()\fR example
+.sp
+.LP
+This is sample C code indicating how to use the msgsnap function (see
+\fBmsgids\fR(2)).
+
+.sp
+.in +2
+.nf
+void
+process_msgid(int msqid)
+{
+ size_t bufsize;
+ struct msgsnap_head *buf;
+ struct msgsnap_mhead *mhead;
+ int i;
+
+ /* allocate a minimum-size buffer */
+ buf = malloc(bufsize = sizeof(struct msgsnap_head));
+
+ /* read all of the messages from the queue */
+ for (;;) {
+ if (msgsnap(msqid, buf, bufsize, 0) != 0) {
+ perror("msgsnap");
+ free(buf);
+ return;
+ }
+ if (bufsize >= buf->msgsnap_size) /* we got them all */
+ break;
+ /* we need a bigger buffer */
+ buf = realloc(buf, bufsize = buf->msgsnap_size);
+ }
+
+ /* process each message in the queue (there may be none) */
+ mhead = (struct msgsnap_mhead *)(buf + 1); /* first message */
+ for (i = 0; i < buf->msgsnap_nmsg; i++) {
+ size_t mlen = mhead->msgsnap_mlen;
+
+ /* process the message contents */
+ process_message(mhead->msgsnap_mtype, (char *)(mhead+1), mlen);
+
+ /* advance to the next message header */
+ mhead = (struct msgsnap_mhead *)
+ ((char *)mhead + sizeof(struct msgsnap_mhead) +
+ ((mlen + sizeof(size_t) - 1) & ~(sizeof(size_t) - 1)));
+ }
+
+ free(buf);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcrm\fR(1), \fBipcs\fR(1), \fBIntro\fR(2), \fBmsgctl\fR(2),
+\fBmsgget\fR(2), \fBmsgids\fR(2), \fBmsgrcv\fR(2), \fBmsgsnd\fR(2),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/msgsnd.2 b/usr/src/man/man2/msgsnd.2
new file mode 100644
index 0000000000..7cd4dd6b11
--- /dev/null
+++ b/usr/src/man/man2/msgsnd.2
@@ -0,0 +1,250 @@
+'\" te
+.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH msgsnd 2 "11 Feb 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+msgsnd \- message send operation
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/msg.h>
+
+\fBint\fR \fBmsgsnd\fR(\fBint\fR \fImsqid\fR, \fBconst void *\fR\fImsgp\fR, \fBsize_t\fR \fImsgsz\fR, \fBint\fR \fImsgflg\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmsgsnd()\fR function is used to send a message to the queue associated
+with the message queue identifier specified by \fImsqid\fR.
+.sp
+.LP
+The \fImsgp\fR argument points to a user-defined buffer that must contain first
+a field of type \fBlong int\fR that will specify the type of the message, and
+then a data portion that will hold the data bytes of the message. The structure
+below is an example of what this user-defined buffer might look like:
+.sp
+.in +2
+.nf
+struct mymsg {
+ long mtype; /* message type */
+ char mtext[1]; /* message text */
+}
+.fi
+.in -2
+
+.sp
+.LP
+The \fBmtype\fR member is a non-zero positive type \fBlong int\fR that can be
+used by the receiving process for message selection.
+.sp
+.LP
+The \fBmtext\fR member is any text of length \fImsgsz\fR bytes. The \fImsgsz\fR
+argument can range from 0 to a system-imposed maximum.
+.sp
+.LP
+The \fImsgflg\fR argument specifies the action to be taken if one or more of
+the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The number of bytes already on the queue is equal to \fBmsg_qbytes\fR. See
+\fBIntro\fR(2).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The total number of messages on the queue would exceed the maximum allowed by
+the system. See NOTES.
+.RE
+.sp
+.LP
+These actions are as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If (\fImsgflg\fR\fB&IPC_NOWAIT\fR) is non-zero, the message will not be sent
+and the calling process will return immediately.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If (\fImsgflg\fR\fB&IPC_NOWAIT\fR) is 0, the calling process will suspend
+execution until one of the following occurs:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The condition responsible for the suspension no longer exists, in which case
+the message is sent.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The message queue identifier \fImsqid\fR is removed from the system (see
+\fBmsgctl\fR(2)); when this occurs, \fBerrno\fR is set equal to \fBEIDRM\fR and
+\fB\(mi1\fR is returned.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The calling process receives a signal that is to be caught; in this case the
+message is not sent and the calling process resumes execution in the manner
+prescribed in \fBsigaction\fR(2).
+.RE
+.RE
+.sp
+.LP
+Upon successful completion, the following actions are taken with respect to the
+data structure associated with \fImsqid\fR (see \fBIntro\fR(2)):
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_qnum\fR is incremented by 1.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_lspid\fR is set equal to the process \fBID\fR of the calling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBmsg_stime\fR is set equal to the current time.
+.RE
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, no message is sent, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBmsgsnd()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+Operation permission is denied to the calling process. See \fBIntro\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+The message cannot be sent for one of the reasons cited above and
+(\fImsgflg\fR\fB&IPC_NOWAIT\fR) is non-zero.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIDRM\fR\fR
+.ad
+.RS 10n
+.rt
+The message queue identifier \fImsgid\fR is removed from the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBmsgsnd()\fR function was interrupted by a signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fImsqid\fR is not a valid message queue identifier, or the value
+of \fBmtype\fR is less than 1.
+.sp
+The value of \fImsgsz\fR is less than 0 or greater than the system-imposed
+limit.
+.RE
+
+.sp
+.LP
+The \fBmsgsnd()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB \fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fImsgp\fR argument points to an illegal address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The value passed as the \fImsgp\fR argument should be converted to type \fBvoid
+*\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBrctladm\fR(1M), \fBIntro\fR(2), \fBmsgctl\fR(2), \fBmsgget\fR(2),
+\fBmsgrcv\fR(2), \fBsetrctl\fR(2), \fBsigaction\fR(2), \fBattributes\fR(5),
+\fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The maximum number of messages allowed on a message queue is the minimum
+enforced value of the \fBprocess.max-msg-messages\fR resource control of the
+creating process at the time \fBmsgget\fR(2) was used to allocate the queue.
+.sp
+.LP
+ See \fBrctladm\fR(1M) and \fBsetrctl\fR(2) for information about using
+resource controls.
diff --git a/usr/src/man/man2/munmap.2 b/usr/src/man/man2/munmap.2
new file mode 100644
index 0000000000..c86f398bae
--- /dev/null
+++ b/usr/src/man/man2/munmap.2
@@ -0,0 +1,78 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH munmap 2 "5 Jan 1998" "SunOS 5.11" "System Calls"
+.SH NAME
+munmap \- unmap pages of memory
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/mman.h>
+
+\fBint\fR \fBmunmap\fR(\fBvoid *\fR\fIaddr\fR, \fBsize_t\fR \fIlen\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBmunmap()\fR function removes the mappings for pages in the range
+[\fIaddr, addr + len\fR), rounding the \fIlen\fR argument up to the next
+multiple of the page size as returned by \fBsysconf\fR(3C). If \fIaddr\fR is
+not the address of a mapping established by a prior call to \fBmmap\fR(2), the
+behavior is undefined. After a successful call to \fBmunmap()\fR and before any
+subsequent mapping of the unmapped pages, further references to these pages
+will result in the delivery of a \fBSIGBUS\fR or \fBSIGSEGV\fR signal to the
+process.
+.sp
+.LP
+The \fBmmap\fR(2) function often performs an implicit \fBmunmap()\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBmunmap()\fR returns \fB0\fR; otherwise, it
+returns \fB\(mi1\fR and sets \fBerrno\fR to indicate an error.
+.SH ERRORS
+.sp
+.LP
+The \fBmunmap()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIaddr\fR argument is not a multiple of the page size as returned by
+\fBsysconf\fR(3C); addresses in the range [\fIaddr, addr + len\fR) are outside
+the valid range for the address space of a process; or the \fIlen\fR argument
+has a value less than or equal to \fB0\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBmmap\fR(2), \fBsysconf\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/nice.2 b/usr/src/man/man2/nice.2
new file mode 100644
index 0000000000..4d943e949d
--- /dev/null
+++ b/usr/src/man/man2/nice.2
@@ -0,0 +1,115 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH nice 2 "1 Apr 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+nice \- change priority of a process
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBnice\fR(\fBint\fR \fIincr\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBnice()\fR function allows a process to change its priority. The
+invoking process must be in a scheduling class that supports the \fBnice()\fR.
+.sp
+.LP
+The \fBnice()\fR function adds the value of \fIincr\fR to the nice value of
+the calling process. A process's nice value is a non-negative number for which
+a greater positive value results in lower \fBCPU\fR priority.
+.sp
+.LP
+A maximum nice value of (2 * \fBNZERO\fR) \(mi1 and a minimum nice value of 0
+are imposed by the system. \fBNZERO\fR is defined in <\fBlimits.h\fR> with a
+default value of 20. Requests for values above or below these limits result in
+the nice value being set to the corresponding limit. A nice value of 40 is
+treated as 39.
+.sp
+.LP
+Calling the \fBnice()\fR function has no effect on the priority of processes or
+threads with policy \fBSCHED_FIFO\fR or \fBSCHED_RR\fR.
+.sp
+.LP
+Only a process with the {\fBPRIV_PROC_PRIOCNTL\fR} privilege can lower the nice
+value.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBnice()\fR returns the new nice value minus
+\fBNZERO\fR. Otherwise, \(mi1 is returned, the process's \fInice\fR value is
+not changed, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBnice()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBnice()\fR function is called by a process in a scheduling class other
+than time-sharing or fixed-priority.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIincr\fR argument is negative or greater than 40 and the
+{\fBPRIV_PROC_PRIOCNTL\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBpriocntl\fR(2) function is a more general interface to scheduler
+functions.
+.sp
+.LP
+Since \(mi1 is a permissible return value in a successful situation, an
+application wishing to check for error situations should set \fBerrno\fR to 0,
+then call \fBnice()\fR, and if it returns \fB\(mi1\fR, check to see if
+\fBerrno\fR is non-zero.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBnice\fR(1), \fBexec\fR(2), \fBpriocntl\fR(2), \fBgetpriority\fR(3C),
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/ntp_adjtime.2 b/usr/src/man/man2/ntp_adjtime.2
new file mode 100644
index 0000000000..17d9f6665c
--- /dev/null
+++ b/usr/src/man/man2/ntp_adjtime.2
@@ -0,0 +1,108 @@
+'\" te
+.\" Copyright (c) David L. Mills 1992, 1993, 1994, 1995, 1996, 1997
+.\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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. 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. 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]
+.TH ntp_adjtime 2 "21 May 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+ntp_adjtime \- adjust local clock parameters
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/timex.h>
+
+\fBint\fR \fBntp_adjtime\fR(\fBstruct timex *\fR\fItptr\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBntp_adjtime()\fR function adjusts the parameters used to discipline the
+local clock, according to the values in the struct \fBtimex\fR pointed to by
+\fItptr\fR. Before returning, it fills in the structure with the most recent
+values kept in the kernel.
+.sp
+.LP
+The adjustment is effected in part by speeding up or slowing down the clock, as
+necessary, and in part by phase-locking onto a once-per second pulse (PPS)
+provided by a driver, if available.
+.sp
+.in +2
+.nf
+struct timex {
+ uint32_t modes; /* clock mode bits (w) */
+ int32_t offset; /* time offset (us) (rw) */
+ int32_t freq; /* frequency offset (scaled ppm) (rw) */
+ int32_t maxerror; /* maximum error (us) (rw) */
+ int32_t esterror; /* estimated error (us) (rw) */
+ int32_t status; /* clock status bits (rw) */
+ int32_t constant; /* pll time constant (rw) */
+ int32_t precision; /* clock precision (us) (r) */
+ int32_t tolerance; /* clock frequency tolerance
+ (scaled ppm) (r) */
+ int32_t ppsfreq; /* pps frequency (scaled ppm) (r) */
+ int32_t jitter; /* pps jitter (us) (r) */
+ int32_t shift; /* interval duration (s) (shift) (r) */
+ int32_t stabil; /* pps stability (scaled ppm) (r) */
+ int32_t jitcnt; /* jitter limit exceeded (r) */
+ int32_t calcnt; /* calibration intervals (r) */
+ int32_t errcnt; /* calibration errors (r) */
+ int32_t stbcnt; /* stability limit exceeded (r) */
+};
+.fi
+.in -2
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBntp_adjtime()\fR returns the current clock state
+(see <\fBsys/timex.h\fR>). Otherwise, it returns \fB\(mi1\fR and sets
+\fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBntp_adjtime()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItptr\fR argument is an invalid pointer.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBconstant\fR member of the structure pointed to by \fItptr\fR is less
+than 0 or greater than 30.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_TIME\fR} privilege is not asserted in the effective set of the
+calling process.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBntp_gettime\fR(2), \fBprivileges\fR(5)
+.sp
+.LP
+See the \fBntpd\fR man page, delivered in the \fBSUNWntpu\fR package (not a
+SunOS man page).
diff --git a/usr/src/man/man2/ntp_gettime.2 b/usr/src/man/man2/ntp_gettime.2
new file mode 100644
index 0000000000..687187a5f9
--- /dev/null
+++ b/usr/src/man/man2/ntp_gettime.2
@@ -0,0 +1,80 @@
+'\" te
+.\" Copyright (c) David L. Mills 1992, 1993, 1994, 1995, 1996, 1997
+.\" Portions Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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. 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. 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]
+.TH ntp_gettime 2 "21 May 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+ntp_gettime \- get local clock values
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/timex.h>
+
+\fBint\fR \fBntp_gettime\fR(\fBstruct ntptimeval *\fR\fItptr\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBntp_gettime()\fR function reads the local clock value and dispersion,
+returning the information in \fItptr\fR.
+.sp
+.LP
+The \fBntptimeval\fR structure contains the following members:
+.sp
+.in +2
+.nf
+struct ntptimeval {
+ struct timeval time; /* current time (ro) */
+ int32_t maxerror; /* maximum error (us) (ro) */
+ int32_t esterror; /* estimated error (us) (ro) */
+};
+.fi
+.in -2
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBntp_gettime()\fR returns the current clock state
+(see <\fBsys/timex.h\fR>). Otherwise, it returns \fB\(mi1\fR and sets
+\fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBntp_gettime()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItptr\fR argument points to an invalid address.
+.RE
+
+.sp
+.LP
+The \fBntp_gettime()\fR function will fail for 32-bit interfaces if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The size of the \fBtime.tv_sec\fR member of the \fBntptimeval\fR structure
+pointed to by \fItptr\fR is too small to contain the correct number of seconds.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBntp_adjtime\fR(2)
+.sp
+.LP
+See the \fBntpd\fR man page, delivered in the \fBSUNWntpu\fR package (not a
+SunOS man page).
diff --git a/usr/src/man/man2/open.2 b/usr/src/man/man2/open.2
new file mode 100644
index 0000000000..348b55522a
--- /dev/null
+++ b/usr/src/man/man2/open.2
@@ -0,0 +1,1001 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH open 2 "16 Jun 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+open, openat \- open a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+\fBint\fR \fBopen\fR(\fBconst char *\fR\fIpath\fR, \fBint\fR \fIoflag\fR, \fB/* mode_t\fR \fImode\fR */);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBopenat\fR(\fBint\fR \fIfildes\fR, \fBconst char *\fR\fIpath\fR, \fBint\fR \fIoflag\fR,
+ \fB/* mode_t\fR \fImode\fR */);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBopen()\fR function establishes the connection between a file and a file
+descriptor. It creates an open file description that refers to a file and a
+file descriptor that refers to that open file description. The file descriptor
+is used by other I/O functions to refer to that file. The \fIpath\fR argument
+points to a pathname naming the file.
+.sp
+.LP
+The \fBopenat()\fR function is identical to the \fBopen()\fR function except
+that the \fIpath\fR argument is interpreted relative to the starting point
+implied by the \fIfildes\fR argument. If the \fIfildes\fR argument has the
+special value \fBAT_FDCWD\fR, a relative path argument will be resolved
+relative to the current working directory. If the \fIpath\fR argument is
+absolute, the \fIfildes\fR argument is ignored.
+.sp
+.LP
+The \fBopen()\fR function returns a file descriptor for the named file that is
+the lowest file descriptor not currently open for that process. The open file
+description is new, and therefore the file descriptor does not share it with
+any other process in the system. The \fBFD_CLOEXEC\fR file descriptor flag
+associated with the new file descriptor is cleared.
+.sp
+.LP
+The file offset used to mark the current position within the file is set to the
+beginning of the file.
+.sp
+.LP
+The file status flags and file access modes of the open file description are
+set according to the value of \fIoflag\fR. The \fImode\fR argument is used only
+when \fBO_CREAT\fR is specified (see below.)
+.sp
+.LP
+Values for \fIoflag\fR are constructed by a bitwise-inclusive-OR of flags from
+the following list, defined in <\fBfcntl.h\fR>. Applications must specify
+exactly one of the first three values (file access modes) below in the value of
+\fIoflag\fR:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_RDONLY\fR\fR
+.ad
+.RS 12n
+.rt
+Open for reading only.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_WRONLY\fR\fR
+.ad
+.RS 12n
+.rt
+Open for writing only.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_RDWR\fR\fR
+.ad
+.RS 12n
+.rt
+Open for reading and writing. The result is undefined if this flag is applied
+to a FIFO.
+.RE
+
+.sp
+.LP
+Any combination of the following may be used:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_APPEND\fR\fR
+.ad
+.sp .6
+.RS 4n
+If set, the file offset is set to the end of the file prior to each write.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_CREAT\fR\fR
+.ad
+.sp .6
+.RS 4n
+Create the file if it does not exist. This flag requires that the \fImode\fR
+argument be specified.
+.sp
+If the file exists, this flag has no effect except as noted under \fBO_EXCL\fR
+below. Otherwise, the file is created with the user \fBID\fR of the file set
+to the effective user \fBID\fR of the process. The group \fBID\fR of the file
+is set to the effective group \fBIDs\fR of the process, or if the \fBS_ISGID\fR
+bit is set in the directory in which the file is being created, the file's
+group \fBID\fR is set to the group \fBID\fR of its parent directory. If the
+group \fBID\fR of the new file does not match the effective group \fBID\fR or
+one of the supplementary groups IDs, the \fBS_ISGID\fR bit is cleared. The
+access permission bits (see \fB<sys/stat.h>\fR) of the file mode are set to the
+value of \fImode\fR, modified as follows (see \fBcreat\fR(2)): a bitwise-AND is
+performed on the file-mode bits and the corresponding bits in the complement of
+the process's file mode creation mask. Thus, all bits set in the process's file
+mode creation mask (see \fBumask\fR(2)) are correspondingly cleared in the
+file's permission mask. The "save text image after execution bit" of the mode
+is cleared (see \fBchmod\fR(2)). \fBO_SYNC\fR Write I/O operations on the file
+descriptor complete as defined by synchronized I/O file integrity completion
+(see \fBfcntl.h\fR(3HEAD) definition of \fBO_SYNC\fR.) When bits other than the
+file permission bits are set, the effect is unspecified. The \fImode\fR
+argument does not affect whether the file is open for reading, writing or for
+both.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_DSYNC\fR\fR
+.ad
+.sp .6
+.RS 4n
+Write I/O operations on the file descriptor complete as defined by synchronized
+I/O data integrity completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_EXCL\fR\fR
+.ad
+.sp .6
+.RS 4n
+If \fBO_CREAT\fR and \fBO_EXCL\fR are set, \fBopen()\fR fails if the file
+exists. The check for the existence of the file and the creation of the file if
+it does not exist is atomic with respect to other threads executing
+\fBopen()\fR naming the same filename in the same directory with \fBO_EXCL\fR
+and \fBO_CREAT\fR set. If \fBO_EXCL\fR and \fBO_CREAT\fR are set, and path
+names a symbolic link, \fBopen()\fR fails and sets \fBerrno\fR to \fBEEXIST\fR,
+regardless of the contents of the symbolic link. If \fBO_EXCL\fR is set and
+\fBO_CREAT\fR is not set, the result is undefined.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_LARGEFILE\fR\fR
+.ad
+.sp .6
+.RS 4n
+If set, the offset maximum in the open file description is the largest value
+that can be represented correctly in an object of type \fBoff64_t\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_NOCTTY\fR\fR
+.ad
+.sp .6
+.RS 4n
+If set and \fIpath\fR identifies a terminal device, \fBopen()\fR does not cause
+the terminal device to become the controlling terminal for the process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_NOFOLLOW\fR\fR
+.ad
+.sp .6
+.RS 4n
+If the path names a symbolic link, \fBopen()\fR fails and sets \fBerrno\fR to
+\fBELOOP\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_NOLINKS\fR\fR
+.ad
+.sp .6
+.RS 4n
+If the link count of the named file is greater than 1, \fBopen()\fR fails and
+sets \fBerrno\fR to \fBEMLINK\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_NONBLOCK\fR or \fBO_NDELAY\fR\fR
+.ad
+.sp .6
+.RS 4n
+These flags can affect subsequent reads and writes (see \fBread\fR(2) and
+\fBwrite\fR(2)). If both \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are set,
+\fBO_NONBLOCK\fR takes precedence.
+.sp
+When opening a \fBFIFO\fR with \fBO_RDONLY\fR or \fBO_WRONLY\fR set:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR or \fBO_NDELAY\fR is set, an \fBopen()\fR for reading only
+returns without delay. An \fBopen()\fR for writing only returns an error if no
+process currently has the file open for reading.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR and \fBO_NDELAY\fR are clear, an \fBopen()\fR for reading
+only blocks until a thread opens the file for writing. An \fBopen()\fR for
+writing only blocks the calling thread until a thread opens the file for
+reading.
+.RE
+After both ends of a \fBFIFO\fR have been opened, there is no guarantee that
+further calls to \fBopen()\fR \fBO_RDONLY\fR (\fBO_WRONLY\fR) will synchronize
+with later calls to \fBopen()\fR \fBO_WRONLY\fR (\fBO_RDONLY\fR) until both
+ends of the \fBFIFO\fR have been closed by all readers and writers. Any data
+written into a \fBFIFO\fR will be lost if both ends of the \fBFIFO\fR are
+closed before the data is read.
+.sp
+When opening a block special or character special file that supports
+non-blocking opens:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR or \fBO_NDELAY\fR is set, the \fBopen()\fR function returns
+without blocking for the device to be ready or available. Subsequent behavior
+of the device is device-specific.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR and \fBO_NDELAY\fR are clear, the \fBopen()\fR function
+blocks the calling thread until the device is ready or available before
+returning.
+.RE
+Otherwise, the behavior of \fBO_NONBLOCK\fR and \fBO_NDELAY\fR is unspecified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_RSYNC\fR\fR
+.ad
+.sp .6
+.RS 4n
+Read I/O operations on the file descriptor complete at the same level of
+integrity as specified by the \fBO_DSYNC\fR and \fBO_SYNC\fR flags. If both
+\fBO_DSYNC\fR and \fBO_RSYNC\fR are set in \fIoflag\fR, all I/O operations on
+the file descriptor complete as defined by synchronized I/O data integrity
+completion. If both \fBO_SYNC\fR and \fBO_RSYNC\fR are set in \fIoflag\fR, all
+I/O operations on the file descriptor complete as defined by synchronized I/O
+file integrity completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_SYNC\fR\fR
+.ad
+.sp .6
+.RS 4n
+Write I/O operations on the file descriptor complete as defined by synchronized
+I/O file integrity completion.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_TRUNC\fR\fR
+.ad
+.sp .6
+.RS 4n
+If the file exists and is a regular file, and the file is successfully opened
+\fBO_RDWR\fR or \fBO_WRONLY\fR, its length is truncated to 0 and the mode and
+owner are unchanged. It has no effect on \fBFIFO\fR special files or terminal
+device files. Its effect on other file types is implementation-dependent. The
+result of using \fBO_TRUNC\fR with \fBO_RDONLY\fR is undefined.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBO_XATTR\fR\fR
+.ad
+.sp .6
+.RS 4n
+If set in \fBopenat()\fR, a relative path argument is interpreted as a
+reference to an extended attribute of the file associated with the supplied
+file descriptor. This flag therefore requires the presence of a legal
+\fIfildes\fR argument. If set in \fBopen()\fR, the implied file descriptor is
+that for the current working directory. Extended attributes must be referenced
+with a relative path; providing an absolute path results in a normal file
+reference.
+.RE
+
+.sp
+.LP
+If \fBO_CREAT\fR is set and the file did not previously exist, upon successful
+completion, \fBopen()\fR marks for update the \fBst_atime\fR, \fBst_ctime\fR,
+and \fBst_mtime\fR fields of the file and the \fBst_ctime\fR and \fBst_mtime\fR
+fields of the parent directory.
+.sp
+.LP
+If \fBO_TRUNC\fR is set and the file did previously exist, upon successful
+completion, \fBopen()\fR marks for update the \fBst_ctime\fR and \fBst_mtime\fR
+fields of the file.
+.sp
+.LP
+If both the \fBO_SYNC\fR and \fBO_DSYNC\fR flags are set, the effect is as if
+only the \fBO_SYNC\fR flag was set.
+.sp
+.LP
+If \fIpath\fR refers to a \fBSTREAMS\fR file, \fIoflag\fR may be constructed
+from \fBO_NONBLOCK\fR or \fBO_NODELAY\fR OR-ed with either \fBO_RDONLY\fR,
+\fBO_WRONLY\fR, or \fBO_RDWR\fR. Other flag values are not applicable to
+\fBSTREAMS\fR devices and have no effect on them. The values \fBO_NONBLOCK\fR
+and \fBO_NODELAY\fR affect the operation of \fBSTREAMS\fR drivers and certain
+functions (see \fBread\fR(2), \fBgetmsg\fR(2), \fBputmsg\fR(2), and
+\fBwrite\fR(2)) applied to file descriptors associated with \fBSTREAMS\fR
+files. For \fBSTREAMS\fR drivers, the implementation of \fBO_NONBLOCK\fR and
+\fBO_NODELAY\fR is device-specific.
+.sp
+.LP
+When \fBopen()\fR is invoked to open a named stream, and the \fBconnld\fR
+module (see \fBconnld\fR(7M)) has been pushed on the pipe, \fBopen()\fR blocks
+until the server process has issued an \fBI_RECVFD\fR \fBioctl()\fR (see
+\fBstreamio\fR(7I)) to receive the file descriptor.
+.sp
+.LP
+If \fIpath\fR names the master side of a pseudo-terminal device, then it is
+unspecified whether \fBopen()\fR locks the slave side so that it cannot be
+opened. Portable applications must call \fBunlockpt\fR(3C) before opening the
+slave side.
+.sp
+.LP
+If the file is a regular file and the local file system is mounted with the
+\fBnbmand\fR mount option, then a mandatory share reservation is automatically
+obtained on the file. The share reservation is obtained as if \fBfcntl\fR(2)
+were called with \fIcmd\fR \fBF_SHARE_NBMAND\fR and the \fBfshare_t\fR values
+set as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBf_access\fR\fR
+.ad
+.RS 12n
+.rt
+Set to the type of read/write access for which the file is opened.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBf_deny\fR\fR
+.ad
+.RS 12n
+.rt
+\fBF_NODNY\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBf_id\fR\fR
+.ad
+.RS 12n
+.rt
+The file descriptor value returned from \fBopen()\fR.
+.RE
+
+.sp
+.LP
+If \fIpath\fR is a symbolic link and \fBO_CREAT\fR and \fBO_EXCL\fR are set,
+the link is not followed.
+.sp
+.LP
+Certain flag values can be set following \fBopen()\fR as described in
+\fBfcntl\fR(2).
+.sp
+.LP
+The largest value that can be represented correctly in an object of type
+\fBoff_t\fR is established as the offset maximum in the open file description.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the \fBopen()\fR function opens the file and return
+a non-negative integer representing the lowest numbered unused file descriptor.
+Otherwise, \fB\(mi1\fR is returned, \fBerrno\fR is set to indicate the error,
+and no files are created or modified.
+.SH ERRORS
+.sp
+.LP
+The \fBopen()\fR and \fBopenat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied on a component of the path prefix.
+.sp
+The file exists and the permissions specified by \fIoflag\fR are denied.
+.sp
+The file does not exist and write permission is denied for the parent directory
+of the file to be created.
+.sp
+\fBO_TRUNC\fR is specified and write permission is denied.
+.sp
+The {\fBPRIV_FILE_DAC_SEARCH\fR} privilege allows processes to search
+directories regardless of permission bits. The {\fBPRIV_FILE_DAC_WRITE\fR}
+privilege allows processes to open files for writing regardless of permission
+bits. See \fBprivileges\fR(5) for special considerations when opening files
+owned by UID 0 for writing. The {\fBPRIV_FILE_DAC_READ\fR} privilege allows
+processes to open files for reading regardless of permission bits.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 16n
+.rt
+A mandatory share reservation could not be obtained because the desired access
+conflicts with an existing \fBf_deny\fR share reservation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 16n
+.rt
+The file descriptor provided to \fBopenat()\fR is invalid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 16n
+.rt
+The file does not exist, \fBO_CREAT\fR is specified, and either the directory
+where the new file entry is being placed cannot be extended because the user's
+quota of disk blocks on that file system has been exhausted, or the user's
+quota of inodes on the file system where the file is being created has been
+exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The \fBO_CREAT\fR and \fBO_EXCL\fR flags are set and the named file exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument includes non-UTF8 characters and the file system
+accepts only file names where all characters are part of the UTF-8 character
+codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during \fBopen()\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The system does not support synchronized I/O for this file, or the
+\fBO_XATTR\fR flag was supplied and the underlying file system does not support
+extended file attributes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument names a \fBSTREAMS\fR file and a hangup or error
+occurred during the \fBopen()\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEISDIR\fR\fR
+.ad
+.RS 16n
+.rt
+The named file is a directory and \fIoflag\fR includes \fBO_WRONLY\fR or
+\fBO_RDWR\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in resolving \fIpath\fR.
+.sp
+A loop exists in symbolic links encountered during resolution of the \fIpath\fR
+argument.
+.sp
+The \fBO_NOFOLLOW\fR flag is set and the final component of path is a symbolic
+link.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 16n
+.rt
+There are currently {\fBOPEN_MAX\fR} file descriptors open in the calling
+process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fBO_NOLINKS\fR flag is set and the named file has a link count greater
+than 1.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMULTIHOP\fR\fR
+.ad
+.RS 16n
+.rt
+Components of \fIpath\fR require hopping to multiple remote machines and the
+file system does not allow it.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR} or a pathname
+component is longer than {\fBNAME_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENFILE\fR\fR
+.ad
+.RS 16n
+.rt
+The maximum allowable number of files is currently open in the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fBO_CREAT\fR flag is not set and the named file does not exist; or the
+\fBO_CREAT\fR flag is set and either the path prefix does not exist or the
+\fIpath\fR argument points to an empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine, and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSR\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument names a STREAMS-based file and the system is unable to
+allocate a STREAM.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+The directory or file system that would contain the new file cannot be
+expanded, the file does not exist, and \fBO_CREAT\fR is specified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSYS\fR\fR
+.ad
+.RS 16n
+.rt
+The device specified by \fIpath\fR does not support the open operation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory or a relative path was
+supplied to \fBopenat()\fR, the \fBO_XATTR\fR flag was not supplied, and the
+file descriptor does not refer to a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 16n
+.rt
+The \fBO_NONBLOCK\fR flag is set, the named file is a FIFO, the \fBO_WRONLY\fR
+flag is set, and no process has the file open for reading; or the named file is
+a character special or block special file and the device associated with this
+special file does not exist or has been retired by the fault management
+framework .
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOPNOTSUPP\fR\fR
+.ad
+.RS 16n
+.rt
+An attempt was made to open a path that corresponds to a \fBAF_UNIX\fR socket.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 16n
+.rt
+The named file is a regular file and either \fBO_LARGEFILE\fR is not set and
+the size of the file cannot be represented correctly in an object of type
+\fBoff_t\fR or \fBO_LARGEFILE\fR is set and the size of the file cannot be
+represented correctly in an object of type \fBoff64_t\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The named file resides on a read-only file system and either \fBO_WRONLY\fR,
+\fBO_RDWR\fR, \fBO_CREAT\fR (if file does not exist), or \fBO_TRUNC\fR is set
+in the \fIoflag\fR argument.
+.RE
+
+.sp
+.LP
+The \fBopenat()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 9n
+.rt
+The \fIfildes\fR argument is not a valid open file descriptor or is not
+\fBAT_FTCWD\fR.
+.RE
+
+.sp
+.LP
+The \fBopen()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument names the slave side of a pseudo-terminal device that
+is locked.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The value of the \fIoflag\fR argument is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+Pathname resolution of a symbolic link produced an intermediate result whose
+length exceeds {\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument names a \fBSTREAMS\fR file and the system is unable to
+allocate resources.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBETXTBSY\fR\fR
+.ad
+.RS 16n
+.rt
+The file is a pure procedure (shared text) file that is being executed and
+\fIoflag\fR is \fBO_WRONLY\fR or \fBO_RDWR\fR.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fROpen a file for writing by the owner.
+.sp
+.LP
+The following example opens the file \fB/tmp/file\fR, either by creating it if
+it does not already exist, or by truncating its length to 0 if it does exist.
+If the call creates a new file, the access permission bits in the file mode of
+the file are set to permit reading and writing by the owner, and to permit
+reading only by group members and others.
+
+.sp
+.LP
+If the call to \fBopen()\fR is successful, the file is opened for writing.
+
+.sp
+.in +2
+.nf
+#include <fcntl.h>
+\&...
+int fd;
+mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+char *filename = "/tmp/file";
+\&...
+fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, mode);
+\&...
+.fi
+.in -2
+
+.LP
+\fBExample 2 \fROpen a file using an existence check.
+.sp
+.LP
+The following example uses the \fBopen()\fR function to try to create the
+\fBLOCKFILE\fR file and open it for writing. Since the \fBopen()\fR function
+specifies the \fBO_EXCL\fR flag, the call fails if the file already exists. In
+that case, the application assumes that someone else is updating the password
+file and exits.
+
+.sp
+.in +2
+.nf
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define LOCKFILE "/etc/ptmp"
+\&...
+int pfd; /* Integer for file descriptor returned by open() call. */
+\&...
+if ((pfd = open(LOCKFILE, O_WRONLY | O_CREAT | O_EXCL,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
+{
+ fprintf(stderr, "Cannot open /etc/ptmp. Try again later.\en");
+ exit(1);
+}
+\&...
+.fi
+.in -2
+
+.LP
+\fBExample 3 \fROpen a file for writing.
+.sp
+.LP
+The following example opens a file for writing, creating the file if it does
+not already exist. If the file does exist, the system truncates the file to
+zero bytes.
+
+.sp
+.in +2
+.nf
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define LOCKFILE "/etc/ptmp"
+\&...
+int pfd;
+char filename[PATH_MAX+1];
+\&...
+if ((pfd = open(filename, O_WRONLY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
+{
+ perror("Cannot open output file\en"); exit(1);
+}
+\&...
+.fi
+.in -2
+
+.SH USAGE
+.sp
+.LP
+The \fBopen()\fR function has a transitional interface for 64-bit file offsets.
+See \fBlf64\fR(5). Note that using \fBopen64()\fR is equivalent to using
+\fBopen()\fR with \fBO_LARGEFILE\fR set in \fIoflag\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardFor \fBopen()\fR, see \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBchmod\fR(2), \fBclose\fR(2), \fBcreat\fR(2), \fBdup\fR(2),
+\fBexec\fR(2), \fBfcntl\fR(2), \fBgetmsg\fR(2), \fBgetrlimit\fR(2),
+\fBlseek\fR(2), \fBputmsg\fR(2), \fBread\fR(2), \fBstat\fR(2), \fBumask\fR(2),
+\fBwrite\fR(2), \fBattropen\fR(3C), \fBfcntl.h\fR(3HEAD), \fBstat.h\fR(3HEAD),
+\fBunlockpt\fR(3C), \fBattributes\fR(5), \fBlf64\fR(5), \fBprivileges\fR(5),
+\fBstandards\fR(5), \fBconnld\fR(7M), \fBstreamio\fR(7I)
+.SH NOTES
+.sp
+.LP
+Hierarchical Storage Management (HSM) file systems can sometimes cause long
+delays when opening a file, since HSM files must be recalled from secondary
+storage.
diff --git a/usr/src/man/man2/p_online.2 b/usr/src/man/man2/p_online.2
new file mode 100644
index 0000000000..e2a05dc705
--- /dev/null
+++ b/usr/src/man/man2/p_online.2
@@ -0,0 +1,214 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH p_online 2 "11 Jan 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+p_online \- return or change processor operational status
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/processor.h>
+
+\fBint\fR \fBp_online\fR(\fBprocessorid_t\fR \fIprocessorid\fR, \fBint\fR \fIflag\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBp_online()\fR function changes or returns the operational status of
+processors. The state of the processor specified by the \fIprocessorid\fR
+argument is changed to the state represented by the \fIflag\fR argument.
+.sp
+.LP
+Legal values for \fIflag\fR are \fBP_STATUS\fR, \fBP_ONLINE\fR,
+\fBP_OFFLINE\fR, \fBP_NOINTR\fR, \fBP_FAULTED\fR, \fBP_SPARE\fR, and
+\fBP_FORCED\fR.
+.sp
+.LP
+When \fIflag\fR is \fBP_STATUS,\fR no processor status change occurs, but the
+current processor status is returned.
+.sp
+.LP
+The \fBP_ONLINE\fR, \fBP_OFFLINE\fR, \fBP_NOINTR\fR, \fBP_FAULTED\fR, and
+\fBP_SPARE\fR values for \fIflag\fR refer to valid processor states. The
+\fBP_OFFLINE\fR, \fBP_SPARE\fR, and \fBP_FAULTED\fR processor states can be
+combined with the \fBP_FORCED\fR flag.
+.sp
+.LP
+A processor in the \fBP_ONLINE\fR state is allowed to process \fBLWPs\fR
+(lightweight processes) and perform system activities. The processor is also
+interruptible by I/O devices attached to the system.
+.sp
+.LP
+A processor in the \fBP_OFFLINE\fR state is not allowed to process \fBLWPs\fR.
+The processor is as inactive as possible. If the hardware supports such a
+feature, the processor is not interruptible by attached I/O devices.
+.sp
+.LP
+A processor in the \fBP_NOINTR\fR state is allowed to process \fBLWPs\fR, but
+it is not interruptible by attached I/O devices. Typically, interrupts, when
+they occur are routed to other processors in the system. Not all systems
+support putting a processor into the \fBP_NOINTR\fR state. It is not permitted
+to put all the processors of a system into the \fBP_NOINTR\fR state. At least
+one processor must always be available to service system clock interrupts.
+.sp
+.LP
+A processor in the \fBP_SPARE\fR state is not allowed to process LWPs. In many
+respects the \fBP_SPARE\fR state is similiar to the \fBP_OFFLINE\fR state, but
+describes a processor that is available for reactivation by management tools
+without administrator intervention.
+.sp
+.LP
+A processor in the \fBP_FAULTED\fR state is not allowed to process LWPs. In
+many respects the \fBP_FAULTED\fR state is similiar to the \fBP_OFFLINE\fR
+state, but describes a processor that has been diagnosed as faulty. The
+privileged caller can change the state of the processor from \fBP_FAULTED\fR to
+any of the other states, but since the processor might generate additional
+errors, electing to reactivate such a processor should be carefully considered.
+.sp
+.LP
+Forced processor state transition can be requested if a new processor state is
+specified with the bitwise-inclusive OR of the special \fBP_FORCED\fR flag.
+Forcing transition of a processor to the \fBP_OFFLINE\fR, \fBP_SPARE\fR, or
+\fBP_FAULTED\fR state revokes processor bindings for all threads that were
+previously bound to that processor with \fBprocessor_bind\fR(2). There is no
+guarantee that a forced processor state transition always succeeds.
+.sp
+.LP
+Processor numbers are integers, greater than or equal to 0, and are defined by
+the hardware platform. Processor numbers are not necessarily contiguous, but
+"not too sparse." Processor numbers should always be printed in decimal.
+.sp
+.LP
+The maximum possible \fIprocessorid\fR value can be determined by calling
+\fBsysconf(_SC_CPUID_MAX)\fR. The list of valid processor numbers can be
+determined by calling \fBp_online()\fR with \fIprocessorid\fR values from 0 to
+the maximum returned by \fBsysconf(_SC_CPUID_MAX)\fR. The \fBEINVAL\fR error is
+returned for invalid processor numbers. See \fBEXAMPLES\fR below.
+.SH RETURN VALUES
+.sp
+.LP
+On successful completion, the value returned is the previous state of the
+processor, \fBP_ONLINE\fR, \fBP_OFFLINE\fR, \fBP_NOINTR\fR, \fBP_FAULTED\fR,
+\fBP_SPARE\fR, or \fBP_POWEROFF\fR. Otherwise, \fB\(mi1\fR is returned, the CPU
+state remains unchanged, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBp_online()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIflag\fR was \fBP_OFFLINE\fR or \fBP_SPARE\fR and the specified processor
+is the only on-line processor, there are currently \fBLWPs\fR bound to the
+processor, or the processor performs some essential function that cannot be
+performed by another processor.
+.sp
+The \fIflag\fR was \fBP_NOINTR\fR and the specified processor is the only
+interruptible processor in the system, or it handles interrupts that cannot be
+handled by another processor.
+.sp
+The specified processor is powered off and cannot be powered on because some
+platform- specific resource is not available.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+A non-existent processor \fBID\fR was specified or \fIflag\fR was invalid.
+.sp
+The caller is in a non-global zone, the pools facility is active, and the
+processor is not a member of the zone's pool's processor set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+The specified processor is powered off, and the platform does not support power
+on of individual processors.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The flag was not \fBP_STATUS\fR and the {\fBPRIV_SYS_RES_CONFIG\fR} privilege
+is not asserted in the effective set of the calling process.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRList the legal processor numbers.
+.sp
+.LP
+The following code sample will list the legal processor numbers:
+
+.sp
+.in +2
+.nf
+#include <sys/unistd.h>
+#include <sys/processor.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+
+int
+main()
+{
+ processorid_t i, cpuid_max;
+ cpuid_max = sysconf(_SC_CPUID_MAX);
+ for (i = 0; i <= cpuid_max; i++) {
+ if (p_online(i, P_STATUS) != -1)
+ printf("processor %d present\en", i);
+ }
+ return (0);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpsradm\fR(1M), \fBpsrinfo\fR(1M), \fBzoneadm\fR(1M),
+\fBprocessor_bind\fR(2), \fBprocessor_info\fR(2), \fBpset_create\fR(2),
+\fBsysconf\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/pause.2 b/usr/src/man/man2/pause.2
new file mode 100644
index 0000000000..6e3c113e54
--- /dev/null
+++ b/usr/src/man/man2/pause.2
@@ -0,0 +1,77 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pause 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+pause \- suspend process until signal
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBpause\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpause()\fR function suspends the calling process until it receives a
+signal. The signal must be one that is not currently set to be ignored by the
+calling process.
+.sp
+.LP
+If the signal causes termination of the calling process, \fBpause()\fR does not
+return.
+.sp
+.LP
+If the signal is caught by the calling process and control is returned from the
+signal-catching function (see \fBsignal\fR(3C)), the calling process resumes
+execution from the point of suspension.
+.SH RETURN VALUES
+.sp
+.LP
+Since \fBpause()\fR suspends thread execution indefinitely unless interrupted
+by a signal, there is no successful completion return value. If interrupted,
+it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpause()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 9n
+.rt
+A signal is caught by the calling process and control is returned from the
+signal-catching function.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBalarm\fR(2), \fBkill\fR(2), \fBsignal\fR(3C), \fBwait\fR(3C),
+\fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/pcsample.2 b/usr/src/man/man2/pcsample.2
new file mode 100644
index 0000000000..a2f08a6acb
--- /dev/null
+++ b/usr/src/man/man2/pcsample.2
@@ -0,0 +1,93 @@
+'\" te
+.\" Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pcsample 2 "10 Mar 1998" "SunOS 5.11" "System Calls"
+.SH NAME
+pcsample \- program execution time profile
+.SH SYNOPSIS
+.LP
+.nf
+#include <pcsample.h>
+
+\fBlong\fR \fBpcsample\fR(\fBuintptr_t\fR \fIsamples[]\fR, \fBlong\fR \fInsamples\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpcsample()\fR function provides CPU-use statistics by profiling the
+amount of \fBCPU\fR time expended by a program.
+.sp
+.LP
+For profiling dynamically-linked programs and 64-bit programs, it is superior
+to the \fBprofil\fR(2) function, which assumes that the entire program is
+contained in a small, contiguous segment of the address space, divides this
+segment into "bins", and on each clock tick increments the counter in the bin
+where the program is currently executing. With shared libraries creating
+discontinuous program segments spread throughout the address space, and with
+64-bit address spaces so large that the size of "bins" would be measured in
+megabytes, the \fBprofil()\fR function is of limited value.
+.sp
+.LP
+The \fBpcsample()\fR function is passed an array \fIsamples\fR containing
+\fInsamples\fR pointer-sized elements. During program execution, the kernel
+samples the program counter of the process, storing unadulterated values in the
+array on each clock tick. The kernel stops writing to the array when it is
+full, which occurs after \fInsamples\fR / \fBHZ\fR seconds of process virtual
+time. The \fBHZ\fR value is obtained by invoking the call
+\fBsysconf(_SC_CLK_TCK)\fR. See \fBsysconf\fR(3C).
+.sp
+.LP
+The sampling can be stopped by a subsequent call to \fBpcsample()\fR with the
+\fInsamples\fR argument set to 0. Like \fBprofil()\fR, sampling continues
+across a call to \fBfork\fR(2), but is disabled by a call to one of the
+\fBexec\fR family of functions (see \fBexec\fR(2)). It is also disabled if an
+update of the \fIsamples\fR\fB[\|]\fR array causes a memory fault.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBpcsample()\fR function always returns \fB0\fR the first time it is
+called. On subsequent calls, it returns the number of samples that were stored
+during the previous invocation. If \fInsamples\fR is invalid, it returns
+\fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpcsample()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fInsamples\fR is not valid.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+_
+Interface StabilityStable
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBfork\fR(2), \fBprofil\fR(2), \fBsysconf\fR(3C),
+\fBattributes\fR(5)
diff --git a/usr/src/man/man2/pipe.2 b/usr/src/man/man2/pipe.2
new file mode 100644
index 0000000000..d8e61d8017
--- /dev/null
+++ b/usr/src/man/man2/pipe.2
@@ -0,0 +1,109 @@
+'\" te
+.\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pipe 2 "23 Apr 2002" "SunOS 5.11" "System Calls"
+.SH NAME
+pipe \- create an interprocess channel
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBpipe\fR(\fBint\fR \fIfildes\fR[2]);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpipe()\fR function creates an I/O mechanism called a pipe and returns
+two file descriptors, \fIfildes\fR[\fB0\fR] and \fIfildes\fR[\fB1\fR]. The
+files associated with \fIfildes\fR[\fB0\fR] and \fIfildes\fR[\fB1\fR] are
+streams and are both opened for reading and writing. The \fBO_NDELAY\fR,
+\fBO_NONBLOCK\fR, and \fBFD_CLOEXEC\fR flags are cleared on both file
+descriptors. The \fBfcntl\fR(2) function can be used to set these flags.
+.sp
+.LP
+A read from \fIfildes\fR[\fB0\fR] accesses the data written to
+\fIfildes\fR[\fB1\fR] on a first-in-first-out (FIFO) basis and a read from
+\fIfildes\fR[\fB1\fR] accesses the data written to \fIfildes\fR[\fB0\fR] also
+on a \fBFIFO\fR basis.
+.sp
+.LP
+Upon successful completion \fBpipe()\fR marks for update the \fBst_atime\fR,
+\fBst_ctime\fR, and \fBst_mtime\fR fields of the pipe.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpipe()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 10n
+.rt
+More than {\fBOPEN_MAX\fR} file descriptors are already in use by this process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENFILE\fR\fR
+.ad
+.RS 10n
+.rt
+The number of simultaneously open files in the system would exceed a
+system-imposed limit.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsh\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2), \fBgetmsg\fR(2), \fBpoll\fR(2),
+\fBputmsg\fR(2), \fBread\fR(2), \fBwrite\fR(2), \fBattributes\fR(5),
+\fBstandards\fR(5), \fBstreamio\fR(7I)
+.SH NOTES
+.sp
+.LP
+Since a pipe is bi-directional, there are two separate flows of data.
+Therefore, the size (\fBst_size\fR) returned by a call to \fBfstat\fR(2) with
+argument \fIfildes\fR[\fB0\fR] or \fIfildes\fR[\fB1\fR] is the number of bytes
+available for reading from \fIfildes\fR[\fB0\fR] or \fIfildes\fR[\fB1\fR]
+respectively. Previously, the size (\fBst_size\fR) returned by a call to
+\fBfstat()\fR with argument \fIfildes\fR[\fB1\fR] (the write-end) was the
+number of bytes available for reading from \fIfildes\fR[\fB0\fR] (the
+read-end).
diff --git a/usr/src/man/man2/poll.2 b/usr/src/man/man2/poll.2
new file mode 100644
index 0000000000..20036d28de
--- /dev/null
+++ b/usr/src/man/man2/poll.2
@@ -0,0 +1,303 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH poll 2 "23 Aug 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+poll \- input/output multiplexing
+.SH SYNOPSIS
+.LP
+.nf
+#include <poll.h>
+
+\fBint\fR \fBpoll\fR(\fBstruct pollfd\fR \fIfds[]\fR, \fBnfds_t\fR \fInfds\fR, \fBint\fR \fItimeout\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpoll()\fR function provides applications with a mechanism for
+multiplexing input/output over a set of file descriptors. For each member of
+the array pointed to by \fIfds\fR, \fBpoll()\fR examines the given file
+descriptor for the event(s) specified in \fIevents\fR. The number of
+\fBpollfd\fR structures in the \fIfds\fR array is specified by \fInfds\fR. The
+\fBpoll()\fR function identifies those file descriptors on which an application
+can read or write data, or on which certain events have occurred.
+.sp
+.LP
+The \fIfds\fR argument specifies the file descriptors to be examined and the
+events of interest for each file descriptor. It is a pointer to an array with
+one member for each open file descriptor of interest. The array's members are
+\fBpollfd\fR structures, which contain the following members:
+.sp
+.in +2
+.nf
+int fd; /* file descriptor */
+short events; /* requested events */
+short revents; /* returned events */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBfd\fR member specifies an open file descriptor and the \fBevents\fR and
+\fBrevents\fR members are bitmasks constructed by a logical \fBOR\fR operation
+of any combination of the following event flags:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLIN\fR\fR
+.ad
+.RS 14n
+.rt
+Data other than high priority data may be read without blocking. For streams,
+this flag is set in \fBrevents\fR even if the message is of zero length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLRDNORM\fR\fR
+.ad
+.RS 14n
+.rt
+Normal data (priority band equals 0) may be read without blocking. For streams,
+this flag is set in \fBrevents\fR even if the message is of zero length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLRDBAND\fR\fR
+.ad
+.RS 14n
+.rt
+Data from a non-zero priority band may be read without blocking. For streams,
+this flag is set in \fBrevents\fR even if the message is of zero length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLPRI\fR\fR
+.ad
+.RS 14n
+.rt
+High priority data may be received without blocking. For streams, this flag is
+set in \fBrevents\fR even if the message is of zero length.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLOUT\fR\fR
+.ad
+.RS 14n
+.rt
+Normal data (priority band equals 0) may be written without blocking.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLWRNORM\fR\fR
+.ad
+.RS 14n
+.rt
+The same as \fBPOLLOUT\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLWRBAND\fR\fR
+.ad
+.RS 14n
+.rt
+Priority data (priority band > 0) may be written. This event only examines
+bands that have been written to at least once.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLERR\fR\fR
+.ad
+.RS 14n
+.rt
+An error has occurred on the device or stream. This flag is only valid in the
+\fBrevents\fR bitmask; it is not used in the \fBevents\fR member.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLHUP\fR\fR
+.ad
+.RS 14n
+.rt
+A hangup has occurred on the stream. This event and \fBPOLLOUT\fR are mutually
+exclusive; a stream can never be writable if a hangup has occurred. However,
+this event and \fBPOLLIN\fR, \fBPOLLRDNORM\fR, \fBPOLLRDBAND\fR, or
+\fBPOLLPRI\fR are not mutually exclusive. This flag is only valid in the
+\fBrevents\fR bitmask; it is not used in the \fBevents\fR member.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOLLNVAL\fR\fR
+.ad
+.RS 14n
+.rt
+The specified \fBfd\fR value does not belong to an open file. This flag is only
+valid in the \fBrevents\fR member; it is not used in the \fBevents\fR member.
+.RE
+
+.sp
+.LP
+If the value \fBfd\fR is less than 0, \fBevents\fR is ignored and \fBrevents\fR
+is set to 0 in that entry on return from \fBpoll()\fR.
+.sp
+.LP
+The results of the \fBpoll()\fR query are stored in the \fBrevents\fR member in
+the \fBpollfd\fR structure. Bits are set in the \fBrevents\fR bitmask to
+indicate which of the requested events are true. If none are true, none of the
+specified bits are set in \fBrevents\fR when the \fBpoll()\fR call returns. The
+event flags \fBPOLLHUP\fR, \fBPOLLERR\fR, and \fBPOLLNVAL\fR are always set
+in \fBrevents\fR if the conditions they indicate are true; this occurs even
+though these flags were not present in \fBevents\fR.
+.sp
+.LP
+If none of the defined events have occurred on any selected file descriptor,
+\fBpoll()\fR waits at least \fItimeout\fR milliseconds for an event to occur on
+any of the selected file descriptors. On a computer where millisecond timing
+accuracy is not available, \fItimeout\fR is rounded up to the nearest legal
+value available on that system. If the value \fItimeout\fR is 0, \fBpoll()\fR
+returns immediately. If the value of \fItimeout\fR is \(mi1, \fBpoll()\fR
+blocks until a requested event occurs or until the call is interrupted. The
+\fBpoll()\fR function is not affected by the \fBO_NDELAY\fR and
+\fBO_NONBLOCK\fR flags.
+.sp
+.LP
+The \fBpoll()\fR function supports regular files, terminal and pseudo-terminal
+devices, streams-based files, FIFOs and pipes. The behavior of \fBpoll()\fR on
+elements of \fIfds\fR that refer to other types of file is unspecified.
+.sp
+.LP
+The \fBpoll()\fR function supports sockets.
+.sp
+.LP
+A file descriptor for a socket that is listening for connections will indicate
+that it is ready for reading, once connections are available. A file
+descriptor for a socket that is connecting asynchronously will indicate that it
+is ready for writing, once a connection has been established.
+.sp
+.LP
+Regular files always \fBpoll()\fR \fBTRUE\fR for reading and writing.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative value is returned. A positive value
+indicates the total number of file descriptors that has been selected (that is,
+file descriptors for which the \fBrevents\fR member is non-zero). A value of
+\fB0\fR indicates that the call timed out and no file descriptors have been
+selected. Upon failure, \fB\(mi1\fR is returned and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpoll()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+Allocation of internal data structures failed, but the request may be attempted
+again.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+Some argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+A signal was caught during the \fBpoll()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The argument \fInfds\fR is greater than \fB{OPEN_MAX}\fR, or one of the
+\fBfd\fR members refers to a stream or multiplexer that is linked (directly or
+indirectly) downstream from a multiplexer.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBgetmsg\fR(2), \fBgetrlimit\fR(2), \fBputmsg\fR(2),
+\fBread\fR(2), \fBwrite\fR(2), \fBselect\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5), \fBchpoll\fR(9E)
+.sp
+.LP
+\fISTREAMS Programming Guide\fR
+.SH NOTES
+.sp
+.LP
+Non-STREAMS drivers use \fBchpoll\fR(9E) to implement \fBpoll()\fR on these
+devices.
diff --git a/usr/src/man/man2/priocntl.2 b/usr/src/man/man2/priocntl.2
new file mode 100644
index 0000000000..603086ff6a
--- /dev/null
+++ b/usr/src/man/man2/priocntl.2
@@ -0,0 +1,1580 @@
+'\" te
+.\" Copyright 1989 AT&T.
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH priocntl 2 "11 May 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+priocntl \- process scheduler control
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/priocntl.h>
+#include <sys/rtpriocntl.h>
+#include <sys/tspriocntl.h>
+#include <sys/iapriocntl.h>
+#include <sys/fsspriocntl.h>
+#include <sys/fxpriocntl.h>
+
+\fBlong\fR \fBpriocntl\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBint\fR \fIcmd\fR, \fB/*\fR \fIarg\fR */ ...);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpriocntl()\fR function provides for control over the scheduling of an
+active light weight process (LWP).
+.sp
+.LP
+LWPs fall into distinct classes with a separate scheduling policy applied to
+each class. The classes currently supported are the realtime class, the
+time-sharing class, the fair-share class, and the fixed-priority class. The
+characteristics of these classes are described under the corresponding headings
+below.
+.sp
+.LP
+The class attribute of an LWP is inherited across the \fBfork\fR(2) function
+and the \fBexec\fR(2) family of functions. The \fBpriocntl()\fR function can be
+used to dynamically change the class and other scheduling parameters associated
+with a running LWP or set of LWPs given the appropriate permissions as
+explained below.
+.sp
+.LP
+In the default configuration, a runnable realtime LWP runs before any other
+LWP. Therefore, inappropriate use of realtime LWP can have a dramatic negative
+impact on system performance.
+.sp
+.LP
+The \fBpriocntl()\fR function provides an interface for specifying a process,
+set of processes, or an LWP to which the function applies. The
+\fBpriocntlset\fR(2) function provides the same functions as \fBpriocntl()\fR,
+but allows a more general interface for specifying the set of LWPs to which the
+function is to apply.
+.sp
+.LP
+For \fBpriocntl()\fR, the \fIidtype\fR and \fIid\fR arguments are used together
+to specify the set of LWPs. The interpretation of \fIid\fR depends on the value
+of \fIidtype\fR. The possible values for \fIidtype\fR and corresponding
+interpretations of \fIid\fR are as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_ALL\fR\fR
+.ad
+.RS 12n
+.rt
+The \fBpriocntl()\fR function applies to all existing LWPs. The value of
+\fIid\fR is ignored. The permission restrictions described below still apply.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_CID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a class ID (returned by the \fBpriocntl()\fR
+\fBPC_GETCID\fR command as explained below). The \fBpriocntl()\fR function
+applies to all LWPs in the specified class.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_GID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a group ID. The \fBpriocntl()\fR function applies to
+all LWPs with this effective group ID.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_LWPID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is an LWP ID. The \fIpriocntl\fR function applies to the
+LWP with the specified ID within the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_PGID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a process group ID. The \fBpriocntl()\fR function
+applies to all LWPs currently associated with processes in the specified
+process group.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_PID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a process ID specifying a single process. The
+\fBpriocntl()\fR function applies to all LWPs currently associated with the
+specified process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_PPID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a parent process ID. The \fBpriocntl()\fR function
+applies to all LWPs currently associated with processes with the specified
+parent process ID.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_PROJID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a project ID. The \fBpriocntl()\fR function applies to
+all LWPs with this project ID.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_SID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a session ID. The \fBpriocntl()\fR function applies to
+all LWPs currently associated with processes in the specified session.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_TASKID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a task ID. The \fBpriocntl()\fR function applies to
+all LWPs currently associated with processes in the specified task.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_UID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a user ID. The \fBpriocntl()\fR function applies to
+all LWPs with this effective user ID.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_ZONEID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a zone ID. The \fBpriocntl()\fR function applies to
+all LWPs with this zone ID.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBP_CTID\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIid\fR argument is a process contract ID. The \fBpriocntl()\fR function
+applies to all LWPs with this process contract ID.
+.RE
+
+.sp
+.LP
+An \fIid\fR value of \fBP_MYID\fR can be used in conjunction with the
+\fIidtype\fR value to specify the LWP ID, parent process ID, process group ID,
+session ID, task ID, class ID, user ID, group ID, project ID, zone ID, or
+process contract ID of the calling LWP.
+.sp
+.LP
+To change the scheduling parameters of an LWP (using the \fBPC_SETPARMS\fR or
+\fBPC_SETXPARMS\fR command as explained below) , the real or effective user ID
+of the LWP calling \fBpriocntl()\fR must match the real or the calling LWP must
+have sufficient privileges. These are the minimum permission requirements
+enforced for all classes. An individual class might impose additional
+permissions requirements when setting LWPs to that class and/or when setting
+class-specific scheduling parameters.
+.sp
+.LP
+A special \fBSYS\fR scheduling class exists for the purpose of scheduling the
+execution of certain special system processes (such as the swapper process). It
+is not possible to change the class of any LWP to \fBSYS\fR. In addition, any
+processes in the \fBSYS\fR class that are included in a specified set of
+processes are disregarded by \fBpriocntl()\fR. For example, an \fIidtype\fR of
+\fBP_UID\fR and an \fIid\fR value of 0 would specify all processes with a user
+ID of 0 except processes in the \fBSYS\fR class and (if changing the parameters
+using \fBPC_SETPARMS\fR or \fBPC_SETXPARMS\fR) the \fBinit\fR(1M) process.
+.sp
+.LP
+The \fBinit\fR process is a special case. For a \fBpriocntl()\fR call to change
+the class or other scheduling parameters of the \fIinit\fR process (process ID
+1), it must be the only process specified by \fIidtype\fR and \fIid\fR. The
+\fBinit\fR process can be assigned to any class configured on the system, but
+the time-sharing class is almost always the appropriate choice. (Other choices
+might be highly undesirable. See the \fISystem Administration Guide: Basic
+Administration\fR for more information.)
+.sp
+.LP
+The data type and value of \fIarg\fR are specific to the type of command
+specified by \fIcmd\fR.
+.sp
+.LP
+A \fBpcinfo_t\fR structure with the following members, defined in
+\fB<sys/priocntl.h>\fR, is used by the \fBPC_GETCID\fR and \fBPC_GETCLINFO\fR
+commands.
+.sp
+.in +2
+.nf
+id_t pc_cid; /* Class id */
+char pc_clname[PC_CLNMSZ]; /* Class name */
+int pc_clinfo[PC_CLINFOSZ]; /* Class information */
+.fi
+.in -2
+
+.sp
+.LP
+The \fIpc_cid\fR member is a class ID returned by the \fBpriocntl()\fR
+\fBPC_GETCID\fR command.
+.sp
+.LP
+The \fIpc_clname\fR member is a buffer of size \fBPC_CLNMSZ\fR, defined in
+\fB<sys/priocntl.h>\fR, used to hold the class name: \fBRT\fR for realtime,
+\fBTS\fR for time-sharing, \fBIA\fRfor interactive, \fBFSS\fR for fair-share,
+or \fBFX\fR for fixed-priority. Each string is null-terminated.
+.sp
+.LP
+The \fIpc_clinfo\fR member is a buffer of size \fBPC_CLINFOSZ\fR, defined in
+\fB<sys/priocntl.h>\fR, used to return data describing the attributes of a
+specific class. The format of this data is class-specific and is described
+under the appropriate heading (\fBREALTIME CLASS\fR, \fBTIME-SHARING CLASS\fR,
+\fBINTERACTIVE CLASS\fR, \fBFAIR-SHARE CLASS\fR, or \fBFIXED-PRIORITY CLASS\fR)
+below.
+.sp
+.LP
+A \fBpcparms_t\fR structure with the following members, defined in
+\fB<sys/priocntl.h>\fR, is used by the \fBPC_SETPARMS\fR and \fBPC_GETPARMS\fR
+commands.
+.sp
+.in +2
+.nf
+id_t pc_cid; /* LWP class */
+int pc_clparms[PC_CLPARMSZ]; /* Class-specific params */
+.fi
+.in -2
+
+.sp
+.LP
+The \fIpc_cid\fR member is a class ID returned by the \fBpriocntl()\fR
+\fBPC_GETCID\fR command. The special class ID \fBPC_CLNULL\fR can also be
+assigned to \fIpc_cid\fR when using the \fBPC_GETPARMS\fR command as explained
+below.
+.sp
+.LP
+The \fIpc_clparms\fR buffer holds class-specific scheduling parameters. The
+format of this parameter data for a particular class is described under the
+appropriate heading below. \fBPC_CLPARMSZ\fR is the length of the
+\fIpc_clparms\fR buffer and is defined in \fB<sys/priocntl.h>\fR.
+.sp
+.LP
+The \fBPC_SETXPARMS\fR and \fBPC_GETXPARMS\fR commands exploit the
+\fBvarargs\fR declaration of \fBpriocntl()\fR. The argument following the
+command code is a class name: \fBRT\fR for realtime, \fBTS\fR for time-sharing,
+\fBIA\fR for interactive, \fBFSS\fR for fair-share, or \fBFX\fR for
+fixed-priority. The parameters after the class name build a chain of (key,
+value) pairs, where the key determines the meaning of the value within the
+pair. When using \fBPC_GETXPARMS\fR, the value associated with the key is
+always a pointer to a scheduling parameter. In contrast, when using
+\fBPC_SETXPARMS\fR the scheduling parameter is given as a direct value. A key
+value of \fB0\fR terminates the sequence and all further keys or values are
+ignored.
+.sp
+.LP
+The \fBPC_SETXPARMS\fR and \fBPC_GETXPARMS\fR commands are more flexible than
+\fBPC_SETPARMS\fR and \fBPC_GETPARMS\fR and should replace \fBPC_SETPARMS\fR
+and \fBPC_GETPARMS\fR on a long-term basis.
+.SH COMMANDS
+.sp
+.LP
+Available \fBpriocntl()\fR commands are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_ADMIN\fR\fR
+.ad
+.RS 16n
+.rt
+This command provides functionality needed for the implementation of the
+\fBdispadmin\fR(1M) utility. It is not intended for general use by other
+applications.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_DONICE\fR\fR
+.ad
+.RS 16n
+.rt
+Set or get nice value of the specified LWP(s) associated with the specified
+process(es). When this command is used with the \fIidtype\fR of \fBP_LWPID\fR,
+it sets the nice value of the LWP. The \fIarg\fR argument points to a structure
+of type \fBpcnice_t\fR. The \fIpc_val\fR member specifies the nice value and
+the \fIpc_op\fR specifies the type of the operation.
+.sp
+When \fIpc_op\fR is set to \fBPC_GETNICE\fR, \fBpriocntl()\fR sets the
+\fIpc_val\fR to the highest priority (lowest numerical value) pertaining to any
+of the specified LWPs.
+.sp
+When \fIpc_op\fR is set to \fBPC_SETNICE\fR, \fBpriocntl()\fR sets the nice
+value of all LWPs in the specified set to the value specified in \fIpc_val\fR
+member of \fBpcnice_t\fR structure.
+.sp
+The \fBpriocntl()\fR function returns \fB\(mi1\fR with \fBerrno\fR set to
+\fBEPERM\fR if the calling LWP doesn't have appropriate permissions to set or
+get nice values for one or more of the target LWPs. If \fBpriocntl()\fR
+encounters an error other than permissions, it does not continue through the
+set of target LWPs but returns the error immediately.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_GETCID\fR\fR
+.ad
+.RS 16n
+.rt
+Get class ID and class attributes for a specific class given the class name.
+The \fIidtype\fR and \fIid\fR arguments are ignored. If \fIarg\fR is non-null,
+it points to a structure of type \fBpcinfo_t\fR. The \fIpc_clname\fR buffer
+contains the name of the class whose attributes you are getting.
+.sp
+On success, the class ID is returned in \fBpc_cid\fR, the class attributes are
+returned in the \fIpc_clinfo\fR buffer, and the \fBpriocntl()\fR call returns
+the total number of classes configured in the system (including the \fBsys\fR
+class). If the class specified by \fIpc_clname\fR is invalid or is not
+currently configured, the \fBpriocntl()\fR call returns \fB\(mi1\fR with
+\fBerrno\fR set to \fBEINVAL\fR. The format of the attribute data returned for
+a given class is defined in the \fB<sys/rtpriocntl.h>\fR,
+\fB<sys/tspriocntl.h>\fR, \fB<sys/iapriocntl.h>\fR, \fB<sys/fsspriocntl.h>\fR,
+or \fB<sys/fxpriocntl.h>\fR header and described under the appropriate heading
+below.
+.sp
+If \fIarg\fR is a null pointer, no attribute data is returned but the
+\fBpriocntl()\fR call still returns the number of configured classes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_GETCLINFO\fR\fR
+.ad
+.RS 16n
+.rt
+Get class name and class attributes for a specific class given class ID. The
+\fIidtype\fR and \fIid\fR arguments are ignored. If \fIarg\fR is non-null, it
+points to a structure of type \fBpcinfo_t\fR. The \fIpc_cid\fR member is the
+class ID of the class whose attributes you are getting.
+.sp
+On success, the class name is returned in the \fIpc_clname\fR buffer, the class
+attributes are returned in the \fIpc_clinfo\fR buffer, and the \fBpriocntl()\fR
+call returns the total number of classes configured in the system (including
+the \fBsys\fR class). The format of the attribute data returned for a given
+class is defined in the \fB<sys/rtpriocntl.h>\fR, \fB<sys/tspriocntl.h>\fR,
+\fB<sys/iapriocntl.h>\fR, \fB<sys/fsspriocntl.h>\fR, or
+\fB<sys/fxpriocntl.h>\fR header and described under the appropriate heading
+below.
+.sp
+If \fIarg\fR is a null pointer, no attribute data is returned but the
+\fBpriocntl()\fR call still returns the number of configured classes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_GETPARMS\fR\fR
+.ad
+.RS 16n
+.rt
+Get the class and/or class-specific scheduling parameters of an LWP. The
+\fIarg\fR member points to a structure of type \fBpcparms_t\fR.
+.sp
+If \fIpc_cid\fR specifies a configured class and a single LWP belonging to that
+class is specified by the \fIidtype\fR and \fIid\fR values or the
+\fBprocset\fR structure, then the scheduling parameters of that LWP are
+returned in the \fIpc_clparms\fR buffer. If the LWP specified does not exist or
+does not belong to the specified class, the \fBpriocntl()\fR call returns
+\fB\(mi1\fR with \fBerrno\fR set to \fBESRCH\fR.
+.sp
+If \fIpc_cid\fR specifies a configured class and a set of LWPs is specified,
+the scheduling parameters of one of the specified LWP belonging to the
+specified class are returned in the \fIpc_clparms\fR buffer and the
+\fBpriocntl()\fR call returns the process ID of the selected LWP. The criteria
+for selecting an LWP to return in this case is class-dependent. If none of the
+specified LWPs exist or none of them belong to the specified class, the
+\fBpriocntl()\fR call returns \fB\(mi1\fR with \fBerrno\fR set to \fBESRCH\fR.
+.sp
+If \fIpc_cid\fR is \fBPC_CLNULL\fR and a single LWP is specified, the class of
+the specified LWP is returned in \fIpc_cid\fR and its scheduling parameters are
+returned in the \fIpc_clparms\fR buffer.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_GETXPARMS\fR\fR
+.ad
+.RS 16n
+.rt
+Get the class or class-specific scheduling parameters of an LWP. The class name
+(first argument after \fBPC_GETXPARMS\fR) specifies the class and the (key,
+value) pair sequence contains a pointer to the class-specific parameters. The
+keys and the types of the class-specific parameter data are described below
+and can also be found in the class-specific headers \fB<sys/rtpriocntl.h>\fR,
+\fB<sys/tspriocntl.h>\fR, \fB<sys/iapriocntl.h>\fR, \fB<sys/fsspriocntl.h>\fR,
+and \fB<sys/fxpriocntl.h>\fR. If the specified class is a configured class and
+a single LWP belonging to that class is specified by the \fIidtype\fR and
+\fIid\fR values or the \fBprocset\fR structure, then the scheduling parameters
+of that LWP are returned in the given (key, value) pair buffers. If the LWP
+specified does not exist or does not belong to the specified class,
+\fBpriocntl()\fR returns \fB\(mi1\fR and \fBerrno\fR is set to \fBESRCH\fR.
+.sp
+If the class name specifies a configured class and a set of LWPs is given, the
+scheduling parameters of one of the specified LWPs belonging to the specified
+class are returned and the \fBpriocntl()\fR call returns the process ID of the
+selected LWP. The criteria for selecting an LWP to return in this case is
+class-dependent. If none of the specified LWPs exist or none of them belong to
+the specified class, \fBpriocntl()\fR returns \fB\(mi1\fR and \fBerrno\fR is
+set to \fBESRCH\fR.
+.sp
+If the class name is a null pointer, a single process or LWP is specified, and
+a (key, value) pair for a class name request is given, \fBpriocntl()\fR fills
+the buffer pointed to by value with the class name of the specified process or
+LWP. The key for the class name request is \fBPC_KY_CLNAME\fR and the class
+name buffer should be declared as:
+.sp
+.in +2
+.nf
+char pc_clname[PC_CLNMSZ]; /* Class name */
+.fi
+.in -2
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_SETPARMS\fR\fR
+.ad
+.RS 16n
+.rt
+Set the class and class-specific scheduling parameters of the specified LWP(s)
+associated with the specified process(es). When this command is used with the
+\fIidtype\fR of P_LWPID, it will set the class and class-specific scheduling
+parameters of the LWP. The \fIarg\fR argument points to a structure of type
+\fBpcparms_t\fR. The \fIpc_cid\fR member specifies the class you are setting
+and the \fIpc_clparms\fR buffer contains the class-specific parameters you are
+setting. The format of the class-specific parameter data is defined in the
+\fB<sys/rtpriocntl.h>\fR, \fB<sys/tspriocntl.h>\fR, \fB<sys/iapriocntl.h>\fR,
+\fB<sys/fsspriocntl.h>\fR, or \fB<sys/fxpriocntl.h>\fR header and described
+under the appropriate class heading below.
+.sp
+When setting parameters for a set of LWPs, \fBpriocntl()\fR acts on the LWPs in
+the set in an implementation-specific order. If \fBpriocntl()\fR encounters an
+error for one or more of the target processes, it might or might not continue
+through the set of LWPs, depending on the nature of the error. If the error is
+related to permissions (\fBEPERM\fR), \fBpriocntl()\fR continues through the
+LWP set, resetting the parameters for all target LWPs for which the calling LWP
+has appropriate permissions. The \fBpriocntl()\fR function then returns
+\fB\(mi1\fR with \fBerrno\fR set to \fBEPERM\fR to indicate that the operation
+failed for one or more of the target LWPs. If \fBpriocntl()\fR encounters an
+error other than permissions, it does not continue through the set of target
+LWPs but returns the error immediately.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPC_SETXPARMS\fR\fR
+.ad
+.RS 16n
+.rt
+Set the class and class-specific scheduling parameters of the specified LWP(s)
+associated with the specified process(es). When this command is used with
+\fBP_LWPID\fR as \fIidtype\fR, it will set the class and class-specific
+scheduling parameters of the LWP. The class name (first argument after
+\fBPC_SETXPARMS\fR) specifies the class to be changed and the following (key,
+value) pair sequence contains the class-specific parameters to be changed. Only
+those (key,value) pairs whose scheduling behavior is to change must be
+specified. The keys and the types of the class-specific parameter data are
+described below and can also be found in the class-specific header files
+\fB<sys/rtpriocntl.h>\fR, \fB<sys/tspriocntl.h>\fR, \fB<sys/iapriocntl.h>\fR,
+\fB<sys/fsspriocntl.h>\fR, and \fB<sys/fxpriocntl.h>\fR.
+.sp
+When setting parameters for a set of LWPs, \fBpriocntl()\fR acts on the LWPs in
+the set in an implementation-specific order. If \fBpriocntl()\fR encounters an
+error for one or more of the target processes, it might or might not continue
+through the set of LWPs, depending on the nature of the error. If the error is
+related to permissions (\fBEPERM\fR), \fBpriocntl()\fR continues to reset the
+parameters for all target LWPs where the calling LWP has appropriate
+permissions. The \fBpriocntl()\fR function returns \fB\(mi1\fR and \fBerrno\fR
+is set to \fBEPERM\fR when the operation failed for one or more of the target
+LWPs. All errors other than \fBEPERM\fR result in an immediate termination of
+\fBpriocntl()\fR.
+.RE
+
+.SH REALTIME CLASS
+.sp
+.LP
+The realtime class provides a fixed priority preemptive scheduling policy for
+those LWPS requiring fast and deterministic response and absolute
+user/application control of scheduling priorities. If the realtime class is
+configured in the system, it should have exclusive control of the highest range
+of scheduling priorities on the system. This ensures that a runnable realtime
+LWP is given CPU service before any LWP belonging to any other class.
+.sp
+.LP
+The realtime class has a range of realtime priority (\fIrt_pri\fR) values that
+can be assigned to an LWP within the class. Realtime priorities range from 0 to
+\fIx\fR, where the value of \fIx\fR is configurable and can be determined for a
+specific installation by using the \fBpriocntl()\fR \fBPC_GETCID\fR or
+\fBPC_GETCLINFO\fR command.
+.sp
+.LP
+The realtime scheduling policy is a fixed priority policy. The scheduling
+priority of a realtime LWP is never changed except as the result of an explicit
+request by the user/application to change the \fIrt_pri\fR value of the LWP.
+.sp
+.LP
+For an LWP in the realtime class, the \fIrt_pri\fR value is, for all practical
+purposes, equivalent to the scheduling priority of the LWP. The \fIrt_pri\fR
+value completely determines the scheduling priority of a realtime LWP relative
+to other LWPs within its class. Numerically higher \fIrt_pri\fR values
+represent higher priorities. Since the realtime class controls the highest
+range of scheduling priorities in the system, it is guaranteed that the
+runnable realtime LWP with the highest \fIrt_pri\fR value is always selected to
+run before any other LWPs in the system.
+.sp
+.LP
+In addition to providing control over priority, \fBpriocntl()\fR provides for
+control over the length of the time quantum allotted to the LWP in the realtime
+class. The time quantum value specifies the maximum amount of time an LWP can
+run assuming that it does not complete or enter a resource or event wait state
+(\fIsleep\fR). If another LWP becomes runnable at a higher priority, the
+currently running LWP might be preempted before receiving its full time
+quantum.
+.sp
+.LP
+The realtime quantum signal can be used for the notification of runaway
+realtime processes about the consumption of their time quantum. Those
+processes, which are monitored by the realtime time quantum signal, receive the
+configured signal in the event of time quantum expiration. The default value
+(\fB0\fR) of the time quantum signal will denote no signal delivery and a
+positive value will denote the delivery of the signal specified by the value.
+The realtime quantum signal can be set with the \fBpriocntl()\fR
+\fBPC_SETXPARMS\fR command and displayed with the \fBpriocntl()\fR
+\fBPC_GETXPARMS\fR command as explained below.
+.sp
+.LP
+The system's process scheduler keeps the runnable realtime LWPs on a set of
+scheduling queues. There is a separate queue for each configured realtime
+priority and all realtime LWPs with a given \fIrt_pri\fR value are kept
+together on the appropriate queue. The LWPs on a given queue are ordered in
+FIFO order (that is, the LWP at the front of the queue has been waiting longest
+for service and receives the CPU first). Realtime LWPs that wake up after
+sleeping, LWPs that change to the realtime class from some other class, LWPs
+that have used their full time quantum, and runnable LWPs whose priority is
+reset by \fBpriocntl()\fR are all placed at the back of the appropriate queue
+for their priority. An LWP that is preempted by a higher priority LWP remains
+at the front of the queue (with whatever time is remaining in its time quantum)
+and runs before any other LWP at this priority. Following a \fBfork\fR(2)
+function call by a realtime LWP, the parent LWP continues to run while the
+child LWP (which inherits its parent's \fBrt_pri\fR value) is placed at the
+back of the queue.
+.sp
+.LP
+A \fBrtinfo_t\fR structure with the following members, defined in
+\fB<sys/rtpriocntl.h>\fR, defines the format used for the attribute data for
+the realtime class.
+.sp
+.in +2
+.nf
+short rt_maxpri; /* Maximum realtime priority */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBpriocntl()\fR \fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands return
+realtime class attributes in the \fIpc_clinfo\fR buffer in this format.
+.sp
+.LP
+The \fBrt_maxpri\fR member specifies the configured maximum \fBrt_pri\fR value
+for the realtime class. If \fIrt_maxpri\fR is \fBx\fR, the valid realtime
+priorities range from 0 to \fIx\fR.
+.sp
+.LP
+A \fBrtparms_t\fR structure with the following members, defined in
+\fB<sys/rtpriocntl.h>\fR, defines the format used to specify the realtime
+class-specific scheduling parameters of an LWP.
+.sp
+.in +2
+.nf
+short rt_pri; /* Real-Time priority */
+uint_t rt_tqsecs; /* Seconds in time quantum */
+int rt_tqnsecs; /* Additional nanoseconds in quantum */
+.fi
+.in -2
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETPARMS\fR or \fBPC_GETPARMS\fR
+commands, if \fBpc_cid\fR specifies the realtime class, the data in the
+\fIpc_clparms\fR buffer are in this format.
+.sp
+.LP
+These commands can be used to set the realtime priority to the specified value
+or get the current \fIrt_pri\fR value. Setting the \fBrt_pri\fR value of an LWP
+that is currently running or runnable (not sleeping) causes the LWP to be
+placed at the back of the scheduling queue for the specified priority. The LWP
+is placed at the back of the appropriate queue regardless of whether the
+priority being set is different from the previous \fIrt_pri\fR value of the
+LWP. A running LWP can voluntarily release the CPU and go to the back of the
+scheduling queue at the same priority by resetting its \fIrt_pri\fR value to
+its current realtime priority value. To change the time quantum of an LWP
+without setting the priority or affecting the LWP's position on the queue, the
+\fIrt_pri\fR member should be set to the special value \fBRT_NOCHANGE\fR,
+defined in \fB<sys/rtpriocntl.h>\fR. Specifying \fBRT_NOCHANGE\fR when changing
+the class of an LWP to realtime from some other class results in the realtime
+priority being set to 0.
+.sp
+.LP
+For the \fBpriocntl()\fR \fBPC_GETPARMS\fR command, if \fIpc_cid\fR specifies
+the realtime class and more than one realtime LWP is specified, the scheduling
+parameters of the realtime LWP with the highest \fIrt_pri\fR value among the
+specified LWPs are returned and the LWP ID of this LWP is returned by the
+\fBpriocntl()\fR call. If there is more than one LWP sharing the highest
+priority, the one returned is implementation-dependent.
+.sp
+.LP
+The \fIrt_tqsecs\fR and \fIrt_tqnsecs\fR members are used for getting or
+setting the time quantum associated with an LWP or group of LWPs.
+\fIrt_tqsecs\fR is the number of seconds in the time quantum and
+\fBrt_tqnsecs\fR is the number of additional nanoseconds in the quantum. For
+example, setting \fIrt_tqsecs\fR to 2 and \fBrt_tqnsecs\fR to 500,000,000
+(decimal) would result in a time quantum of two and one-half seconds.
+Specifying a value of 1,000,000,000 or greater in the \fIrt_tqnsecs\fR member
+results in an error return with \fBerrno\fR set to \fBEINVAL\fR. Although the
+resolution of the \fItq_nsecs\fR member is very fine, the specified time
+quantum length is rounded up by the system to the next integral multiple of the
+system clock's resolution. The maximum time quantum that can be specified is
+implementation-specific and equal to \fBINT_MAX\fR1 ticks. The \fBINT_MAX\fR
+value is defined in \fB<limits.h>\fR. Requesting a quantum greater than this
+maximum results in an error return with \fBerrno\fR set to \fBERANGE\fR,
+although infinite quantums can be requested using a special value as explained
+below. Requesting a time quantum of 0 by setting both \fIrt_tqsecs\fR and
+\fBrt_tqnsecs\fR to 0 results in an error return with \fBerrno\fR set to
+\fBEINVAL\fR.
+.sp
+.LP
+The \fIrt_tqnsecs\fR member can also be set to one of the following special
+values defined in \fB<sys/rtpriocntl.h>\fR, in which case the value of
+\fIrt_tqsecs\fR is ignored:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRT_TQINF\fR\fR
+.ad
+.RS 15n
+.rt
+Set an infinite time quantum.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRT_TQDEF\fR\fR
+.ad
+.RS 15n
+.rt
+Set the time quantum to the default for this priority (see \fBrt_dptbl\fR(4)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBRT_NOCHANGE\fR\fR
+.ad
+.RS 15n
+.rt
+Do not set the time quantum. This value is useful when you wish to change the
+realtime priority of an LWP without affecting the time quantum. Specifying this
+value when changing the class of an LWP to realtime from some other class is
+equivalent to specifying \fBRT_TQDEF\fR.
+.RE
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETXPARMS\fR or \fBPC_GETXPARMS\fR
+commands, the first argument after the command code must be the class name of
+the realtime class (\fBRT\fR) . The next arguments are formed as (key, value)
+pairs, terminated by a \fB0\fR key. The definition for the keys of the realtime
+class can be found in \fB<sys/rtpriocntl.h>\fR. A repeated specification of the
+same key results in an error return and \fBerrno\fR set to \fBEINVAL\fR.
+.sp
+
+.sp
+.TS
+tab() box;
+cw(1.44i) |cw(1.08i) |cw(2.98i)
+lw(1.44i) |lw(1.08i) |lw(2.98i)
+.
+KeyValue TypeDescription
+_
+\fBRT_KY_PRI\fR\fBpri_t\fRrealtime priority
+\fBRT_KY_TQSECS\fR\fBuint_t\fRseconds in time quantum
+_
+\fBRT_KY_TQNSECS\fR\fBint\fRnanoseconds in time quantum
+_
+\fBRT_KY_TQSIG\fR\fBint\fRrealtime time quantum signal
+.TE
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_GETXPARMS\fR command, the value
+associated with the key is always a pointer to a scheduling parameter of the
+value type shown in the table above. In contrast, when using the
+\fBpriocntl()\fR \fBPC_SETXPARMS\fR command, the scheduling parameter is given
+as a direct value.
+.sp
+.LP
+A \fBpriocntl()\fR \fBPC_SETXPARMS\fR command with the class name (\fBRT\fR)
+and without a following (key, value) pair will set or reset all realtime
+scheduling parameters of the target process(es) to their default values.
+Changing the class of an LWP to realtime from some other class causes the
+parameters to be set to their default values. The default realtime priority
+(\fBRT_KY_PRI\fR) is \fB0\fR. A default time quantum (\fBRT_TQDEF\fR) is
+assigned to each priority class (see \fBrt_dptbl\fR(4)). The default realtime
+time quantum signal (\fBRT_KY_TQSIG\fR) is \fB0\fR.
+.sp
+.LP
+The value associated with \fBRT_KY_TQSECS\fR is the number of seconds in the
+time quantum. The value associated with \fBRT_KY_TQNSECS\fR is the number of
+nanoseconds in the quantum. Specifying a value of 1,000,000,000 or greater for
+the number of nanoseconds results in an error return and \fBerrno\fR is set to
+\fBEINVAL\fR. The specified time quantum is rounded up by the system to the
+next integral multiple of the system clock's resolution. The maximum time
+quantum that can be specified is implementation-specific and equal to
+\fBINT_MAX\fR ticks, defined in \fB<limits.h>\fR. Requesting a quantum greater
+than this maximum results in an error return and \fBerrno\fR is set to
+\fBERANGE\fR. If seconds (\fBRT_KY_TQSECS\fR) but no nanoseconds
+(\fBRT_KY_TQNSECS\fR) are supplied, the number of nanoseconds is set to
+\fB0\fR. If nanoseconds (\fBRT_KY_TQNSECS\fR) but no seconds
+(\fBRT_KY_TQSECS\fR) are supplied, the number of seconds is set to \fB0\fR. A
+time quantum of \fB0\fR (seconds and nanoseconds are \fB0\fR) results in an
+error return with \fBerrno\fR set to \fBEINVAL\fR. Special values for
+\fBRT_KY_TQSECS\fR are \fBRT_TQINF\fR and \fBRT_TQDEF\fR (as described above).
+The \fBpriocntl()\fR command \fBPC_SETXPARMS\fR knows no special value
+\fBRT_NOCHANGE\fR.
+.sp
+.LP
+To change the class of an LWP to realtime from any other class, the LWP
+invoking \fBpriocntl()\fR must have sufficient privileges. To change the
+priority or time quantum setting of a realtime LWP, the LWP invoking
+\fBpriocntl()\fR must have sufficient privileges or must itself be a realtime
+LWP whose real or effective user ID matches the real of effective user ID of
+the target LWP.
+.sp
+.LP
+The realtime priority and time quantum are inherited across \fBfork\fR(2) and
+the \fBexec\fR family of functions. When using the time quantum signal with a
+user-defined signal handler across the \fBexec\fR functions, the new image must
+install an appropriate user-defined signal handler before the time quantum
+expires. Otherwise, unpredictable behavior might result.
+.SH TIME-SHARING CLASS
+.sp
+.LP
+The time-sharing scheduling policy provides for a fair and effective allocation
+of the CPU resource among LWPs with varying CPU consumption characteristics.
+The objectives of the time-sharing policy are to provide good response time to
+interactive LWPs and good throughput to CPU-bound jobs, while providing a
+degree of user/application control over scheduling.
+.sp
+.LP
+The time-sharing class has a range of time-sharing user priority (see
+\fIts_upri\fR below) values that can be assigned to LWPs within the class. A
+\fIts_upri\fR value of 0 is defined as the default base priority for the
+time-sharing class. User priorities range from \(mi\fIx\fR to +\fIx\fR where
+the value of \fIx\fR is configurable and can be determined for a specific
+installation by using the \fBpriocntl()\fR \fBPC_GETCID\fR or
+\fBPC_GETCLINFO\fR command.
+.sp
+.LP
+The purpose of the user priority is to provide some degree of user/application
+control over the scheduling of LWPs in the time-sharing class. Raising or
+lowering the \fIts_upri\fR value of an LWP in the time-sharing class raises or
+lowers the scheduling priority of the LWP. It is not guaranteed, however, that
+an LWP with a higher \fIts_upri\fR value will run before one with a lower
+\fIts_upri\fR value, since the \fIts_upri\fR value is just one factor used to
+determine the scheduling priority of a time-sharing LWP. The system can
+dynamically adjust the internal scheduling priority of a time-sharing LWP based
+on other factors such as recent CPU usage.
+.sp
+.LP
+In addition to the system-wide limits on user priority (returned by the
+\fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands) there is a per LWP user
+priority limit (see \fIts_uprilim\fR below) specifying the maximum
+\fIts_upri\fR value that can be set for a given LWP. By default,
+\fIts_uprilim\fR is 0.
+.sp
+.LP
+A \fBtsinfo_t\fR structure with the following members, defined in
+\fB<sys/tspriocntl.h>\fR, defines the format used for the attribute data for
+the time-sharing class.
+.sp
+.in +2
+.nf
+short ts_maxupri; /* Limits of user priority range */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBpriocntl()\fR \fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands return
+time-sharing class attributes in the \fBpc_clinfo\fR buffer in this format.
+.sp
+.LP
+The \fBts_maxupri\fR member specifies the configured maximum user priority
+value for the time-sharing class. If \fBts_maxupri\fR is \fIx\fR, the valid
+range for both user priorities and user priority limits is from \(mi\fIx\fR to
++\fIx\fR.
+.sp
+.LP
+A \fBtsparms_t\fR structure with the following members, defined in
+\fB<sys/tspriocntl.h>\fR, defines the format used to specify the time-sharing
+class-specific scheduling parameters of an LWP.
+.sp
+.in +2
+.nf
+short ts_uprilim; /* Time-Sharing user priority limit */
+short ts_upri; /* Time-Sharing user priority */
+.fi
+.in -2
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETPARMS\fR or \fBPC_GETPARMS\fR
+commands, if \fBpc_cid\fR specifies the time-sharing class, the data in the
+\fBpc_clparms\fR buffer is in this format.
+.sp
+.LP
+For the \fBpriocntl()\fR \fBPC_GETPARMS\fR command, if \fBpc_cid\fR specifies
+the time-sharing class and more than one time-sharing LWP is specified, the
+scheduling parameters of the time-sharing LWP with the highest \fIts_upri\fR
+value among the specified LWPs is returned and the LWP ID of this LWP is
+returned by the \fBpriocntl()\fR call. If there is more than one LWP sharing
+the highest user priority, the one returned is implementation-dependent.
+.sp
+.LP
+Any time-sharing LWP can lower its own \fIts_uprilim\fR (or that of another LWP
+with the same user ID). Only a time-sharing LWP with sufficient privileges can
+raise a \fIts_uprilim\fR. When changing the class of an LWP to time-sharing
+from some other class, sufficient privileges are required to set the initial
+\fIts_uprilim\fR to a value greater than 0. Attempts by an unprivileged LWP to
+raise a \fIts_uprilim\fR or set an initial \fIts_uprilim\fR greater than 0 fail
+with a return value of \(mi1 and \fBerrno\fR set to \fBEPERM\fR.
+.sp
+.LP
+Any time-sharing LWP can set its own \fIts_upri\fR (or that of another LWP with
+the same user ID) to any value less than or equal to the LWP's
+\fIts_uprilim\fR. Attempts to set the \fIts_upri\fR above the \fIts_uprilim\fR
+(and/or set the \fIts_uprilim\fR below the \fIts_upri\fR) result in the
+\fIts_upri\fR being set equal to the \fIts_uprilim\fR.
+.sp
+.LP
+Either of the \fIts_uprilim\fR or \fIts_upri\fR members can be set to the
+special value \fBTS_NOCHANGE\fR, defined in \fB<sys/tspriocntl.h>\fR, to set
+one of the values without affecting the other. Specifying \fBTS_NOCHANGE\fR for
+the \fIts_upri\fR when the \fIts_uprilim\fR is being set to a value below the
+current \fIts_upri\fR causes the \fIts_upri\fR to be set equal to the
+\fIts_uprilim\fR being set. Specifying \fBTS_NOCHANGE\fR for a parameter when
+changing the class of an LWP to time-sharing (from some other class) causes the
+parameter to be set to a default value. The default value for the
+\fIts_uprilim\fR is \fB0\fR and the default for the \fIts_upri\fR is to set it
+equal to the \fIts_uprilim\fR that is being set.
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETXPARMS\fR or \fBPC_GETXPARMS\fR
+commands, the first argument after the command code is the class name of the
+time-sharing class (\fBTS\fR) . The next arguments are formed as (key, value)
+pairs, terminated by a \fB0\fR key. The definition for the keys of the
+time-sharing class can be found in \fB<sys/tspriocntl.h>\fR. A repeated
+specification of the same key results in an error return and \fBerrno\fR set to
+\fBEINVAL\fR.
+.sp
+
+.sp
+.TS
+tab() box;
+cw(1.44i) |cw(1.08i) |cw(2.98i)
+lw(1.44i) |lw(1.08i) |lw(2.98i)
+.
+KeyValue TypeDescription
+_
+\fBTS_KY_UPRILIM\fR\fBpri_t\fRuser priority limit
+\fBTS_KY_UPRI\fR\fBpri_t\fRuser priority
+.TE
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_GETXPARMS\fR command, the value
+associated with the key is always a pointer to a scheduling parameter of the
+value type in the table above. In contrast, when using the \fBpriocntl()\fR
+\fBPC_SETXPARMS\fR command, the scheduling parameter is given as a direct
+value.
+.sp
+.LP
+A \fBpriocntl()\fR \fBPC_SETXPARMS\fR command with the class name (\fBTS\fR)
+and without a following (key, value) pair will set or reset all time-sharing
+scheduling parameters of the target process(es) to their default values.
+Changing the class of an LWP to time-sharing from some other class causes the
+parameters to be set to their default values. The default value for the user
+priority limit (\fBTS_KY_UPRILIM\fR) is \fB0\fR. The default value for the user
+priority (\fBTS_KY_UPRI\fR) is equal to the user priority limit
+(\fBTS_KY_UPRILIM\fR) that is being set.
+.sp
+.LP
+The \fBpriocntl()\fR command \fBPC_SETXPARMS\fR knows no special value
+\fBTS_NOCHANGE\fR.
+.sp
+.LP
+The time-sharing user priority and user priority limit are inherited across
+\fBfork()\fR and the \fBexec\fR family of functions.
+.SH INTERACTIVE CLASS
+.sp
+.LP
+The interactive scheduling policy is a variation on the time-sharing scheduling
+policy. All that can be said about the time-sharing scheduling policy is also
+true for the interactive scheduling policy, with one addition: An LWP in the
+interactive class with its \fIia_mode\fR value set to \fBIA_SET_INTERACTIVE\fR
+has its time-sharing priority boosted by \fBIA_BOOST\fR (10).
+.sp
+.LP
+An \fBiainfo_t\fR structure with the following members, defined in
+\fB<sys/iapriocntl.h>\fR, defines the format used for the attribute data for
+the interactive class.
+.sp
+.in +2
+.nf
+short ia_maxupri; /* Limits of user priority range */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBpriocntl()\fR \fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands return
+interactive class attributes in the \fIpc_clinfo\fR buffer in this format.
+.sp
+.LP
+The \fIia_maxupri\fR member specifies the configured maximum user priority
+value for the interactive class. If \fIia_maxupri\fR is \fBx\fR, the valid
+range for both user priorities and user priority limits is from -x to +x.
+.sp
+.LP
+A \fBiaparms_t\fR structure with the following members, defined in
+\fB<sys/iapriocntl.h>\fR, defines the format used to specify the interactive
+class-specific scheduling parameters of an LWP.
+.sp
+.in +2
+.nf
+short ia_uprilim; /* Interactive user priority limit */
+short ia_upri; /* Interactive user priority */
+int ia_mode; /* interactive on/off */
+.fi
+.in -2
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETPARMS\fR or \fBPC_GETPARMS\fR
+commands, if \fIpc_cid\fR specifies the interactive class, the data in the
+\fIpc_clparms\fR buffer is in this format.
+.sp
+.LP
+For the \fBpriocntl()\fR \fBPC_GETPARMS\fR command, if \fIpc_cid\fR specifies
+the interactive class and more than one interactive LWP is specified, the
+scheduling parameters of the interactive LWP with the highest \fIia_upri\fR
+value among the specified LWPs is returned and the LWP ID of this LWP is
+returned by the \fBpriocntl()\fR call. If there is more than one LWP sharing
+the highest user priority, the one returned is implementation-dependent.
+.sp
+.LP
+All that is said above in the TIME-SHARING CLASS section concerning
+manipulation of \fIts_uprilim\fR and \fIts_upri\fR applies equally to
+manipulations of \fIia_uprilim\fR and \fIia_upri\fR in the interactive class.
+.sp
+.LP
+When using the \fBPC_SETPARMS\fR command, the \fIia_mode\fR member must be set
+to one of the values \fBIA_SET_INTERACTIVE\fR, \fBIA_INTERACTIVE_OFF\fR, or
+\fBIA_NOCHANGE\fR, defined in \fB<sys/iapriocntl.h>\fR, to set the interactive
+mode on or off or to make no change to the interactive mode.
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETXPARMS\fR or \fBPC_GETXPARMS\fR
+commands, the first argument after the command code is the class name of the
+interactive class (IA) . The next arguments are formed as (key, value) pairs,
+terminated by a 0 key. The definition for the keys of the interactive class can
+be found in \fB<sys/iapriocntl.h>\fR. A repeated specification of the same key
+results in an error return and \fBerrno\fR set to \fBEINVAL\fR.
+.sp
+
+.sp
+.TS
+tab();
+cw(1.83i) cw(1.83i) cw(1.83i)
+lw(1.83i) lw(1.83i) lw(1.83i)
+.
+KeyValue TypeDescription
+\fBIA_KY_UPRILIM\fR\fBpri_t\fRuser priority limit
+\fBIA_KY_UPRI\fR\fBpri_t\fRuser priority
+\fBIA_KY_MODE\fR\fBint\fRinteractive mode
+.TE
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_GETXPARMS\fR command, the value
+associated with the key is always a pointer to a scheduling parameter of the
+value type in the table above. In contrast, when using the \fBpriocntl()\fR
+\fBPC_SETXPARMS\fR command, the scheduling parameter is given as a direct
+value.
+.sp
+.LP
+A \fBpriocntl()\fR \fBPC_SETXPARMS\fR command with the class name (IA) and
+without a following (key, value) pair will set or reset all interactive
+scheduling parameters of the target process(es) to their default values.
+Changing the class of an LWP to interactive from some other class causes the
+parameters to be set to their default values. The default value for the user
+priority limit (\fBIA_KY_UPRILIM\fR) is 0. The default value for the user
+priority (\fBIA_KY_UPRI\fR) is equal to the user priority limit
+(\fBIA_KY_UPRILIM\fR) that is being set. The default value for the interactive
+mode (\fBIA_KY_MODE\fR) is \fBIA_SET_INTERACTIVE\fR.
+.sp
+.LP
+The \fBpriocntl()\fR command \fBPC_SETXPARMS\fR knows no special value
+\fBIA_NOCHANGE\fR.
+.sp
+.LP
+The interactive user priority and user priority limit are inherited across fork
+and the exec family of functions.
+.SH FAIR-SHARE CLASS
+.sp
+.LP
+The fair-share scheduling policy provides a fair allocation of CPU resources
+among projects, independent of the number of processes they contain. Projects
+are given "shares" to control their quota of CPU resources. See \fBFSS\fR(7)
+for more information about how to configure shares.
+.sp
+.LP
+The fair share class supports the notion of per-LWP user priority (see
+\fBfss_upri\fR below) values for compatibility with the time-sharing scheduling
+class. An \fIfss_upri\fR value of 0 is defined as the default base priority for
+the fair-share class. User priorities range from -\fIx\fR to +\fIx\fR where the
+value of \fIx\fR is configurable and can be determined for a specific
+installation by using the \fBpriocntl()\fR \fBPC_GETCID\fR or
+\fBPC_GETCLINFO\fR command.
+.sp
+.LP
+The purpose of the user priority is to provide some degree of user/application
+control over the scheduling of LWPs in the fair-share class. Raising the
+\fBfss_upri\fR value of an LWP in the fair-share class tells the scheduler to
+give this LWP more CPU time slices, while lowering the \fBfss_upri\fR value
+tells the scheduler to give it less CPU slices. It is not guaranteed, however,
+that an LWP with a higher \fBfss_upri\fR value will run before one with a lower
+\fBfss_upri\fR value. This is because the \fBfss_upri\fR value is just one
+factor used to determine the scheduling priority of a fair-share LWP. The
+system can dynamically adjust the internal scheduling priority of a fair-share
+LWP based on other factors such as recent CPU usage. The fair-share scheduler
+attempts to provide an evenly graded effect across the whole range of user
+priority values.
+.sp
+.LP
+User priority values do not interfere with project shares. That is, changing a
+user priority value of a process does not have any effect on its project CPU
+entitlement, which is based on the number of shares it is allocated in
+comparison with other projects.
+.sp
+.LP
+In addition to the system-wide limits on user priority (returned by the
+\fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands), there is a per-LWP user
+priority limit (see \fIfss_uprilim\fR below) that specifies the maximum
+\fBfss_upri\fR value that can be set for a given LWP. By default,
+\fIfss_uprilim\fR is 0.
+.sp
+.LP
+A \fBfssinfo_t\fR structure with the following members, defined in
+\fB<sys/fsspriocntl.h>\fR, defines the format used for the attribute data for
+the fair-share class.
+.sp
+.in +2
+.nf
+short fss_maxupri; /* Limits of user priority range */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBpriocntl()\fR \fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands return
+fair-share class attributes in the \fIpc_clinfo\fR buffer in this format.
+.sp
+.LP
+\fIfss_maxupri\fR specifies the configured maximum user priority value for the
+fair-share class. If \fBfss_maxupri\fR is \fIx\fR, the valid range for both
+user priorities and user priority limits is from -\fIx\fR to +\fIx\fR.
+.sp
+.LP
+A \fBfssparms_t\fR structure with the following members, defined in
+\fB<sys/fsspriocntl.h>\fR, defines the format used to specify the fair-share
+class-specific scheduling parameters of an LWP.
+.sp
+.in +2
+.nf
+short fss_uprilim; /* Fair-share user priority limit */
+short fss_upri; /* Fair-share user priority */
+.fi
+.in -2
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETPARMS\fR or \fBPC_GETPARMS\fR
+commands, if \fIpc_cid\fR specifies the fair-share class, the data in the
+\fIpc_clparms\fR buffer is in this format.
+.sp
+.LP
+For the \fBpriocntl()\fR \fBPC_GETPARMS\fR command, if \fIpc_cid\fR specifies
+the fair-share class and more than one fair-share LWP is specified, the
+scheduling parameters of the fair-share LWP with the highest \fIfss_upri\fR
+value among the specified LWPs is returned and the LWP ID of this LWP is
+returned by the \fBpriocntl()\fR call. If there is more than one LWP sharing
+the highest user priority, the one returned is implementation-dependent.
+.sp
+.LP
+Any fair-share LWP can lower its own \fIfss_uprilim\fR (or that of another LWP
+with the same user ID). Only a fair-share LWP with sufficient privileges can
+raise an \fIfss_uprilim\fR. When changing the class of an LWP to fair-share
+from some other class, sufficient privileges are required to enter the FSS
+class or to set the initial \fIfss_uprilim\fR to a value greater than 0.
+Attempts by an unprivileged LWP to raise an \fIfss_uprilim\fR or set an initial
+\fIfss_uprilim\fR greater than 0 fail with a return value of -1 and \fBerrno\fR
+set to \fBEPERM\fR.
+.sp
+.LP
+Any fair-share LWP can set its own \fIfss_upri\fR (or that of another LWP with
+the same user ID) to any value less than or equal to the LWP's
+\fIfss_uprilim\fR. Attempts to set the \fBfss_upr\fRi above the
+\fBfss_uprilim\fR (and/or set the \fIfss_uprilim\fR below the \fIfss_upri\fR)
+result in the \fIfss_upri\fR being set equal to the \fIfss_uprilim\fR.
+.sp
+.LP
+Either of the \fIfss_uprilim\fR or \fBfss_upri\fR members can be set to the
+special value \fBFSS_NOCHANGE\fR (defined in \fB<sys/fsspriocntl.h>\fR) to set
+one of the values without affecting the other. Specifying \fBFSS_NOCHANGE\fR
+for the \fIfss_upri\fR when the \fIfss_uprilim\fR is being set to a value below
+the current \fIfss_upri\fR causes the \fIfss_upri\fR to be set equal to the
+\fIfss_uprilim\fR being set. Specifying \fBFSS_NOCHANGE\fR for a parameter when
+changing the class of an LWP to fair-share (from some other class) causes the
+parameter to be set to a default value. The default value for the
+\fBfss_uprilim\fR is 0 and the default for the \fBfss_upri\fR is to set it
+equal to the \fIfss_uprilim\fR which is being set.
+.sp
+.LP
+The fair-share user priority and user priority limit are inherited across
+\fBfork()\fR and the \fBexec\fR family of functions.
+.SH FIXED-PRIORITY CLASS
+.sp
+.LP
+The fixed-priority class provides a fixed-priority preemptive scheduling policy
+for those LWPs requiring that the scheduling priorities do not get dynamically
+adjusted by the system and that the user/application have control of the
+scheduling priorities.
+.sp
+.LP
+The fixed-priority class has a range of fixed-priority user priority (see
+\fBfx_upri\fR below) values that can be assigned to LWPs within the class. A
+\fIfx_upri\fR value of 0 is defined as the default base priority for the
+fixed-priority class. User priorities range from 0 to \fIx\fR where the value
+of \fIx\fR is configurable and can be determined for a specific installation by
+using the \fBpriocntl()\fR \fBPC_GETCID\fR or \fBPC_GETCLINFO\fR command.
+.sp
+.LP
+The purpose of the user priority is to provide user/application control over
+the scheduling of processes in the fixed-priority class. For processes in the
+fixed-priority class, the \fIfx_upri\fR value is, for all practical purposes,
+equivalent to the scheduling priority of the process. The \fIfx_upri\fR value
+completely determines the scheduling priority of a fixed-priority process
+relative to other processes within its class. Numerically higher \fIfx_upri\fR
+values represent higher priorities.
+.sp
+.LP
+In addition to the system-wide limits on user priority (returned by the
+\fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands), there is a per-LWP user
+priority limit (see \fIfx_uprilim\fR below) that specifies the maximum
+\fIfx_upri\fR value that can be set for a given LWP. By default,
+\fIfx_uprilim\fR is 0.
+.sp
+.LP
+A structure with the following member (defined in \fB<sys/fxpriocntl.h>\fR)
+defines the format used for the attribute data for the fixed-priority class.
+.sp
+.in +2
+.nf
+pri_t fx_maxupri; /* Maximum user priority */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBpriocntl()\fR \fBPC_GETCID\fR and \fBPC_GETCLINFO\fR commands return
+fixed-priority class attributes in the \fIpc_clinfo\fR buffer in this format.
+.sp
+.LP
+The \fIfx_maxupri\fR member specifies the configured maximum user priority
+value for the fixed-priority class. If \fIfx_maxupri\fR is \fIx\fR, the valid
+range for both user priorities and user priority limits is from 0 to \fIx\fR.
+.sp
+.LP
+A structure with the following members (defined in \fB<sys/fxpriocntl.h>\fR)
+defines the format used to specify the fixed-priority class-specific scheduling
+parameters of an LWP.
+.sp
+.in +2
+.nf
+pri_t fx_upri; /* Fixed-priority user priority */
+pri_t fx_uprilim; /* Fixed-priority user priority limit */
+uint_t fx_tqsecs; /* seconds in time quantum */
+int fx_tqnsecs; /* additional nanosecs in time quant */
+.fi
+.in -2
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETPARMS\fR or \fBPC_GETPARMS\fR
+commands, if \fIpc_cid\fR specifies the fixed-priority class, the data in the
+\fIpc_clparms\fR buffer is in this format.
+.sp
+.LP
+For the \fBpriocntl()\fR \fBPC_GETPARMS\fR command, if \fIpc_cid\fR specifies
+the fixed-priority class and more than one fixed-priority LWP is specified, the
+scheduling parameters of the fixed-priority LWP with the highest \fIfx_upri\fR
+value among the specified LWPs is returned and the LWP ID of this LWP is
+returned by the \fBpriocntl()\fR call. If there is more than one LWP sharing
+the highest user priority, the one returned is implementation-dependent.
+.sp
+.LP
+Any fixed-priority LWP can lower its own \fIfx_uprilim\fR (or that of another
+LWP with the same user ID). Only a fixed-priority LWP with sufficient
+privileges can raise a \fIfx_uprilim\fR. When changing the class of an LWP to
+fixed-priority from some other class, sufficient privileges are required to set
+the initial \fIfx_uprilim\fR to a value greater than 0. Attempts by an
+unprivileged LWP to raise a \fIfx_uprilim\fR or set an initial \fBfx_uprilim\fR
+greater than 0 fail with a return value of -1 and errno set to \fBEPERM\fR.
+.sp
+.LP
+Any fixed-priority LWP can set its own \fIfx_upri\fR (or that of another LWP
+with the same user ID) to any value less than or equal to the LWP's
+\fIfx_uprilim\fR. Attempts to set the \fIfx_upri\fR above the \fBfx_uprilim\fR
+(and/or set the \fIfx_uprilim\fR below the \fIfx_upri\fR) result in the
+\fBfx_upri\fR being set equal to the \fIfx_uprilim\fR.
+.sp
+.LP
+Either of the \fIfx_uprilim\fR or \fIfx_upri\fR members can be set to the
+special value \fBFX_NOCHANGE\fR (defined in \fB<sys/fxpriocntl.h>\fR) to set
+one of the values without affecting the other. Specifying \fBFX_NOCHANGE\fR for
+the \fIfx_upri\fR when the \fIfx_uprilim\fR is being set to a value below the
+current \fIfx_upri\fR causes the \fIfx_upri\fR to be set equal to the
+\fIfx_uprilim\fR being set. Specifying \fBFX_NOCHANGE\fR for a parameter when
+changing the class of an LWP to fixed-priority (from some other class) causes
+the parameter to be set to a default value. The default value for the
+\fIfx_uprilim\fR is 0 and the default for the \fIfx_upri\fR is to set it equal
+to the \fIfx_uprilim\fR that is being set. The default for time quantum is
+dependent on the \fIfx_upri\fR and on the system configuration; see
+\fBfx_dptbl\fR(4).
+.sp
+.LP
+The \fIfx_tqsecs\fR and \fIfx_tqnsecs\fR members are used for getting or
+setting the time quantum associated with an LWP or group of LWPs.
+\fIfx_tqsecs\fR is the number of seconds in the time quantum and
+\fIfx_tqnsecs\fR is the number of additional nanoseconds in the quantum. For
+example, setting \fIfx_tqsecs\fR to 2 and \fIfx_tqnsecs\fR to 500,000,000
+(decimal) would result in a time quantum of two and one-half seconds.
+Specifying a value of 1,000,000,000 or greater in the \fIfx_tqnsecs\fR member
+results in an error return with \fBerrno\fR set to \fBEINVAL\fR. Although the
+resolution of the \fItq_nsecs\fR member is very fine, the specified time
+quantum length is rounded up by the system to the next integral multiple of the
+system clock's resolution. The maximum time quantum that can be specified is
+implementation-specific and equal to \fBINT_MAX\fR ticks (defined in
+\fB<limits.h>\fR). Requesting a quantum greater than this maximum results in an
+error return with \fBerrno\fR set to \fBERANGE\fR, although infinite quantums
+can be requested using a special value as explained below. Requesting a time
+quantum of 0 (setting both \fIfx_tqsecs\fR and \fIfx_tqnsecs\fR to 0) results
+in an error return with \fBerrno\fR set to \fBEINVAL\fR.
+.sp
+.LP
+The \fIfx_tqnsecs\fR member can also be set to one of the following special
+values (defined in \fB<sys/fxpriocntl.h>\fR), in which case the value of
+\fIfx_tqsecs\fR is ignored:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFX_TQINF\fR\fR
+.ad
+.RS 15n
+.rt
+Set an infinite time quantum.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFX_TQDEF\fR\fR
+.ad
+.RS 15n
+.rt
+Set the time quantum to the default for this priority (see \fBfx_dptbl\fR(4)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBFX_NOCHANGE\fR\fR
+.ad
+.RS 15n
+.rt
+Do not set the time quantum. This value is useful in changing the user priority
+of an LWP without affecting the time quantum. Specifying this value when
+changing the class of an LWP to fixed-priority from some other class is
+equivalent to specifying \fBFX_TQDEF\fR.
+.RE
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_SETXPARMS\fR or \fBPC_GETXPARMS\fR
+commands, the first argument after the command code must be the class name of
+the fixed-priority class (FX) . The next arguments are formed as (key, value)
+pairs, terminated by a 0 key. The definition for the keys of the fixed-priority
+class can be found in \fB<sys/fxpriocntl.h>\fR. A repeated specification of the
+same key results in an error return and \fBerrno\fR set to \fBEINVAL\fR.
+.sp
+
+.sp
+.TS
+tab() box;
+cw(1.44i) |cw(1.08i) |cw(2.98i)
+lw(1.44i) |lw(1.08i) |lw(2.98i)
+.
+KeyValue TypeDescription
+_
+\fBFX_KY_UPRILIM\fR\fBpri_t\fRuser priority limit
+\fBFX_KY_UPRI\fR\fBpri_t\fRuser priority
+_
+\fBFX_KY_TQSECS\fR\fBuint_t\fRseconds in time quantum
+_
+\fBFX_KY_TQNSECS\fR\fBint\fRnanoseconds in time quantum
+.TE
+
+.sp
+.LP
+When using the \fBpriocntl()\fR \fBPC_GETXPARMS\fR command, the value
+associated with the key is always a pointer to a scheduling parameter of the
+value type shown in the table above. In contrast, when using the
+\fBpriocntl()\fR \fBPC_SETXPARMS\fR command, the scheduling parameter is given
+as a direct value.
+.sp
+.LP
+A \fBpriocntl()\fR \fBPC_SETXPARMS\fR command with the class name (FX) and
+without a following (key, value) pair will set or reset all realtime scheduling
+parameters of the target process(es) to their default values. Changing the
+class of an LWP to fixed-priority from some other class causes the parameters
+to be set to their default values. The default value for the user priority
+limit (\fBFX_KY_UPRILIM\fR) is 0. The default value for the user priority
+(\fBFX_KY_UPRI\fR) is equal to the user priority limit (\fBFX_KY_UPRILIM\fR)
+that is being set. A default time quantum (\fBFX_TQDEF\fR) is assigned to each
+priority class (see \fBfx_dptbl\fR(4)).
+.sp
+.LP
+The value associated with \fBFX_KY_TQSECS\fR is the number of seconds in the
+time quantum. The value associated with \fBFX_KY_TQNSECS\fR is the number of
+nanoseconds in the quantum. Specifying a value of 1,000,000,000 or greater for
+the number of nanoseconds results in an error return and \fBerrno\fR is set to
+\fBEINVAL\fR. The specified time quantum is rounded up by the system to the
+next integral multiple of the system clock's resolution. The maximum time
+quantum that can be specified is implementation-specific and equal to
+\fBINT_MAX\fR ticks, defined in \fB<limits.h>\fR. Requesting a quantum greater
+than this maximum results in an error return and \fBerrno\fR is set to
+\fBERANGE\fR. If seconds (\fBFX_KY_TQSECS\fR) but no nanoseconds
+(\fBFX_KY_TQNSECS\fR) are supplied, the number of nanoseconds is set to 0. If
+nanoseconds (\fBFX_KY_TQNSECS\fR) but no seconds (\fBFX_KY_TQSECS\fR) are
+supplied, the number of seconds is set to 0. A time quantum of 0 (seconds and
+nanoseconds are 0) results in an error return with \fBerrno\fR set to
+\fBEINVAL\fR. Special values for \fBFX_KY_TQSECS\fR are \fBFX_TQINF\fR and
+\fBFX_TQDEF\fR (as described above). The \fBpriocntl()\fR command
+\fBPC_SETXPARMS\fR knows no special value \fBFX_NOCHANGE\fR.
+.sp
+.LP
+The fixed-priority user priority and user priority limit are inherited across
+\fBfork\fR(2) and the \fBexec\fR family of functions.
+.SH RETURN VALUES
+.sp
+.LP
+Unless otherwise noted above, \fBpriocntl()\fR returns \fB0\fR on success. On
+failure, \fBpriocntl()\fR returns \fB\(mi1\fR and sets \fBerrno\fR to indicate
+the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpriocntl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+An attempt to change the class of an LWP failed because of insufficient
+resources other than memory (for example, class-specific kernel data
+structures).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+One of the arguments points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The argument \fIcmd\fR was invalid, an invalid or unconfigured class was
+specified, or one of the parameters specified was invalid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+An attempt to change the class of an LWP failed because of insufficient memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_PRIOCNTL\fR} privilege is not asserted in the effective set
+of the calling LWP.
+.sp
+The calling LWP does not have sufficient privileges to affect the target LWP.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 10n
+.rt
+The requested time quantum is out of range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+None of the specified LWPs exist.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpriocntl\fR(1), \fBdispadmin\fR(1M), \fBinit\fR(1M), \fBexec\fR(2),
+\fBfork\fR(2), \fBnice\fR(2), \fBpriocntlset\fR(2), \fBfx_dptbl\fR(4),
+\fBprocess\fR(4), \fBrt_dptbl\fR(4), \fBprivileges\fR(5)
+.sp
+.LP
+\fISystem Administration Guide: Basic Administration\fR
+.sp
+.LP
+\fIProgramming Interfaces Guide\fR
diff --git a/usr/src/man/man2/priocntlset.2 b/usr/src/man/man2/priocntlset.2
new file mode 100644
index 0000000000..693ee6fdf1
--- /dev/null
+++ b/usr/src/man/man2/priocntlset.2
@@ -0,0 +1,219 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH priocntlset 2 "1 Apr 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+priocntlset \- generalized process scheduler control
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/procset.h>
+#include <sys/priocntl.h>
+#include <sys/rtpriocntl.h>
+#include <sys/tspriocntl.h>
+#include <sys/iapriocntl.h>
+#include <sys/fsspriocntl.h>
+#include <sys/fxpriocntl.h>
+
+\fBlong\fR \fBpriocntlset\fR(\fBprocset_t *\fR\fIpsp\fR, \fBint\fR \fIcmd\fR, \fB/*\fR \fIarg\fR */ ...);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpriocntlset()\fR function changes the scheduling properties of running
+processes. \fBpriocntlset()\fR has the same functions as the \fBpriocntl()\fR
+function, but a more general way of specifying the set of processes whose
+scheduling properties are to be changed.
+.sp
+.LP
+\fIcmd\fR specifies the function to be performed. \fIarg\fR is a pointer to a
+structure whose type depends on \fIcmd\fR. See \fBpriocntl\fR(2) for the valid
+values of \fIcmd\fR and the corresponding \fIarg\fR structures.
+.sp
+.LP
+\fIpsp\fR is a pointer to a \fBprocset\fR structure, which \fBpriocntlset()\fR
+uses to specify the set of processes whose scheduling properties are to be
+changed. The \fBprocset\fR structure contains the following members:
+.sp
+.in +2
+.nf
+idop_t p_op; /* operator connecting left/right sets */
+idtype_t p_lidtype; /* left set ID type */
+id_t p_lid; /* left set ID */
+idtype_t p_ridtype; /* right set ID type */
+id_t p_rid; /* right set ID */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBp_lidtype\fR and \fBp_lid\fR members specify the \fBID\fR type and
+\fBID\fR of one ("left") set of processes; the \fBp_ridtype\fR and \fBp_rid\fR
+members specify the \fBID\fR type and \fBID\fR of a second ("right") set of
+processes. \fBID\fR types and \fBID\fRs are specified just as for the
+\fBpriocntl()\fR function. The \fBp_op\fR member specifies the operation to be
+performed on the two sets of processes to get the set of processes the function
+is to apply to. The valid values for \fBp_op\fR and the processes they specify
+are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_DIFF\fR\fR
+.ad
+.RS 12n
+.rt
+Set difference: processes in left set and not in right set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_AND\fR\fR
+.ad
+.RS 12n
+.rt
+Set intersection: processes in both left and right sets.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_OR\fR\fR
+.ad
+.RS 12n
+.rt
+Set union: processes in either left or right sets or both.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_XOR\fR\fR
+.ad
+.RS 12n
+.rt
+Set exclusive-or: processes in left or right set but not in both.
+.RE
+
+.sp
+.LP
+The following macro, which is defined in <\fBprocset.h\fR>, offers a convenient
+way to initialize a \fBprocset\fR structure:
+.sp
+.in +2
+.nf
+#define setprocset(psp, op, ltype, lid, rtype, rid) \e
+(psp)->p_op = (op), \e
+(psp)->p_lidtype = (ltype), \e
+(psp)->p_lid = (lid), \e
+(psp)->p_ridtype = (rtype), \e
+(psp)->p_rid = (rid),
+.fi
+.in -2
+
+.SH RETURN VALUES
+.sp
+.LP
+Unless otherwise noted above, \fBpriocntlset()\fR returns \fB0\fR on success.
+Otherwise, it returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpriocntlset()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+An attempt to change the class of a process failed because of insufficient
+resources other than memory (for example, class-specific kernel data
+structures).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+One of the arguments points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The argument \fIcmd\fR was invalid, an invalid or unconfigured class was
+specified, or one of the parameters specified was invalid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+An attempt to change the class of a process failed because of insufficient
+memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_PRIOCNTL\fR} privilege is not asserted in the effective set
+of the calling LWP.
+.sp
+The calling LWP does not have sufficient privileges to affect the target LWP.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 10n
+.rt
+The requested time quantum is out of range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+None of the specified processes exist.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpriocntl\fR(1), \fBpriocntl\fR(2)
diff --git a/usr/src/man/man2/processor_bind.2 b/usr/src/man/man2/processor_bind.2
new file mode 100644
index 0000000000..6e342e89fe
--- /dev/null
+++ b/usr/src/man/man2/processor_bind.2
@@ -0,0 +1,174 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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. 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. 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]
+.TH processor_bind 2 "13 Mar 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+processor_bind \- bind LWPs to a processor
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/processor.h>
+#include <sys/procset.h>
+
+\fBint\fR \fBprocessor_bind\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBprocessorid_t\fR \fIprocessorid\fR,
+ \fBprocessorid_t *\fR\fIobind\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBprocessor_bind()\fR function binds the LWP (lightweight process) or set
+of LWPs specified by \fIidtype\fR and \fIid\fR to the processor specified by
+\fIprocessorid\fR. If \fIobind\fR is not \fINULL\fR, this function also sets
+the \fBprocessorid_t\fR variable pointed to by \fIobind\fR to the previous
+binding of one of the specified LWPs, or to \fBPBIND_NONE\fR if the selected
+LWP was not bound.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PID\fR, the binding affects all LWPs of the process
+with process ID (PID) \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_LWPID\fR, the binding affects the LWP of the current
+process with LWP ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_TASKID\fR, the binding affects all LWPs of all
+processes with task ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PROJID\fR, the binding affects all LWPs of all
+processes with project ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_CTID\fR, the binding affects all LWPs of all processes
+with process contract ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_ZONEID\fR, the binding affects all LWPs of all
+processes with zone ID \fIid\fR.
+.sp
+.LP
+If \fIid\fR is \fBP_MYID\fR, the specified LWP, process, task, or project is
+the current one.
+.sp
+.LP
+If \fIprocessorid\fR is \fBPBIND_NONE\fR, the processor bindings of the
+specified LWPs are cleared.
+.sp
+.LP
+If \fIprocessorid\fR is \fBPBIND_QUERY\fR, the processor bindings are not
+changed.
+.sp
+.LP
+The {\fBPRIV_PROC_OWNER\fR} privilege must be asserted in the effective set of
+the calling process or the real or effective user ID of the calling process
+must match the real or effective user ID of the \fBLWP\fRs being bound. If the
+calling process does not have permission to change all of the specified LWPs,
+the bindings of the LWPs for which it does have permission will be changed even
+though an error is returned.
+.sp
+.LP
+Processor bindings are inherited across \fBfork\fR(2) and \fBexec\fR(2).
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBprocessor_bind()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The location pointed to by \fIobind\fR was not \fINULL\fR and not writable by
+the user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The specified processor is not on-line, or the \fIidtype\fR argument was not
+\fBP_PID\fR, \fBP_LWPID\fR, \fBP_PROJID\fR, \fBP_TASKID\fR, \fBP_CTID\fR, or
+\fBP_ZONEID\fR.
+.sp
+The caller is in a non-global zone, the pools facility is active, and the
+processor is not a member of the zone's pool's processor set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+Binding a system process to a processor set is not supported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The {\fBPRIV_PROC_OWNER\fR} privilege is not asserted in the effective set of
+the calling process and its real or effective user ID does not match the real
+or effective user \fBID\fR of one of the \fBLWP\fRs being bound.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 11n
+.rt
+No processes, \fBLWP\fRs, or tasks were found to match the criteria specified
+by \fIidtype\fR and \fIid\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpsradm\fR(1M), \fBpsrinfo\fR(1M), \fBzoneadm\fR(1M),
+\fBexec\fR(2), \fBfork\fR(2), \fBp_online\fR(2), \fBpset_bind\fR(2),
+\fBsysconf\fR(3C), \fBprocess\fR(4), \fBproject\fR(4), \fBattributes\fR(5),
+\fBprivileges\fR(5)
diff --git a/usr/src/man/man2/processor_info.2 b/usr/src/man/man2/processor_info.2
new file mode 100644
index 0000000000..05dd2138b8
--- /dev/null
+++ b/usr/src/man/man2/processor_info.2
@@ -0,0 +1,94 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH processor_info 2 "28 Jun 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+processor_info \- determine type and status of a processor
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/processor.h>
+
+\fBint\fR \fBprocessor_info\fR(\fBprocessorid_t\fR \fIprocessorid\fR, \fBprocessor_info_t *\fR\fIinfop\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBprocessor_info()\fR function returns the status of the processor
+specified by \fIprocessorid\fR in the \fBprocessor_info_t\fR structure pointed
+to by \fIinfop\fR.
+.sp
+.LP
+The structure \fBprocessor_info_t\fR contains the following members:
+.sp
+.in +2
+.nf
+int pi_state;
+char pi_processor_type[PI_TYPELEN];
+char pi_fputypes[PI_FPUTYPE];
+int pi_clock;
+.fi
+.in -2
+
+.sp
+.LP
+The \fBpi_state\fR member is the current state of the processor, either
+\fBP_ONLINE\fR, \fBP_OFFLINE\fR, \fBP_NOINTR\fR, \fBP_FAULTED\fR,
+\fBP_SPARE\fR, or \fBP_POWEROFF\fR.
+.sp
+.LP
+The \fBpi_processor_type\fR member is a null-terminated ASCII string specifying
+the type of the processor.
+.sp
+.LP
+The \fBpi_fputypes\fR member is a null-terminated ASCII string containing the
+comma-separated types of floating-point units (FPUs) attached to the processor.
+This string will be empty if no FPU is attached.
+.sp
+.LP
+The \fBpi_clock\fR member is the processor clock frequency rounded to the
+nearest megahertz. It may be \fB0\fR if not known.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBprocessor_info()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+An non-existent processor \fBID\fR was specified.
+.sp
+The caller is in a non-global zone, the pools facility is active, and the
+processor is not a member of the zone's pool's processor set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBprocessor_info_t\fR structure pointed to by \fIinfop\fR was not
+writable by the user.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpsradm\fR(1M), \fBpsrinfo\fR(1M), \fBzoneadm\fR(1M),
+\fBp_online\fR(2), \fBsysconf\fR(3C)
diff --git a/usr/src/man/man2/profil.2 b/usr/src/man/man2/profil.2
new file mode 100644
index 0000000000..c3eeab0e2e
--- /dev/null
+++ b/usr/src/man/man2/profil.2
@@ -0,0 +1,130 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH profil 2 "12 Nov 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+profil \- execution time profile
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBvoid\fR \fBprofil\fR(\fBunsigned short *\fR\fIbuff\fR, \fBunsigned int\fR \fIbufsiz\fR, \fBunsigned int\fR \fIoffset\fR,
+ \fBunsigned int\fR \fIscale\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBprofil()\fR function provides CPU-use statistics by profiling the amount
+of \fBCPU\fR time expended by a program. The \fBprofil()\fR function generates
+the statistics by creating an execution histogram for a current process. The
+histogram is defined for a specific region of program code to be profiled, and
+the identified region is logically broken up into a set of equal size
+subdivisions, each of which corresponds to a count in the histogram. With each
+clock tick, the current subdivision is identified and its corresponding
+histogram count is incremented. These counts establish a relative measure of
+how much time is being spent in each code subdivision. The resulting histogram
+counts for a profiled region can be used to identify those functions that
+consume a disproportionately high percentage of \fBCPU\fR time.
+.sp
+.LP
+The \fIbuff\fR argument is a buffer of \fIbufsiz\fR bytes in which the
+histogram counts are stored in an array of \fBunsigned short int\fR. Once one
+of the counts reaches 32767 (the size of a \fB short int\fR), profiling stops
+and no more data is collected.
+.sp
+.LP
+The \fIoffset\fR, \fIscale\fR, and \fIbufsiz\fR arguments specify the region
+to be profiled.
+.sp
+.LP
+The \fIoffset\fR argument is effectively the start address of the region to be
+profiled.
+.sp
+.LP
+The \fIscale\fR argument is a contraction factor that indicates how much
+smaller the histogram buffer is than the region to be profiled. More precisely,
+\fIscale\fR is interpreted as an unsigned 16-bit fixed-point fraction with the
+decimal point implied on the left. Its value is the reciprocal of the number of
+bytes in a subdivision, per byte of histogram buffer. Since there are two bytes
+per histogram counter, the effective ratio of subdivision bytes per counter is
+one half the scale.
+.sp
+.LP
+The values of \fIscale\fR are as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the maximum value of \fIscale\fR, \fB0xffff\fR (approximately 1), maps
+subdivisions 2 bytes long to each counter.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the minimum value of \fIscale\fR (for which profiling is performed),
+\fB0x0002\fR (1/32,768), maps subdivision 65,536 bytes long to each counter.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the default value of \fIscale\fR (currently used by \fBcc \fR\fB-qp\fR),
+\fB0x4000\fR, maps subdivisions 8 bytes long to each counter.
+.RE
+.sp
+.LP
+The values are used within the kernel as follows: when the process is
+interrupted for a clock tick, the value of \fIoffset\fR is subtracted from the
+current value of the program counter (pc), and the remainder is multiplied by
+\fIscale\fR to derive a result. That result is used as an index into the
+histogram array to locate the cell to be incremented. Therefore, the cell count
+represents the number of times that the process was executing code in the
+subdivision associated with that cell when the process was interrupted.
+.sp
+.LP
+The value of \fIscale\fR can be computed as (\fIRATIO\fR \fB* 0200000L\fR),
+where \fIRATIO\fR is the desired ratio of \fIbufsiz\fR to profiled region
+size, and has a value between 0 and 1. Qualitatively speaking, the closer
+\fIRATIO\fR is to 1, the higher the resolution of the profile information.
+.sp
+.LP
+The value of \fIbufsiz\fR can be computed as
+(\fIsize_of_region_to_be_profiled\fR \fB* \fR\fIRATIO\fR).
+.sp
+.LP
+Profiling is turned off by giving a \fIscale\fR value of 0 or 1, and is
+rendered ineffective by giving a \fIbufsiz\fR value of 0. Profiling is turned
+off when one of the \fBexec\fR family of functions (see \fBexec\fR(2)) is
+executed, but remains on in both child and parent processes after a
+\fBfork\fR(2). Profiling is turned off if a \fIbuff\fR update would cause a
+memory fault.
+.SH USAGE
+.sp
+.LP
+The \fBpcsample\fR(2) function should be used when profiling dynamically-linked
+programs and 64-bit programs.
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBfork\fR(2), \fBpcsample\fR(2), \fBtimes\fR(2),
+\fBmonitor\fR(3C), \fBprof\fR(5)
+.SH NOTES
+.sp
+.LP
+In Solaris releases prior to 2.6, calling \fBprofil()\fR in a multithreaded
+program would impact only the calling \fBLWP\fR; the profile state was not
+inherited at \fBLWP\fR creation time. To profile a multithreaded program with a
+global profile buffer, each thread needed to issue a call to \fBprofil()\fR at
+threads start-up time, and each thread had to be a bound thread. This was
+cumbersome and did not easily support dynamically turning profiling on and off.
+In Solaris 2.6, the \fBprofil()\fR system call for multithreaded processes has
+global impact \(em that is, a call to \fBprofil()\fR impacts all
+\fBLWP\fRs/threads in the process. This may cause applications that depend on
+the previous per-\fBLWP\fR semantic to break, but it is expected to improve
+multithreaded programs that wish to turn profiling on and off dynamically at
+runtime.
diff --git a/usr/src/man/man2/pset_bind.2 b/usr/src/man/man2/pset_bind.2
new file mode 100644
index 0000000000..91d5520b90
--- /dev/null
+++ b/usr/src/man/man2/pset_bind.2
@@ -0,0 +1,196 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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. 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. 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]
+.TH pset_bind 2 "13 Mar 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+pset_bind \- bind LWPs to a set of processors
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/pset.h>
+
+\fBint\fR \fBpset_bind\fR(\fBpsetid_t\fR \fIpset\fR, \fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBpsetid_t *\fR\fIopset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpset_bind()\fR function binds the \fBLWP\fR or set of \fBLWPs\fR
+specified by \fIidtype\fR and \fIid\fR to the processor set specified by
+\fIpset\fR. If \fIopset\fR is not \fINULL\fR, \fBpset_bind()\fR sets the
+\fBpsetid_t\fR variable pointed to by \fIopset\fR to the previous processor set
+binding of one of the specified \fBLWP\fR, or to \fBPS_NONE\fR if the selected
+\fBLWP\fR was not bound.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PID\fR, the binding affects all \fBLWP\fRs of the
+process with process \fBID\fR (PID) \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_LWPID\fR, the binding affects the \fBLWP\fR of the
+current process with \fBLWP ID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_TASKID\fR, the binding affects all LWPs of all
+processes with task ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PROJID\fR, the binding affects all LWPs of all
+processes with project ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_ZONEID\fR, the binding affects all LWPs of all
+processes with zone ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_CTID\fR, the binding affects all LWPs of all processes
+with process contract ID \fIid\fR.
+.sp
+.LP
+If \fIid\fR is \fBP_MYID\fR, the specified LWP, process, task, process, zone,
+or process contract is the current one.
+.sp
+.LP
+If \fIpset\fR is \fBPS_NONE\fR, the processor set bindings of the specified
+LWPs are cleared.
+.sp
+.LP
+If \fIpset\fR is \fBPS_QUERY\fR, the processor set bindings are not changed.
+.sp
+.LP
+If \fIpset\fR is \fBPS_MYID\fR, the specified LWPs are bound to the same
+processor set as the caller. If the caller is not bound to a processor set, the
+processor set bindings are cleared.
+.sp
+.LP
+The {\fBPRIV_SYS_RES_CONFIG\fR} privilege must be asserted in the effective set
+of the calling process or \fIpset\fR must be \fBPS_QUERY\fR.
+.sp
+.LP
+LWPs that have been bound to a processor with \fBprocessor_bind\fR(2) may also
+be bound to a processor set if the processor is part of the processor set. If
+this occurs, the binding to the processor remains in effect. If the processor
+binding is later removed, the processor set binding becomes effective.
+.sp
+.LP
+Processor set bindings are inherited across \fBfork\fR(2) and \fBexec\fR(2).
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpset_bind()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 11n
+.rt
+One of the \fBLWP\fRs is bound to a processor, and the specified processor set
+does not include that processor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The location pointed to by \fIopset\fR was not \fINULL\fR and not writable by
+the user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+An invalid processor set \fBID\fR was specified; or \fIidtype\fR was not
+\fBP_PID\fR, \fBP_LWPID\fR, \fBP_PROJID\fR, \fBP_TASKID\fR, \fBP_ZONEID\fR, or
+\fBP_CTID\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+The pools facility is active. See \fBpooladm\fR(1M) and
+\fBpool_set_status\fR(3POOL) for information about enabling and disabling the
+pools facility. Processes can be bound to pools using the \fBpoolbind\fR(1M)
+utility or the \fBpool_set_binding\fR(3POOL) function.
+.sp
+Binding a system process to a processor set is not supported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The {\fBPRIV_PROC_OWNER\fR} is not asserted in the effecive set of the calling
+process and either the real or effective user ID of the calling process does
+not match the real or effective user \fBID\fR of one of the LWPs being bound,
+or the processor set from which one or more of the LWPs are being unbound has
+the \fBPSET_NOESCAPE\fR attribute set and {\fBPRIV_SYS_RES_CONFIG\fR) is not
+asserted in the effective set of the calling process. See \fBpset_setattr\fR(2)
+for more information about processor set attributes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 11n
+.rt
+No processes, \fBLWP\fRs, or tasks were found to match the criteria specified
+by \fIidtype\fR and \fIid\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpbind\fR(1M), \fBpooladm\fR(1M), \fBpoolbind\fR(1M), \fBpsrset\fR(1M),
+\fBexec\fR(2), \fBfork\fR(2), \fBprocessor_bind\fR(2), \fBpset_create\fR(2),
+\fBpset_info\fR(2), \fBpset_setattr\fR(2), \fBpool_set_binding\fR(3POOL),
+\fBpool_set_status\fR(3POOL), \fBpset_getloadavg\fR(3C), \fBprocess\fR(4),
+\fBproject\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/pset_create.2 b/usr/src/man/man2/pset_create.2
new file mode 100644
index 0000000000..c53983fbb3
--- /dev/null
+++ b/usr/src/man/man2/pset_create.2
@@ -0,0 +1,189 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pset_create 2 "22 Feb 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+pset_create, pset_destroy, pset_assign \- manage sets of processors
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/pset.h>
+
+\fBint\fR \fBpset_create\fR(\fBpsetid_t *\fR\fInewpset\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBpset_destroy\fR(\fBpsetid_t\fR \fIpset\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBpset_assign\fR(\fBpsetid_t\fR \fIpset\fR, \fBprocessorid_t\fR \fIcpu\fR, \fBpsetid_t *\fR\fIopset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+These functions control the creation and management of sets of processors.
+Processor sets allow a subset of the system's processors to be set aside for
+exclusive use by specified \fBLWP\fRs and processes. The binding of \fBLWP\fRs
+and processes to processor sets is controlled by \fBpset_bind\fR(2).
+.sp
+.LP
+The \fBpset_create()\fR function creates an empty processor set that contains
+no processors. On successful return, \fInewpset\fR will contain the \fBID\fR
+of the new processor set.
+.sp
+.LP
+The \fBpset_destroy()\fR function destroys the processor set \fIpset\fR,
+releasing its constituent processors and processes. If \fIpset\fR is
+\fBPS_MYID\fR, the processor set to which the caller is bound is destroyed.
+.sp
+.LP
+The \fBpset_assign()\fR function assigns the processor \fIcpu\fR to the
+processor set \fIpset\fR. A processor that has been assigned to a processor set
+will run only \fBLWP\fRs and processes that have been explicitly bound to that
+processor set, unless another \fBLWP\fR requires a resource that is only
+available on that processor.
+.sp
+.LP
+On successful return, if \fIopset\fR is non-null, \fIopset\fR will contain the
+processor set \fBID\fR of the former processor set of the processor.
+.sp
+.LP
+If \fIpset\fR is \fBPS_NONE\fR, \fBpset_assign()\fR releases processor
+\fIcpu\fR from its current processor set.
+.sp
+.LP
+If \fIpset\fR is \fBPS_QUERY\fR, \fBpset_assign()\fR makes no change to
+processor sets, but returns the current processor set \fBID\fR of processor
+\fIcpu\fR in \fIopset\fR.
+.sp
+.LP
+If \fIpset\fR is \fBPS_MYID\fR, processor \fIcpu\fR is assigned to the
+processor set to which the caller belongs. If the caller does not belong to a
+processor set, processor \fIcpu\fR is released from its current processor set.
+.sp
+.LP
+These functions are restricted to privileged processes, except for
+\fBpset_assign()\fR when \fIpset\fR is \fBPS_QUERY\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, these functions return \fB0\fR. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+These functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 11n
+.rt
+The processor could not be moved to the specified processor set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The location pointed to by \fInewpset\fR was not writable by the user, or the
+location pointed to by \fIopset\fR was not \fINULL\fR and not writable by the
+user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The specified processor does not exist, the specified processor is not
+on-line, or an invalid processor set was specified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 11n
+.rt
+There was insufficient space for \fBpset_create\fR to create a new processor
+set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+The pools facility is active. See \fBpooladm\fR(1M) and
+\fBpool_set_status\fR(3POOL) for information about enabling and disabling the
+pools facility.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The {\fBPRIV_SYS_RES_CONFIG\fR} privilege is not asserted in the effective set
+of the calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpsradm\fR(1M), \fBpsrinfo\fR(1M), \fBpsrset\fR(1M),
+\fBp_online\fR(2), \fBprocessor_bind\fR(2), \fBpset_bind\fR(2),
+\fBpset_info\fR(2), \fBpool_set_status\fR(3POOL), \fBpset_getloadavg\fR(3C),
+\fBattributes\fR(5), \fBprivileges\fR(5)
+.SH NOTES
+.sp
+.LP
+The processor set type of \fBPS_SYSTEM\fR is no longer supported.
+.sp
+.LP
+Processors with \fBLWP\fRs bound to them using \fBprocessor_bind\fR(2) cannot
+be assigned to a new processor set. If this is attempted, \fBpset_assign()\fR
+will fail and set \fBerrno\fR to \fBEBUSY\fR.
diff --git a/usr/src/man/man2/pset_info.2 b/usr/src/man/man2/pset_info.2
new file mode 100644
index 0000000000..efc4e38375
--- /dev/null
+++ b/usr/src/man/man2/pset_info.2
@@ -0,0 +1,117 @@
+'\" te
+.\" Copyright (c) 20034, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pset_info 2 "28 Jun 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+pset_info \- get information about a processor set
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/pset.h>
+
+\fBint\fR \fBpset_info\fR(\fBpsetid_t\fR \fIpset\fR, \fBint *\fR\fItype\fR, \fBuint_t *\fR\fInumcpus\fR,
+ \fBprocessorid_t *\fR\fIcpulist\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpset_info()\fR function returns information on the processor set
+\fIpset\fR.
+.sp
+.LP
+If \fItype\fR is non-null, then on successful completion the type of the
+processor set will be stored in the location pointed to by \fItype\fR. The only
+type supported for active processor sets is \fBPS_PRIVATE\fR.
+.sp
+.LP
+If \fInumcpus\fR is non-null, then on successful completion the number of
+processors in the processor set will be stored in the location pointed to by
+\fInumcpus\fR.
+.sp
+.LP
+If \fInumcpus\fR and \fIcpulist\fR are both non-null, then \fIcpulist\fR points
+to a buffer where a list of processors assigned to the processor set is to be
+stored, and \fInumcpus\fR points to the maximum number of processor IDs the
+buffer can hold. On successful completion, the list of processors up to the
+maximum buffer size is stored in the buffer pointed to by \fIcpulist\fR.
+.sp
+.LP
+If \fIpset\fR is \fBPS_NONE\fR, the list of processors not assigned to any
+processor set will be stored in the buffer pointed to by \fIcpulist\fR, and the
+number of such processors will be stored in the location pointed to by
+\fInumcpus\fR. The location pointed to by \fItype\fR will be set to
+\fBPS_NONE\fR.
+.sp
+.LP
+If \fIpset\fR is \fBPS_MYID\fR, the processor list and number of processors
+returned will be those of the processor set to which the caller is bound. If
+the caller is not bound to a processor set, the result will be equivalent to
+setting pset to \fBPS_NONE\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpset_info()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The location pointed to by \fItype\fR, \fInumcpus\fR, or \fIcpulist\fR was not
+null and not writable by the user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+An invalid processor set \fBID\fR was specified.
+.sp
+The caller is in a non-global zone, the pools facility is active, and the
+processor is not a member of the zone's pool's processor set.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStable
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpsrinfo\fR(1M), \fBpsrset\fR(1M), \fBzoneadm\fR(1M),
+\fBprocessor_info\fR(2), \fBpset_assign\fR(2), \fBpset_bind\fR(2),
+\fBpset_create\fR(2), \fBpset_destroy\fR(2), \fBpset_getloadavg\fR(3C),
+\fBattributes\fR(5)
+.SH NOTES
+.sp
+.LP
+The processor set of type \fBPS_SYSTEM\fR is no longer supported.
diff --git a/usr/src/man/man2/pset_list.2 b/usr/src/man/man2/pset_list.2
new file mode 100644
index 0000000000..4691828d27
--- /dev/null
+++ b/usr/src/man/man2/pset_list.2
@@ -0,0 +1,85 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pset_list 2 "28 Jun 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+pset_list \- get list of processor sets
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/pset.h>
+
+\fBint\fR \fBpset_list\fR(\fBpsetid_t *\fR\fIpsetlist\fR, \fBuint_t *\fR\fInumpsets\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpset_list()\fR function returns a list of processor sets in the system.
+.sp
+.LP
+If \fInumpsets\fR is non-null, then on successful completion the number of
+processor sets in the system will be stored in the location pointed to by
+\fInumpsets\fR.
+.sp
+.LP
+If \fInumpsets\fR and \fIpsetlist\fR are both non-null, then \fIpsetlist\fR
+points to a buffer where a list of processor sets in the system is to be
+stored, and \fInumpsets\fR points to the maximum number of processor set IDs
+the buffer can hold. On successful completion, the list of processor sets up
+to the maximum buffer size is stored in the buffer pointed to by
+\fIpsetlist\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, -1 is returned and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBpset_list()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The location pointed to by \fIpsetlist\fR or \fInumpsets\fR was not null and
+not writable by the user.
+.RE
+
+.SH USAGE
+.sp
+.LP
+If the caller is in a non-global zone and the pools facility is active,
+\fBpset_list()\fR returns only the processor set of the pool to which the zone
+is bound.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStable
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpsrset\fR(1M), \fBzoneadm\fR(1M),
+\fBprocessor_info\fR(2), \fBpset_bind\fR(2), \fBpset_create\fR(2),
+\fBpset_info\fR(2), \fBpset_getloadavg\fR(3C), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/pset_setattr.2 b/usr/src/man/man2/pset_setattr.2
new file mode 100644
index 0000000000..05d97cd13e
--- /dev/null
+++ b/usr/src/man/man2/pset_setattr.2
@@ -0,0 +1,129 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH pset_setattr 2 "28 Jun 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+pset_setattr, pset_getattr \- set or get processor set attributes
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/pset.h>
+
+\fBint\fR \fBpset_setattr\fR(\fBpsetid_t\fR \fIpset\fR, \fBuint_t\fR \fIattr\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBpset_getattr\fR(\fBpsetid_t\fR \fIpset\fR, \fBuint_t *\fR\fIattr\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBpset_setattr()\fR function sets attributes of the processor set
+specified by \fIpset\fR. The bitmask of attributes to be set or cleared is
+specified by \fIattr\fR.
+.sp
+.LP
+The pset_getattr function returns attributes of the processor set specified by
+\fIpset\fR. On successful return, \fIattr\fR will contain the bitmask of
+attributes for the specified processor set.
+.sp
+.LP
+The value of the \fIattr\fR argument is the bitwise inclusive-OR of these
+attributes, defined in <\fBsys/pset.h\fR>:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPSET_NOESCAPE\fR\fR
+.ad
+.RS 17n
+.rt
+Unbinding of LWPs from the processor set with this attribute requires the
+{\fBPRIV_SYS_RES_CONFIG\fR} privilege to be asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.LP
+The binding of LWPs and processes to processor sets is controlled by
+\fBpset_bind\fR(2). When the \fBPSET_NOESCAPE\fR attribute is cleared, a
+process calling \fBpset_bind()\fR can clear the processor set binding of any
+LWP whose real or effective user ID matches its own real of effective user ID.
+Setting \fBPSET_NOESCAPE\fR attribute forces \fBpset_bind()\fR to requires the
+{\fBPRIV_SYS_RES_CONFIG\fR} privilege to be asserted in the effective set of
+the calling process.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, these functions return 0. Otherwise, -1 is returned
+and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+These function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The location pointed to by \fIattr\fR was not writable by the user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+An invalid processor set ID was specified.
+.sp
+The caller is in a non-global zone, the pools facility is active, and the
+processor is not a member of the zone's pool's processor set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+The pools facility is active. See \fBpooladm\fR(1M) and
+\fBpool_set_status\fR(3POOL) for information about enabling and disabling the
+pools facility.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStable
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBpooladm\fR(1M), \fBpooladm\fR(1M), \fBpsrset\fR(1M), \fBzoneadm\fR(1M),
+\fBpset_bind\fR(2), \fBpool_set_status\fR(3POOL), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/putmsg.2 b/usr/src/man/man2/putmsg.2
new file mode 100644
index 0000000000..bf155211fb
--- /dev/null
+++ b/usr/src/man/man2/putmsg.2
@@ -0,0 +1,290 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH putmsg 2 "1 Nov 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+putmsg, putpmsg \- send a message on a stream
+.SH SYNOPSIS
+.LP
+.nf
+#include <stropts.h>
+
+\fBint\fR \fBputmsg\fR(\fBint\fR \fIfildes\fR, \fBconst struct strbuf *\fR\fIctlptr\fR,
+ \fBconst struct strbuf *\fR\fIdataptr\fR, \fBint\fR \fIflags\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBputpmsg\fR(\fBint\fR \fIfildes\fR, \fBconst struct strbuf *\fR\fIctlptr\fR,
+ \fBconst struct strbuf *\fR\fIdataptr\fR,\fBint\fR \fIband\fR, \fBint\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBputmsg()\fR function creates a message from user-specified buffer(s)
+and sends the message to a streams file. The message may contain either a data
+part, a control part, or both. The data and control parts to be sent are
+distinguished by placement in separate buffers, as described below. The
+semantics of each part is defined by the streams module that receives the
+message.
+.sp
+.LP
+The \fBputpmsg()\fR function does the same thing as \fBputmsg()\fR, but
+provides the user the ability to send messages in different priority bands.
+Except where noted, all information pertaining to \fBputmsg()\fR also pertains
+to \fBputpmsg()\fR.
+.sp
+.LP
+The \fIfildes\fR argument specifies a file descriptor referencing an open
+stream. The \fIctlptr\fR and \fIdataptr\fR arguments each point to a
+\fBstrbuf\fR structure, which contains the following members:
+.sp
+.in +2
+.nf
+int maxlen; /* not used here */
+int len; /* length of data */
+void *buf; /* ptr to buffer */
+.fi
+.in -2
+
+.sp
+.LP
+The \fIctlptr\fR argument points to the structure describing the control part,
+if any, to be included in the message. The \fBbuf\fR member in the \fBstrbuf\fR
+structure points to the buffer where the control information resides, and the
+\fBlen\fR member indicates the number of bytes to be sent. The \fBmaxlen\fR
+member is not used in \fBputmsg()\fR (see \fBgetmsg\fR(2)). In a similar
+manner, \fIdataptr\fR specifies the data, if any, to be included in the
+message. The \fIflags\fR argument indicates what type of message should be
+sent and is described later.
+.sp
+.LP
+To send the data part of a message, \fIdataptr\fR must not be \fINULL\fR, and
+the \fBlen\fR member of \fIdataptr\fR must have a value of 0 or greater. To
+send the control part of a message, the corresponding values must be set for
+\fIctlptr\fR. No data (control) part is sent if either \fIdataptr\fR
+(\fIctlptr\fR) is \fINULL\fR or the \fBlen\fR member of \fIdataptr\fR
+(\fIctlptr\fR) is negative.
+.sp
+.LP
+For \fBputmsg()\fR, if a control part is specified, and \fIflags\fR is set to
+\fBRS_HIPRI\fR, a high priority message is sent. If no control part is
+specified, and \fIflags\fR is set to \fBRS_HIPRI\fR, \fBputmsg()\fR fails and
+sets \fBerrno\fR to \fBEINVAL\fR. If \fIflags\fR is set to 0, a normal
+(non-priority) message is sent. If no control part and no data part are
+specified, and \fIflags\fR is set to 0, no message is sent, and 0 is returned.
+.sp
+.LP
+The stream head guarantees that the control part of a message generated by
+\fBputmsg()\fR is at least 64 bytes in length.
+.sp
+.LP
+For \fBputpmsg()\fR, the flags are different. The \fIflags\fR argument is a
+bitmask with the following mutually-exclusive flags defined: \fBMSG_HIPRI\fR
+and \fBMSG_BAND\fR. If \fIflags\fR is set to 0, \fBputpmsg()\fR fails and sets
+\fBerrno\fR to \fBEINVAL\fR. If a control part is specified and \fIflags\fR is
+set to \fBMSG_HIPRI\fR and \fIband\fR is set to 0, a high-priority message is
+sent. If \fIflags\fR is set to \fBMSG_HIPRI\fR and either no control part is
+specified or \fIband\fR is set to a non-zero value, \fBputpmsg()\fR fails and
+sets \fBerrno\fR to \fBEINVAL\fR. If flags is set to \fBMSG_BAND\fR, then a
+message is sent in the priority band specified by \fIband\fR. If a control part
+and data part are not specified and \fIflags\fR is set to \fBMSG_BAND\fR, no
+message is sent and 0 is returned.
+.sp
+.LP
+Normally, \fBputmsg()\fR will block if the stream write queue is full due to
+internal flow control conditions. For high-priority messages, \fBputmsg()\fR
+does not block on this condition. For other messages, \fBputmsg()\fR does not
+block when the write queue is full and \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is
+set. Instead, it fails and sets \fBerrno\fR to \fBEAGAIN\fR.
+.sp
+.LP
+The \fBputmsg()\fR or \fBputpmsg()\fR function also blocks, unless prevented by
+lack of internal resources, waiting for the availability of message blocks in
+the stream, regardless of priority or whether \fBO_NDELAY\fR or
+\fBO_NONBLOCK\fR has been specified. No partial message is sent.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBputmsg()\fR and \fBputpmsg()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 16n
+.rt
+A non-priority message was specified, the \fBO_NDELAY\fR or \fBO_NONBLOCK\fR
+flag is set and the stream write queue is full due to internal flow control
+conditions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor open for writing.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIctlptr\fR or \fIdataptr\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBputmsg()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+An undefined value was specified in \fIflags\fR; \fIflags\fR is set to
+\fBRS_HIPRI\fR and no control part was supplied; or the stream referenced by
+\fIfildes\fR is linked below a multiplexor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSR\fR\fR
+.ad
+.RS 16n
+.rt
+Buffers could not be allocated for the message that was to be created due to
+insufficient streams memory resources.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSTR\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIfildes\fR argument is not associated with a stream.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 16n
+.rt
+A hangup condition was generated downstream for the specified stream, or the
+other end of the pipe is closed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPIPE\fR or \fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIfildes\fR argument refers to a streams-based pipe and the other end of
+the pipe is closed. A \fBSIGPIPE\fR signal is generated for the calling
+thread. This error condition occurs only with SUS-conforming applications. See
+\fBstandards\fR(5).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 16n
+.rt
+The size of the data part of the message does not fall within the range
+specified by the maximum and minimum packet sizes of the topmost stream module.
+This value is also returned if the control part of the message is larger than
+the maximum configured size of the control part of a message, or if the data
+part of a message is larger than the maximum configured size of the data part
+of a message.
+.RE
+
+.sp
+.LP
+In addition, \fBputmsg()\fR and \fBputpmsg()\fR will fail if the stream head
+had processed an asynchronous error before the call. In this case, the value
+of \fBerrno\fR does not reflect the result of \fBputmsg()\fR or \fBputpmsg()\fR
+but reflects the prior error.
+.sp
+.LP
+The \fBputpmsg()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIflags\fR argument is set to \fBMSG_HIPRI\fR and \fIband\fR is non-zero.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBgetmsg\fR(2), \fBpoll\fR(2), \fBread\fR(2), \fBwrite\fR(2),
+\fBattributes\fR(5), \fBstandards\fR(5)
+.sp
+.LP
+\fISTREAMS Programming Guide\fR
diff --git a/usr/src/man/man2/read.2 b/usr/src/man/man2/read.2
new file mode 100644
index 0000000000..b1716f5916
--- /dev/null
+++ b/usr/src/man/man2/read.2
@@ -0,0 +1,546 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH read 2 "13 Sep 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+read, readv, pread \- read from file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBssize_t\fR \fBread\fR(\fBint\fR \fIfildes\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbyte\fR);
+.fi
+
+.LP
+.nf
+\fBssize_t\fR \fBpread\fR(\fBint\fR \fIfildes\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbyte\fR, \fBoff_t\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+#include <sys/uio.h>
+
+\fBssize_t\fR \fBreadv\fR(\fBint\fR \fIfildes\fR, \fBconst struct iovec *\fR\fIiov\fR, \fBint\fR \fIiovcnt\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBread()\fR function attempts to read \fInbyte\fR bytes from the file
+associated with the open file descriptor, \fIfildes\fR, into the buffer pointed
+to by \fIbuf\fR.
+.sp
+.LP
+If \fInbyte\fR is 0, \fBread()\fR returns \fB0\fR and has no other results.
+.sp
+.LP
+On files that support seeking (for example, a regular file), the \fBread()\fR
+starts at a position in the file given by the file offset associated with
+\fIfildes\fR. The file offset is incremented by the number of bytes actually
+read.
+.sp
+.LP
+Files that do not support seeking (for example, terminals) always read from the
+current position. The value of a file offset associated with such a file is
+undefined.
+.sp
+.LP
+If \fIfildes\fR refers to a socket, \fBread()\fR is equivalent to
+\fBrecv\fR(3SOCKET) with no flags set.
+.sp
+.LP
+No data transfer will occur past the current end-of-file. If the starting
+position is at or after the end-of-file, \fB0\fR will be returned. If the file
+refers to a device special file, the result of subsequent \fBread()\fR requests
+is implementation-dependent.
+.sp
+.LP
+When attempting to read from a regular file with mandatory file/record locking
+set (see \fBchmod\fR(2)), and there is a write lock owned by another process on
+the segment of the file to be read:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is set, \fBread()\fR returns \fB\(mi1\fR
+and sets \fBerrno\fR to \fBEAGAIN\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear, \fBread()\fR sleeps until the
+blocking record lock is removed.
+.RE
+.sp
+.LP
+When attempting to read from an empty pipe (or FIFO):
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If no process has the pipe open for writing, \fBread()\fR returns \fB0\fR to
+indicate end-of-file.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If some process has the pipe open for writing and \fBO_NDELAY\fR is set,
+\fBread()\fR returns \fB0\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If some process has the pipe open for writing and \fBO_NONBLOCK\fR is set,
+\fBread()\fR returns \fB\(mi1\fR and sets \fBerrno\fR to \fBEAGAIN\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear, \fBread()\fR blocks until
+data is written to the pipe or the pipe is closed by all processes that had
+opened the pipe for writing.
+.RE
+.sp
+.LP
+When attempting to read a file associated with a terminal that has no data
+currently available:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR is set, \fBread()\fR returns \fB0\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR is set, \fBread()\fR returns \fB\(mi1\fR and sets
+\fBerrno\fR to \fBEAGAIN\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear, \fBread()\fR blocks until
+data become available.
+.RE
+.sp
+.LP
+When attempting to read a file associated with a socket or a stream that is not
+a pipe, a FIFO, or a terminal, and the file has no data currently available:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is set, \fBread()\fR returns \fB\(mi1\fR
+and sets \fBerrno\fR to \fBEAGAIN\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear, \fBread()\fR blocks until
+data becomes available.
+.RE
+.sp
+.LP
+The \fBread()\fR function reads data previously written to a file. If any
+portion of a regular file prior to the end-of-file has not been written,
+\fBread()\fR returns bytes with value 0. For example, \fBlseek\fR(2) allows
+the file offset to be set beyond the end of existing data in the file. If data
+is later written at this point, subsequent reads in the gap between the
+previous end of data and the newly written data will return bytes with value 0
+until data is written into the gap.
+.sp
+.LP
+For regular files, no data transfer will occur past the offset maximum
+established in the open file description associated with \fIfildes\fR.
+.sp
+.LP
+Upon successful completion, where \fInbyte\fR is greater than 0, \fBread()\fR
+will mark for update the \fBst_atime\fR field of the file, and return the
+number of bytes read. This number will never be greater than \fInbyte\fR. The
+value returned may be less than \fInbyte\fR if the number of bytes left in the
+file is less than \fInbyte\fR, if the \fBread()\fR request was interrupted by a
+signal, or if the file is a pipe or FIFO or special file and has fewer than
+\fInbyte\fR bytes immediately available for reading. For example, a
+\fBread()\fR from a file associated with a terminal may return one typed line
+of data.
+.sp
+.LP
+If a \fBread()\fR is interrupted by a signal before it reads any data, it will
+return \fB\(mi1\fR with \fBerrno\fR set to \fBEINTR\fR.
+.sp
+.LP
+If a \fBread()\fR is interrupted by a signal after it has successfully read
+some data, it will return the number of bytes read.
+.sp
+.LP
+A \fBread()\fR from a streams file can read data in three different modes:
+byte-stream mode, message-nondiscard mode, and message-discard mode. The
+default is byte-stream mode. This can be changed using the \fBI_SRDOPT\fR
+\fBioctl\fR(2) request, and can be tested with the \fBI_GRDOPT\fR
+\fBioctl()\fR. In byte-stream mode, \fBread()\fR retrieves data from the stream
+until as many bytes as were requested are transferred, or until there is no
+more data to be retrieved. Byte-stream mode ignores message boundaries.
+.sp
+.LP
+In streams message-nondiscard mode, \fBread()\fR retrieves data until as many
+bytes as were requested are transferred, or until a message boundary is
+reached. If \fBread()\fR does not retrieve all the data in a message, the
+remaining data is left on the stream, and can be retrieved by the next
+\fBread()\fR call. Message-discard mode also retrieves data until as many
+bytes as were requested are transferred, or a message boundary is reached.
+However, unread data remaining in a message after the \fBread()\fR returns is
+discarded, and is not available for a subsequent \fBread()\fR, \fBreadv()\fR or
+\fBgetmsg\fR(2) call.
+.sp
+.LP
+How \fBread()\fR handles zero-byte streams messages is determined by the
+current read mode setting. In byte-stream mode, \fBread()\fR accepts data
+until it has read \fInbyte\fR bytes, or until there is no more data to read, or
+until a zero-byte message block is encountered. The \fBread()\fR function then
+returns the number of bytes read, and places the zero-byte message back on the
+stream to be retrieved by the next \fBread()\fR, \fBreadv()\fR or
+\fBgetmsg\fR(2). In message-nondiscard mode or message-discard mode, a
+zero-byte message returns \fB0\fR and the message is removed from the stream.
+When a zero-byte message is read as the first message on a stream, the message
+is removed from the stream and \fB0\fR is returned, regardless of the read
+mode.
+.sp
+.LP
+A \fBread()\fR from a streams file returns the data in the message at the front
+of the stream head read queue, regardless of the priority band of the message.
+.sp
+.LP
+By default, streams are in control-normal mode, in which a \fBread()\fR from a
+streams file can only process messages that contain a data part but do not
+contain a control part. The \fBread()\fR fails if a message containing a
+control part is encountered at the stream head. This default action can be
+changed by placing the stream in either control-data mode or control-discard
+mode with the \fBI_SRDOPT\fR \fBioctl()\fR command. In control-data mode,
+\fBread()\fR converts any control part to data and passes it to the application
+before passing any data part originally present in the same message. In
+control-discard mode, \fBread()\fR discards message control parts but returns
+to the process any data part in the message.
+.sp
+.LP
+In addition, \fBread()\fR and \fBreadv()\fR will fail if the stream head had
+processed an asynchronous error before the call. In this case, the value of
+\fBerrno\fR does not reflect the result of \fBread()\fR or \fBreadv()\fR but
+reflects the prior error. If a hangup occurs on the stream being read,
+\fBread()\fR continues to operate normally until the stream head read queue is
+empty. Thereafter, it returns \fB0\fR.
+.SS "\fBreadv()\fR"
+.sp
+.LP
+The \fBreadv()\fR function is equivalent to \fBread()\fR, but places the input
+data into the \fIiovcnt\fR buffers specified by the members of the \fIiov\fR
+array: \fIiov\fR[\fB0\fR], \fIiov\fR[\fB1\fR], \&.\|.\|.,
+\fIiov\fR[\fIiovcnt\fR\(mi1]. The \fIiovcnt\fR argument is valid if greater
+than 0 and less than or equal to {\fBIOV_MAX\fR}.
+.sp
+.LP
+The \fBiovec\fR structure contains the following members:
+.sp
+.in +2
+.nf
+caddr_t iov_base;
+int iov_len;
+.fi
+.in -2
+
+.sp
+.LP
+Each \fBiovec\fR entry specifies the base address and length of an area in
+memory where data should be placed. The \fBreadv()\fR function always fills an
+area completely before proceeding to the next.
+.sp
+.LP
+Upon successful completion, \fBreadv()\fR marks for update the \fBst_atime\fR
+field of the file.
+.SS "\fBpread()\fR"
+.sp
+.LP
+The \fBpread()\fR function performs the same action as \fBread()\fR, except
+that it reads from a given position in the file without changing the file
+pointer. The first three arguments to \fBpread()\fR are the same as
+\fBread()\fR with the addition of a fourth argument \fIoffset\fR for the
+desired position inside the file. \fBpread()\fR will read up to the maximum
+offset value that can be represented in an \fBoff_t\fR for regular files. An
+attempt to perform a \fBpread()\fR on a file that is incapable of seeking
+results in an error.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBread()\fR and \fBreadv()\fR return a
+non-negative integer indicating the number of bytes actually read. Otherwise,
+the functions return \fB\(mi1\fR and set \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBread()\fR, \fBreadv()\fR, and \fBpread()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 11n
+.rt
+Mandatory file/record locking was set, \fBO_NDELAY\fR or \fBO_NONBLOCK\fR was
+set, and there was a blocking record lock; total amount of system memory
+available when reading using raw I/O is temporarily insufficient; no data is
+waiting to be read on a file associated with a tty device and \fBO_NONBLOCK\fR
+was set; or no message is waiting to be read on a stream and \fBO_NDELAY\fR or
+\fBO_NONBLOCK\fR was set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor open for reading.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADMSG\fR\fR
+.ad
+.RS 11n
+.rt
+Message waiting to be read on a stream is not a data message.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDEADLK\fR\fR
+.ad
+.RS 11n
+.rt
+The read was going to go to sleep and cause a deadlock to occur.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during the read operation and no data was transferred.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+An attempt was made to read from a stream linked to a multiplexor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 11n
+.rt
+A physical I/O error has occurred, or the process is in a background process
+group and is attempting to read from its controlling terminal, and either the
+process is ignoring or blocking the \fBSIGTTIN\fR signal or the process group
+of the process is orphaned.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEISDIR\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument refers to a directory on a file system type that does
+not support read operations on directories.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLCK\fR\fR
+.ad
+.RS 11n
+.rt
+The system record lock table was full, so the \fBread()\fR or \fBreadv()\fR
+could not go to sleep until the blocking record lock was removed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is on a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 11n
+.rt
+The device associated with \fIfildes\fR is a block special or character special
+file and the value of the file pointer is out of range.
+.RE
+
+.sp
+.LP
+The \fBread()\fR and \fBpread()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fInbyte\fR argument overflowed an \fBssize_t\fR.
+.RE
+
+.sp
+.LP
+The \fBread()\fR and \fBreadv()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The file is a regular file, \fInbyte\fR is greater than 0, the starting
+position is before the end-of-file, and the starting position is greater than
+or equal to the offset maximum established in the open file description
+associated with \fIfildes\fR.
+.RE
+
+.sp
+.LP
+The \fBreadv()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIiov\fR argument points outside the allocated address space.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIiovcnt\fR argument was less than or equal to \fB0\fR or greater than
+{\fBIOV_MAX\fR}. See \fBIntro\fR(2) for a definition of {\fBIOV_MAX\fR}).
+.sp
+One of the \fBiov_len\fR values in the \fIiov\fR array was negative, or the sum
+of the \fBiov_len\fR values in the \fIiov\fR array overflowed an \fBssize_t\fR.
+.RE
+
+.sp
+.LP
+The \fBpread()\fR function will fail and the file pointer remain unchanged if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESPIPE\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is associated with a pipe or FIFO.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBpread()\fR function has a transitional interface for 64-bit file
+offsets. See \fBlf64\fR(5).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-Level\fBread()\fR is Async-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBchmod\fR(2), \fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2),
+\fBgetmsg\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBopen\fR(2), \fBpipe\fR(2),
+\fBrecv\fR(3SOCKET), \fBattributes\fR(5), \fBlf64\fR(5), \fBstandards\fR(5),
+\fBstreamio\fR(7I), \fBtermio\fR(7I)
diff --git a/usr/src/man/man2/readlink.2 b/usr/src/man/man2/readlink.2
new file mode 100644
index 0000000000..1831fcaa1b
--- /dev/null
+++ b/usr/src/man/man2/readlink.2
@@ -0,0 +1,208 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH readlink 2 "1 Dec 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+readlink \- read the contents of a symbolic link
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBssize_t\fR \fBreadlink\fR(\fBconst char *restrict\fR \fIpath\fR,
+ \fBchar *restrict\fR \fIbuf\fR, \fBsize_t\fR \fIbufsiz\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBreadlink()\fR function places the contents of the symbolic link referred
+to by \fIpath\fR in the buffer \fIbuf\fR which has size \fIbufsiz\fR. If the
+number of bytes in the symbolic link is less than \fIbufsiz\fR, the contents of
+the remainder of \fIbuf\fR are left unchanged. If the \fIbuf\fR argument is not
+large enough to contain the link content, the first \fIbufsize\fR bytes are
+placed in \fIbuf\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBreadlink()\fR returns the count of bytes placed
+in the buffer. Otherwise, it returns \fB\(mi1\fR, leaves the buffer
+unchanged, and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBreadlink()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix of \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+\fIpath\fR or \fIbuf\fR points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument names a file that is not a symbolic link.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of \fIpath\fR does not name an existing file or \fIpath\fR is an
+empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+A loop exists in symbolic links encountered during resolution of the \fIpath\fR
+argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of \fIpath\fR exceeds {\fBPATH_MAX\fR}, or a pathname component is
+longer than {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSYS\fR\fR
+.ad
+.RS 16n
+.rt
+The file system does not support symbolic links.
+.RE
+
+.sp
+.LP
+The \fBreadlink()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Read permission is denied for the directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+More than {\fBSYMLOOP_MAX\fR} symbolic links were encountered in resolving
+\fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+As a result of encountering a symbolic link in resolution of the path argument,
+the length of the substituted pathname string exceeded {\fBPATH_MAX\fR}.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Portable applications should not assume that the returned contents of the
+symbolic link are null-terminated.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBstat\fR(2), \fBsymlink\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/rename.2 b/usr/src/man/man2/rename.2
new file mode 100644
index 0000000000..afb97fc037
--- /dev/null
+++ b/usr/src/man/man2/rename.2
@@ -0,0 +1,421 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH rename 2 "4 Oct 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+rename, renameat \- change the name of a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <stdio.h>
+
+\fBint\fR \fBrename\fR(\fBconst char *\fR\fIold\fR, \fBconst char *\fR\fInew\fR);
+.fi
+
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBrenameat\fR(\fBint\fR \fIfromfd\fR, \fBconst char *\fR\fIold\fR, \fBint\fR \fItofd\fR,
+ \fBconst char *\fR\fInew\fR);
+.fi
+
+.SS "XPG3"
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBrename\fR(\fBconst char *\fR\fIold\fR, \fBconst char *\fR\fInew\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBrename()\fR function changes the name of a file. The \fIold\fR argument
+points to the pathname of the file to be renamed. The \fInew\fR argument points
+to the new path name of the file.
+.sp
+.LP
+The \fBrenameat()\fR function renames an entry in a directory, possibly moving
+the entry into a different directory. See \fBfsattr\fR(5). If the \fIold\fR
+argument is an absolute path, the \fIfromfd\fR is ignored. Otherwise it is
+resolved relative to the \fIfromfd\fR argument rather than the current working
+directory. Similarly, if the \fInew\fR argument is not absolute, it is
+resolved relative to the \fItofd\fR argument. If either \fIfromfd\fR or
+\fItofd\fR have the value \fBAT_FDCWD\fR, defined in <\fBfcntl.h\fR>, and their
+respective paths are relative, the path is resolved relative to the current
+working directory.
+.sp
+.LP
+Current implementation restrictions will cause the \fBrenameat()\fR function to
+return an error if an attempt is made to rename an extended attribute file to a
+regular (non-attribute) file, or to rename a regular file to an extended
+attribute file.
+.sp
+.LP
+If \fIold\fR and \fInew\fR both refer to the same existing file, the
+\fBrename()\fR and \fBrenameat()\fR functions return successfully and performs
+no other action.
+.sp
+.LP
+If \fIold\fR points to the pathname of a file that is not a directory,
+\fInew\fR must not point to the pathname of a directory. If the link named by
+\fInew\fR exists, it will be removed and \fIold\fR will be renamed to
+\fInew\fR. In this case, a link named \fInew\fR must remain visible to other
+processes throughout the renaming operation and will refer to either the file
+referred to by \fInew\fR or the file referred to as \fIold\fR before the
+operation began.
+.sp
+.LP
+If \fIold\fR points to the pathname of a directory, \fInew\fR must not point
+to the pathname of a file that is not a directory. If the directory named by
+\fInew\fR exists, it will be removed and \fIold\fR will be renamed to
+\fInew\fR. In this case, a link named \fInew\fR will exist throughout the
+renaming operation and will refer to either the file referred to by \fInew\fR
+or the file referred to as \fIold\fR before the operation began. Thus, if
+\fInew\fR names an existing directory, it must be an empty directory.
+.sp
+.LP
+The \fInew\fR pathname must not contain a path prefix that names \fIold\fR.
+Write access permission is required for both the directory containing \fIold\fR
+and the directory containing \fInew\fR. If \fIold\fR points to the pathname of
+a directory, write access permission is required for the directory named by
+\fIold\fR, and, if it exists, the directory named by \fInew\fR.
+.sp
+.LP
+If the directory containing \fIold\fR has the sticky bit set, at least one of
+the following conditions listed below must be true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user must own \fIold\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user must own the directory containing \fIold\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fIold\fR must be writable by the user
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user must be a privileged user
+.RE
+.sp
+.LP
+If \fInew\fR exists, and the directory containing \fInew\fR is writable and has
+the sticky bit set, at least one of the following conditions must be true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user must own \fInew\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user must own the directory containing \fInew\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fInew\fR must be writable by the user
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+the user must be a privileged user
+.RE
+.sp
+.LP
+If the link named by \fInew\fR exists, the file's link count becomes zero when
+it is removed, and no process has the file open, then the space occupied by
+the file will be freed and the file will no longer be accessible. If one or
+more processes have the file open when the last link is removed, the link will
+be removed before \fBrename()\fR or \fBrenameat()\fR returns, but the removal
+of the file contents will be postponed until all references to the file have
+been closed.
+.sp
+.LP
+Upon successful completion, the \fBrename()\fR and \fBrenameat()\fR functions
+will mark for update the \fBst_ctime\fR and \fBst_mtime\fR fields of the parent
+directory of each file.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate an error.
+.SH ERRORS
+.sp
+.LP
+The \fBrename()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+A component of either path prefix denies search permission; one of the
+directories containing \fIold\fR and \fInew\fR denies write permissions; or
+write permission is denied by a directory pointed to by \fIold\fR or \fInew\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 16n
+.rt
+The \fInew\fR argument is a directory and the mount point for a mounted file
+system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 16n
+.rt
+The directory where the new name entry is being placed cannot be extended
+because the user's quota of disk blocks on that file system has been exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The link named by \fInew\fR is a directory containing entries other than
+`\fB\&.\fR' (the directory itself) and `\fB\&..\fR' (the parent directory).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+Either \fIold\fR or \fInew\fR references an invalid address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The path argument includes non-UTF8 characters and the file system accepts only
+file names where all characters are part of the UTF-8 character codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The \fInew\fR argument directory pathname contains a path prefix that names the
+\fIold\fR directory, or an attempt was made to rename a regular file to an
+extended attribute or from an extended attribute to a regular file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while making or updating a directory entry.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEISDIR\fR\fR
+.ad
+.RS 16n
+.rt
+The \fInew\fR argument points to a directory but \fIold\fR points to a file
+that is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating the pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of \fIold\fR or \fInew\fR exceeds \fBPATH_MAX\fR, or a pathname
+component is longer than \fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The file named by \fIold\fR is a directory, and the link count of the parent
+directory of \fInew\fR would exceed \fBLINK_MAX\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The link named by \fIold\fR does not name an existing file, a component of the
+path prefix of \fInew\fR does not exist, or either \fIold\fR or \fInew\fR
+points to an empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+The directory that would contain \fInew\fR cannot be extended.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of either path prefix is not a directory, or \fIold\fR names a
+directory and \fInew\fR names a file that is not a directory, or \fItofd\fR and
+\fIdirfd\fR in \fBrenameat()\fR do not reference a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The requested operation requires writing in a directory on a read-only file
+system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEXDEV\fR\fR
+.ad
+.RS 16n
+.rt
+The links named by \fIold\fR and \fInew\fR are on different file systems.
+.RE
+
+.sp
+.LP
+The \fBrenameat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+An attempt was made to rename a regular file as an attribute file or to rename
+an attribute file as a regular file.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardFor \fBrename()\fR, see \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchmod\fR(2), \fBlink\fR(2), \fBunlink\fR(2), \fBattributes\fR(5),
+\fBfsattr\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The system can deadlock if there is a loop in the file system graph. Such a
+loop can occur if there is an entry in directory \fBa\fR, \fBa/name1\fR, that
+is a hard link to directory \fBb\fR, and an entry in directory \fBb\fR,
+\fBb/name2\fR, that is a hard link to directory \fBa\fR. When such a loop
+exists and two separate processes attempt to rename \fBa/name1\fR to
+\fBb/name2\fR and \fBb/name2\fR to \fBa/name1\fR, the system may deadlock
+attempting to lock both directories for modification. Use symbolic links
+instead of hard links for directories.
diff --git a/usr/src/man/man2/resolvepath.2 b/usr/src/man/man2/resolvepath.2
new file mode 100644
index 0000000000..aedc4a86a6
--- /dev/null
+++ b/usr/src/man/man2/resolvepath.2
@@ -0,0 +1,132 @@
+'\" te
+.\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH resolvepath 2 "12 May 1997" "SunOS 5.11" "System Calls"
+.SH NAME
+resolvepath \- resolve all symbolic links of a path name
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBresolvepath\fR(\fBconst char *\fR\fIpath\fR, \fBchar *\fR\fIbuf\fR, \fBsize_t\fR \fIbufsiz\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBresolvepath()\fR function fully resolves all symbolic links in the path
+name \fIpath\fR into a resulting path name free of symbolic links and places
+the resulting path name in the buffer \fIbuf\fR which has size \fIbufsiz\fR.
+The resulting path name names the same file or directory as the original path
+name. All ``\fB\&.\fR'' components are eliminated and every non-leading
+``\fB\&..\fR'' component is eliminated together with its preceding directory
+component. If leading ``\fB\&..\fR'' components reach to the root directory,
+they are replaced by ``\fB/\fR''. If the number of bytes in the resulting path
+name is less than \fIbufsiz\fR, the contents of the remainder of \fIbuf\fR are
+unspecified.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBresolvepath()\fR returns the count of bytes
+placed in the buffer. Otherwise, it returns \fB\(mi1\fR, leaves the buffer
+unchanged, and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBresolvepath()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix of \fIpath\fR or
+for a path prefix component resulting from the resolution of a symbolic link.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR or \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument is an empty string or a component of \fIpath\fR or a
+path name component produced by resolving a symbolic link does not name an
+existing file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in resolving \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of \fIpath\fR exceeds \fIPATH_MAX\fR, or a path name component is
+longer than \fINAME_MAX\fR. Path name resolution of a symbolic link produced an
+intermediate result whose length exceeds \fIPATH_MAX\fR or a component whose
+length exceeds \fINAME_MAX\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIpath\fR or of a path prefix component
+resulting from the resolution of a symbolic link is not a directory.
+.RE
+
+.SH USAGE
+.sp
+.LP
+No more than \fIPATH_MAX\fR bytes will be placed in the buffer. Applications
+should not assume that the returned contents of the buffer are null-terminated.
+.SH SEE ALSO
+.sp
+.LP
+\fBreadlink\fR(2), \fBrealpath\fR(3C)
diff --git a/usr/src/man/man2/rmdir.2 b/usr/src/man/man2/rmdir.2
new file mode 100644
index 0000000000..7ad069f3ac
--- /dev/null
+++ b/usr/src/man/man2/rmdir.2
@@ -0,0 +1,229 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH rmdir 2 "18 May 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+rmdir \- remove a directory
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBrmdir\fR(\fBconst char *\fR\fIpath\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBrmdir()\fR function removes the directory named by the path name pointed
+to by \fIpath\fR. The directory must not have any entries other than
+"\fB\&.\fR" and "\fB\&..\fR".
+.sp
+.LP
+If the directory's link count becomes zero and no process has the directory
+open, the space occupied by the directory is freed and the directory is no
+longer accessible. If one or more processes have the directory open when the
+last link is removed, the "\fB\&.\fR" and "\fB\&..\fR" entries, if present, are
+removed before \fBrmdir()\fR returns and no new entries may be created in the
+directory, but the directory is not removed until all references to the
+directory have been closed.
+.sp
+.LP
+Upon successful completion \fBrmdir()\fR marks for update the \fBst_ctime\fR
+and \fBst_mtime\fR fields of the parent directory.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, \fBerrno\fR is set to indicate the error, and the named directory is
+not changed.
+.SH ERRORS
+.sp
+.LP
+The \fBrmdir()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix and
+{\fBPRIV_FILE_DAC_SEARCH\fR} is not asserted in the effective set of the
+calling process
+.sp
+Write permission is denied on the directory containing the directory to be
+removed and {\fBPRIV_FILE_DAC_WRITE\fR} is not asserted.
+.sp
+The parent directory has the \fBS_ISVTX\fR variable set, is not owned by the
+user, and {\fBPRIV_FILE_OWNER\fR} is not asserted.
+.sp
+The directory is not owned by the user and is not writable by the user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 16n
+.rt
+The directory to be removed is the mount point for a mounted file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The directory contains entries other than those for "\fB\&.\fR" and
+"\fB\&..\fR".
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The directory to be removed is the current directory, or the final component of
+\fIpath\fR is "\fB\&.\fR".
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The path argument includes non-UTF8 characters and the file system accepts only
+file names where all characters are part of the UTF-8 character codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while accessing the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The named directory does not exist or is the null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine, and the connection to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The directory entry to be removed is part of a read-only file system.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBmkdir\fR(1), \fBrm\fR(1), \fBmkdir\fR(2), \fBattributes\fR(5),
+\fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/semctl.2 b/usr/src/man/man2/semctl.2
new file mode 100644
index 0000000000..787ef05dc2
--- /dev/null
+++ b/usr/src/man/man2/semctl.2
@@ -0,0 +1,356 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH semctl 2 "1 Feb 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+semctl \- semaphore control operations
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+
+\fBint\fR \fBsemctl\fR(\fBint\fR \fIsemid\fR, \fBint\fR \fIsemnum\fR, \fBint\fR \fIcmd\fR...);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsemctl()\fR function provides a variety of semaphore control operations
+as specified by \fIcmd\fR. The fourth argument is optional, depending upon the
+operation requested. If required, it is of type \fBunion semun\fR, which
+must be explicitly declared by the application program.
+.sp
+.in +2
+.nf
+union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort_t *array;
+} arg ;
+.fi
+.in -2
+
+.sp
+.LP
+The permission required for a semaphore operation is given as {\fItoken\fR},
+where \fItoken\fR is the type of permission needed. The types of permission
+are interpreted as follows:
+.sp
+.in +2
+.nf
+00400 READ by user
+00200 ALTER by user
+00040 READ by group
+00020 ALTER by group
+00004 READ by others
+00002 ALTER by others
+.fi
+.in -2
+
+.sp
+.LP
+See the \fBSemaphore Operation Permissions\fR subsection of the
+\fBDEFINITIONS\fR section of \fBIntro\fR(2) for more information. The following
+semaphore operations as specified by \fIcmd\fR are executed with respect to the
+semaphore specified by \fIsemid\fR and \fIsemnum\fR.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETVAL\fR\fR
+.ad
+.RS 11n
+.rt
+Return the value of semval (see \fBIntro\fR(2)). {READ}
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSETVAL\fR\fR
+.ad
+.RS 11n
+.rt
+Set the value of \fBsemval\fR to \fIarg.\fR\fIval\fR. {ALTER} When this
+command is successfully executed, the \fBsemadj\fR value corresponding to the
+specified semaphore in all processes is cleared.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETPID\fR\fR
+.ad
+.RS 11n
+.rt
+Return the value of \fB(int) sempid\fR. {READ}
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETNCNT\fR\fR
+.ad
+.RS 11n
+.rt
+Return the value of \fBsemncnt\fR. {READ}
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETZCNT\fR\fR
+.ad
+.RS 11n
+.rt
+Return the value of \fBsemzcnt\fR. {READ}
+.RE
+
+.sp
+.LP
+The following operations return and set, respectively, every \fBsemval\fR in
+the set of semaphores.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETALL\fR\fR
+.ad
+.RS 10n
+.rt
+Place \fBsemval\fRs into array pointed to by \fIarg.\fR\fBarray\fR. {READ}
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSETALL\fR\fR
+.ad
+.RS 10n
+.rt
+Set \fBsemval\fRs according to the array pointed to by \fIarg.\fR\fBarray\fR.
+{ALTER}. When this cmd is successfully executed, the \fBsemadj\fR values
+corresponding to each specified semaphore in all processes are cleared.
+.RE
+
+.sp
+.LP
+The following operations are also available.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_STAT\fR\fR
+.ad
+.RS 12n
+.rt
+Place the current value of each member of the data structure associated with
+\fIsemid\fR into the structure pointed to by \fIarg.\fR\fBbuf\fR. The contents
+of this structure are defined in \fBIntro\fR(2). {READ}
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_SET\fR\fR
+.ad
+.RS 12n
+.rt
+Set the value of the following members of the data structure associated with
+\fIsemid\fR to the corresponding value found in the structure pointed to by
+\fIarg\fR.\fBbuf\fR:
+.sp
+.in +2
+.nf
+sem_perm.uid
+sem_perm.gid
+sem_perm.mode /* access permission bits only */
+.fi
+.in -2
+
+This command can be executed only by a process that has either the
+{\fBPRIV_IPC_OWNER\fR} privilege or an effective user \fBID\fR equal to the
+value of \fBmsg_perm.cuid\fR or \fBmsg_perm.uid\fR in the data structure
+associated with \fImsqid\fR. Only a process with the
+{\fBPRIV_SYS_IPC_CONFIG\fR} privilege can raise the value of \fBmsg_qbytes\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_RMID\fR\fR
+.ad
+.RS 12n
+.rt
+Remove the semaphore identifier specified by \fIsemid\fR from the system and
+destroy the set of semaphores and data structure associated with it. This
+command can be executed only by a process that has the {\fBPRIV_IPC_OWNER\fR}
+privilege or an effective user \fBID\fR equal to the value of
+\fBsem_perm.cuid\fR or \fBsem_perm.uid\fR in the data structure associated with
+\fIsemid\fR.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the value returned depends on \fIcmd\fR as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETVAL\fR\fR
+.ad
+.RS 11n
+.rt
+the value of \fBsemval\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETPID\fR\fR
+.ad
+.RS 11n
+.rt
+the value of \fB(int) sempid\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETNCNT\fR\fR
+.ad
+.RS 11n
+.rt
+the value of \fBsemncnt\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETZCNT\fR\fR
+.ad
+.RS 11n
+.rt
+the value of \fBsemzcnt\fR
+.RE
+
+.sp
+.LP
+All other successful completions return \fB0\fR; otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsemctl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 13n
+.rt
+Operation permission is denied to the calling process (see \fBIntro\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 13n
+.rt
+The source or target is not a valid address in the user process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIsemid\fR argument is not a valid semaphore identifier; the \fIsemnum\fR
+argument is less than 0 or greater than \fBsem_nsems\fR \(mi1; or the \fIcmd\fR
+argument is not a valid command or is \fBIPC_SET\fR and \fBsem_perm.uid\fR or
+\fBsem_perm.gid\fR is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is equal to \fBIPC_RMID\fR or \fBIPC_SET\fR, the
+effective user ID of the calling process is not equal to the value of
+\fBsem_perm.cuid\fR or \fBsem_perm.uid\fR in the data structure associated with
+\fIsemid\fR, and {\fBPRIV_IPC_OWNER\fR} is not asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBIPC_STAT\fR and \fIuid\fR or \fIgid\fR is too
+large to be stored in the structure pointed to by \fIarg.buf\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBSETVAL\fR or \fBSETALL\fR and the value to which
+\fBsemval\fR is to be set is greater than the system imposed maximum.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcs\fR(1), \fBIntro\fR(2), \fBsemget\fR(2), \fBsemop\fR(2),
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/semget.2 b/usr/src/man/man2/semget.2
new file mode 100644
index 0000000000..0ff9d8581a
--- /dev/null
+++ b/usr/src/man/man2/semget.2
@@ -0,0 +1,189 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH semget 2 "14 Aug 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+semget \- get set of semaphores
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+
+\fBint\fR \fBsemget\fR(\fBkey_t\fR \fIkey\fR, \fBint\fR \fInsems\fR, \fBint\fR \fIsemflg\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsemget()\fR function returns the semaphore identifier associated with
+\fIkey\fR.
+.sp
+.LP
+A semaphore identifier and associated data structure and set containing
+\fInsems\fR semaphores (see \fBIntro\fR(2)) are created for \fIkey\fR if one of
+the following is true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fIkey\fR is equal to \fBIPC_PRIVATE\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fIkey\fR does not already have a semaphore identifier associated with it, and
+(\fIsemflg\fR\fB&IPC_CREAT\fR) is true.
+.RE
+.sp
+.LP
+On creation, the data structure associated with the new semaphore identifier is
+initialized as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBsem_perm.cuid\fR, \fBsem_perm.uid\fR, \fBsem_perm.cgid\fR, and
+\fBsem_perm.gid\fR are set equal to the effective user \fBID\fR and effective
+group \fBID,\fR respectively, of the calling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The access permission bits of \fBsem_perm.mode\fR are set equal to the access
+permission bits of \fIsemflg\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBsem_nsems\fR is set equal to the value of \fInsems\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBsem_otime\fR is set equal to 0 and \fBsem_ctime\fR is set equal to the
+current time.
+.RE
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative integer representing a semaphore
+identifier is returned. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is
+set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsemget()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+A semaphore identifier exists for \fIkey\fR, but operation permission (see
+\fBIntro\fR(2)) as specified by the low-order 9 bits of \fIsemflg\fR would not
+be granted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 10n
+.rt
+A semaphore identifier exists for \fIkey\fR but both
+(\fIsemflg\fR\fB&IPC_CREAT\fR) and (\fIsemflg\fR\fB&IPC_EXCL\fR) are both true.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fInsems\fR argument is either less than or equal to 0 or greater than the
+system-imposed limit. See NOTES.
+.sp
+A semaphore identifier exists for \fIkey\fR, but the number of semaphores in
+the set associated with it is less than \fInsems\fR and \fInsems\fR is not
+equal to 0.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 10n
+.rt
+A semaphore identifier does not exist for \fIkey\fR and
+(\fIsemflg\fR\fB&IPC_CREAT\fR) is false.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 10n
+.rt
+A semaphore identifier is to be created but the system-imposed limit on the
+maximum number of allowed semaphores or semaphore identifiers system-wide would
+be exceeded. See NOTES.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcrm\fR(1), \fBipcs\fR(1), \fBrctladm\fR(1M), \fBIntro\fR(2),
+\fBsemctl\fR(2), \fBsemop\fR(2), \fBsetrctl\fR(2), \fBftok\fR(3C),
+\fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The system-imposed limit on the value of the \fInsems\fR argument is the
+maintained on a per-process basis using the \fBprocess.max-sem-nsems\fR
+resource control.
+.sp
+.LP
+The system-imposed limit on the number of semaphore identifiers is maintained
+on a per-project basis using the \fBproject.max-sem-ids\fR resource control.
+The \fBzone.max-sem-ids\fR resource control limis the total number of
+semaphore identifiers that can be allocated by a zone.
+.sp
+.LP
+See \fBrctladm\fR(1M) and \fBsetrctl\fR(2) for information about using resource
+controls.
diff --git a/usr/src/man/man2/semids.2 b/usr/src/man/man2/semids.2
new file mode 100644
index 0000000000..8ffe66faee
--- /dev/null
+++ b/usr/src/man/man2/semids.2
@@ -0,0 +1,119 @@
+'\" te
+.\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH semids 2 "8 Mar 2000" "SunOS 5.11" "System Calls"
+.SH NAME
+semids \- discover all semaphore identifiers
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/sem.h>
+
+\fBint\fR \fBsemids\fR(\fBint *\fR\fIbuf\fR, \fBuint_t\fR \fInids\fR, \fBuint_t *\fR\fIpnids\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsemids()\fR function copies all active semaphore identifiers from the
+system into the user-defined buffer specified by \fIbuf\fR, provided that the
+number of such identifiers is not greater than the number of integers the
+buffer can contain, as specified by \fInids\fR. If the size of the buffer is
+insufficient to contain all of the active semaphore identifiers in the system,
+none are copied.
+.sp
+.LP
+Whether or not the size of the buffer is sufficient to contain all of them, the
+number of active semaphore identifiers in the system is copied into the
+unsigned integer pointed to by \fIpnids\fR.
+.sp
+.LP
+If \fInids\fR is 0 or less than the number of active semaphore identifiers in
+the system, \fIbuf\fR is ignored.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBsemids()\fR returns \fB0\fR. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsemids()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR or \fIpnids\fR argument points to an illegal address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBsemids()\fR function returns a snapshot of all the active semaphore
+identifiers in the system. More may be added and some may be removed before
+they can be used by the caller.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fR\fBsemids()\fR example
+.sp
+.LP
+This is sample C code indicating how to use the \fBsemids()\fR function.
+
+.sp
+.in +2
+.nf
+void
+examine_semids()
+{
+ int *ids = NULL;
+ uint_t nids = 0;
+ uint_t n;
+ int i;
+
+ for (;;) {
+ if (semids(ids, nids, &n) != 0) {
+ perror("semids");
+ exit(1);
+ }
+ if (n <= nids) /* we got them all */
+ break;
+ /* we need a bigger buffer */
+ ids = realloc(ids, (nids = n) * sizeof (int));
+ }
+
+ for (i = 0; i < n; i++)
+ process_semid(ids[i]);
+
+ free(ids);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcrm\fR(1), \fBipcs\fR(1), \fBIntro\fR(2), \fBsemctl\fR(2),
+\fBsemget\fR(2), \fBsemop\fR(2), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/semop.2 b/usr/src/man/man2/semop.2
new file mode 100644
index 0000000000..775a31eef4
--- /dev/null
+++ b/usr/src/man/man2/semop.2
@@ -0,0 +1,418 @@
+'\" te
+.\" Copyright 1989 AT&T.
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH semop 2 "12 May 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+semop, semtimedop \- semaphore operations
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+
+\fBint\fR \fBsemop\fR(\fBint\fR \fIsemid\fR, \fBstruct sembuf *\fR\fIsops\fR, \fBsize_t\fR \fInsops\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsemtimedop\fR(\fBint\fR \fIsemid\fR, \fBstruct sembuf *\fR\fIsops\fR, \fBsize_t\fR \fInsops\fR,
+ \fBconst struct timespec *\fR\fItimeout\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsemop()\fR function is used to perform atomically an array of semaphore
+operations on the set of semaphores associated with the semaphore identifier
+specified by \fIsemid\fR. The \fIsops\fR argument is a pointer to the array of
+semaphore-operation structures. The \fInsops\fR argument is the number of such
+structures in the array.
+.sp
+.LP
+Each \fBsembuf\fR structure contains the following members:
+.sp
+.in +2
+.nf
+short sem_num; /* semaphore number */
+short sem_op; /* semaphore operation */
+short sem_flg; /* operation flags */
+.fi
+.in -2
+
+.sp
+.LP
+Each semaphore operation specified by \fBsem_op\fR is performed on the
+corresponding semaphore specified by \fIsemid\fR and \fBsem_num\fR. The
+permission required for a semaphore operation is given as {\fItoken\fR}, where
+\fItoken\fR is the type of permission needed. The types of permission are
+interpreted as follows:
+.sp
+.in +2
+.nf
+00400 READ by user
+00200 ALTER by user
+00040 READ by group
+00020 ALTER by group
+00004 READ by others
+00002 ALTER by others
+.fi
+.in -2
+
+.sp
+.LP
+See the \fBSemaphore Operation Permissions\fR section of \fBIntro\fR(2) for
+more information.
+.sp
+.LP
+A process maintains a value, \fBsemadj\fR, for each semaphore it modifies. This
+value contains the cumulative effect of operations the process has performed on
+an individual semaphore with the \fBSEM_UNDO\fR flag set (so that they can be
+undone if the process terminates unexpectedly). The value of \fBsemadj\fR can
+affect the behavior of calls to \fBsemop()\fR, \fBsemtimedop()\fR,
+\fBexit()\fR, and \fB_exit()\fR (the latter two functions documented on
+\fBexit\fR(2)), but is otherwise unobservable. See below for details.
+.sp
+.LP
+The \fBsem_op\fR member specifies one of three semaphore operations:
+.RS +4
+.TP
+1.
+The \fBsem_op\fR member is a negative integer; {ALTER}
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBsemval\fR (see \fBIntro\fR(2)) is greater than or equal to the absolute
+value of \fBsem_op\fR, the absolute value of \fBsem_op\fR is subtracted from
+\fBsemval\fR. Also, if (\fIsem_flg\fR\fB&SEM_UNDO\fR) is true, the absolute
+value of \fBsem_op\fR is added to the calling process's \fBsemadj\fR value (see
+\fBexit\fR(2)) for the specified semaphore.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBsemval\fR is less than the absolute value of \fBsem_op\fR and
+(\fIsem_flg\fR\fB&IPC_NOWAIT\fR) is true, \fBsemop()\fR returns immediately.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBsemval\fR is less than the absolute value of \fBsem_op\fR and
+(\fIsem_flg\fR\fB&IPC_NOWAIT\fR) is false, \fBsemop()\fR increments the
+\fBsemncnt\fR associated with the specified semaphore and suspends execution of
+the calling thread until one of the following conditions occur:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The value of \fBsemval\fR becomes greater than or equal to the absolute value
+of \fBsem_op\fR. When this occurs, the value of \fBsemncnt\fR associated with
+the specified semaphore is decremented, the absolute value of \fBsem_op\fR is
+subtracted from \fBsemval\fR and, if (\fIsem_flg\fR\fB&SEM_UNDO\fR) is true,
+the absolute value of \fBsem_op\fR is added to the calling process's
+\fBsemadj\fR value for the specified semaphore.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The \fIsemid\fR for which the calling thread is awaiting action is removed from
+the system (see \fBsemctl\fR(2)). When this occurs, \fBerrno\fR is set to
+\fBEIDRM\fR and \fB\(mi1\fR is returned.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The calling thread receives a signal that is to be caught. When this occurs,
+the value of \fBsemncnt\fR associated with the specified semaphore is
+decremented, and the calling thread resumes execution in the manner prescribed
+in \fBsigaction\fR(2).
+.RE
+.RE
+.RE
+.RS +4
+.TP
+2.
+The \fBsem_op\fR member is a positive integer; {ALTER}
+.sp
+The value of \fBsem_op\fR is added to \fBsemval\fR and, if
+(\fIsem_flg\fR\fB&SEM_UNDO\fR) is true, the value of \fBsem_op\fR is subtracted
+from the calling process's \fBsemadj\fR value for the specified semaphore.
+.RE
+.RS +4
+.TP
+3.
+The \fBsem_op\fR member is 0; {READ}
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBsemval\fR is 0, \fBsemop()\fR returns immediately.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBsemval\fR is not equal to 0 and (\fIsem_flg\fR\fB&IPC_NOWAIT\fR) is true,
+\fBsemop()\fR returns immediately.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBsemval\fR is not equal to 0 and (\fIsem_flg\fR\fB&IPC_NOWAIT\fR) is
+false, \fBsemop()\fR increments the \fBsemzcnt\fR associated with the specified
+semaphore and suspends execution of the calling thread until one of the
+following occurs:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The value of \fBsemval\fR becomes 0, at which time the value of \fBsemzcnt\fR
+associated with the specified semaphore is set to 0 and all processes waiting
+on \fBsemval\fR to become 0 are awakened.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The \fIsemid\fR for which the calling thread is awaiting action is removed from
+the system. When this occurs, \fBerrno\fR is set to \fBEIDRM\fR and \fB\(mi1\fR
+is returned.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The calling thread receives a signal that is to be caught. When this occurs,
+the value of \fBsemzcnt\fR associated with the specified semaphore is
+decremented, and the calling thread resumes execution in the manner prescribed
+in \fBsigaction\fR(2).
+.RE
+.RE
+.RE
+.sp
+.LP
+Upon successful completion, the value of \fBsempid\fR for each semaphore
+specified in the array pointed to by \fIsops\fR is set to the process \fBID\fR
+of the calling process.
+.sp
+.LP
+The \fBsemtimedop()\fR function behaves as \fBsemop()\fR except when it must
+suspend execution of the calling process to complete its operation. If
+\fBsemtimedop()\fR must suspend the calling process after the time interval
+specified in \fItimeout\fR expires, or if the timeout expires while the process
+is suspended, \fBsemtimedop()\fR returns with an error. If the \fBtimespec\fR
+structure pointed to by \fItimeout\fR is zero-valued and \fBsemtimedop()\fR
+needs to suspend the calling process to complete the requested operation(s), it
+returns immediately with an error. If \fItimeout\fR is the \fINULL\fR pointer,
+the behavior of \fBsemtimedop()\fR is identical to that of \fBsemop()\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsemop()\fR and \fBsemtimedop()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBE2BIG\fR\fR
+.ad
+.RS 10n
+.rt
+The \fInsops\fR argument is greater than the system-imposed maximum. See NOTES.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+Operation permission is denied to the calling process (see \fBIntro\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+The operation would result in suspension of the calling process but
+(\fIsem_flg\fR\fB&IPC_NOWAIT\fR) is true.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsops\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFBIG\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fBsem_num\fR is less than 0 or greater than or equal to the
+number of semaphores in the set associated with \fIsemid\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIDRM\fR\fR
+.ad
+.RS 10n
+.rt
+A \fIsemid\fR was removed from the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+A signal was received.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsemid\fR argument is not a valid semaphore identifier, or the number of
+individual semaphores for which the calling process requests a \fBSEM_UNDO\fR
+operation would exceed the system-imposed limit. Solaris does not impose a
+limit on the number of individual semaphores for which the calling process
+requests a \fBSEM_UNDO\fR operation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 10n
+.rt
+The limit on the number of individual processes requesting a \fBSEM_UNDO\fR
+operation would be exceeded. Solaris does not impose a limit on the number of
+individual processes requesting an \fBSEM_UNDO\fR operation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 10n
+.rt
+An operation would cause a \fBsemval\fR or a \fBsemadj\fR value to overflow the
+system-imposed limit.
+.RE
+
+.sp
+.LP
+The \fBsemtimedop()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+The timeout expired before the requested operation could be completed.
+.RE
+
+.sp
+.LP
+The \fBsemtimedop()\fR function will fail if one of the following is detected:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItimeout\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItimeout\fR argument specified a \fBtv_sec\fR or \fBtv_nsec\fR value less
+than 0, or a \fBtv_nsec\fR value greater than or equal to 1000 million.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface Stability\fBsemop()\fR is Standard.
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcs\fR(1), \fBrctladm\fR(1M), \fBIntro\fR(2), \fBexec\fR(2), \fBexit\fR(2),
+\fBfork\fR(2), \fBsemctl\fR(2), \fBsemget\fR(2), \fBsetrctl\fR(2),
+\fBsigaction\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The system-imposed maximum on \fInsops\fR for a semaphore identifier is the
+minimum enforced value of the \fBprocess.max-sem-ops\fR resource control of the
+creating process at the time \fBsemget\fR(2) was used to allocate the
+identifier.
+.sp
+.LP
+See \fBrctladm\fR(1M) and \fBsetrctl\fR(2) for information about using resource
+controls.
diff --git a/usr/src/man/man2/setpgid.2 b/usr/src/man/man2/setpgid.2
new file mode 100644
index 0000000000..f7ded83fb2
--- /dev/null
+++ b/usr/src/man/man2/setpgid.2
@@ -0,0 +1,145 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setpgid 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+setpgid \- set process group ID
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBint\fR \fBsetpgid\fR(\fBpid_t\fR \fIpid\fR, \fBpid_t\fR \fIpgid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetpgid()\fR function sets the process group \fBID\fR of the process
+with \fBID\fR \fIpid\fR to \fIpgid\fR.
+.sp
+.LP
+If \fIpgid\fR is equal to \fIpid\fR, the process becomes a process group
+leader. See \fBIntro\fR(2) for more information on session leaders and process
+group leaders.
+.sp
+.LP
+If \fIpgid\fR is not equal to \fIpid\fR, the process becomes a member of an
+existing process group.
+.sp
+.LP
+If \fIpid\fR is equal to 0, the process \fBID\fR of the calling process is
+used. If \fIpgid\fR is equal to 0, the process specified by \fIpid\fR becomes a
+process group leader.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsetpgid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIpid\fR argument matches the process \fBID\fR of a child process of the
+calling process and the child process has successfully executed one of the
+\fIexec\fR family of functions (see \fBexec\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIpgid\fR argument is less than (\fBpid_t) 0\fR or greater than or equal
+to \fBPID_MAX\fR, or the calling process has a controlling terminal that does
+not support job control.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The process indicated by the \fIpid\fR argument is a session leader.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIpid\fR argument matches the process \fBID\fR of a child process of the
+calling process and the child process is not in the same session as the calling
+process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIpgid\fR argument does not match the process \fBID\fR of the process
+indicated by the \fIpid\fR argument, and there is no process with a process
+group \fBID\fR that matches \fIpgid\fR in the same session as the calling
+process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIpid\fR argument does not match the process \fBID\fR of the calling
+process or of a child process of the calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2), \fBgetpid\fR(2),
+\fBgetsid\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/setpgrp.2 b/usr/src/man/man2/setpgrp.2
new file mode 100644
index 0000000000..52ce46bf08
--- /dev/null
+++ b/usr/src/man/man2/setpgrp.2
@@ -0,0 +1,57 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setpgrp 2 "5 Jan 2000" "SunOS 5.11" "System Calls"
+.SH NAME
+setpgrp \- set process group ID
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBpid_t\fR \fBsetpgrp\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+If the calling process is not already a session leader, the \fBsetpgrp()\fR
+function makes it one by setting its process group \fBID\fR and session
+\fBID\fR to the value of its process \fBID\fR, and releases its controlling
+terminal. See \fBIntro\fR(2) for more information on process group \fBID\fRs
+and session leaders.
+.SH RETURN VALUES
+.sp
+.LP
+The \fBsetpgrp()\fR function returns the value of the new process group
+\fBID\fR.
+.SH ERRORS
+.sp
+.LP
+No errors are defined.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsetpgrp\fR(1), \fBIntro\fR(2), \fBexec\fR(2), \fBfork\fR(2),
+\fBgetpid\fR(2), \fBgetsid\fR(2), \fBkill\fR(2), \fBsignal\fR(3C),
+\fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/setrctl.2 b/usr/src/man/man2/setrctl.2
new file mode 100644
index 0000000000..3f0381213e
--- /dev/null
+++ b/usr/src/man/man2/setrctl.2
@@ -0,0 +1,301 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setrctl 2 "31 Jan 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+setrctl, getrctl \- set or get resource control values
+.SH SYNOPSIS
+.LP
+.nf
+#include <rctl.h>
+
+\fBint\fR \fBsetrctl\fR(\fBconst char *\fR\fIcontrolname\fR, \fBrctlblk_t *\fR\fIold_blk\fR,
+ \fBrctlblk_t *\fR\fInew_blk\fR, \fBuint_t\fR \fIflags\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBgetrctl\fR(\fBconst char *\fR\fIcontrolname\fR, \fBrctlblk_t *\fR\fIold_blk\fR,
+ \fBrctlblk_t *\fR\fInew_blk\fR, \fBuint_t\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetrctl()\fR and \fBgetrctl()\fR functions provide interfaces for the
+modification and retrieval of resource control (rctl) values on active entities
+on the system, such as processes, tasks, or projects. All resource controls
+are unsigned 64-bit integers; however, a collection of flags are defined that
+modify which rctl value is to be set or retrieved.
+.sp
+.LP
+Resource controls are restricted to three levels: basic controls that can be
+modified by the owner of the calling process, privileged controls that can be
+modified only by privileged callers, and system controls that are fixed for the
+duration of the operating system instance. Setting or retrieving each of these
+controls is performed by setting the privilege field of the resource control
+block to \fBRCTL_BASIC\fR, \fBRCTL_PRIVILEGED\fR, or \fBRCTL_SYSTEM\fR with
+\fBrctlblk_set_privilege()\fR (see \fBrctlblk_set_value\fR(3C)).
+.sp
+.LP
+For limits on collective entities such as the task or project, the process ID
+of the calling process is associated with the resource control value. This ID
+is available by using \fBrctlblk_get_recipient_pid()\fR (see
+\fBrctlblk_set_value\fR(3C)). These values are visible only to that process and
+privileged processes within the collective.
+.sp
+.LP
+The \fBgetrctl()\fR function provides a mechanism for iterating through all of
+the established values on a resource control. The iteration is primed by
+calling \fBgetrctl()\fR with \fIold_blk\fR set to \fINULL\fR, a valid resource
+control block pointer in \fInew_blk\fR, and specifying \fBRCTL_FIRST\fR in the
+\fIflags\fR argument. Once a resource control block has been obtained,
+repeated calls to \fBgetrctl()\fR with \fBRCTL_NEXT\fR in the \fIflags\fR
+argument and the obtained control in the \fIold_blk\fR argument will return the
+next resource control block in the sequence. The iteration reports the end of
+the sequence by failing and setting \fBerrno\fR to \fBENOENT\fR.
+.sp
+.LP
+The \fBgetrctl()\fR function allows the calling process to get the current
+usage of a controlled resource using \fBRCTL_USAGE\fR as the \fIflags\fR value.
+The current value of the resource usage is placed in the value field of the
+resource control block specified by \fInew_blk\fR. This value is obtained with
+\fBrctlblk_set_value\fR(3C). All other members of the returned block are
+undefined and might be invalid.
+.sp
+.LP
+The \fBsetrctl()\fR function allows the creation, modification, or deletion of
+action-value pairs on a given resource control. When passed \fBRCTL_INSERT\fR
+as the \fIflags\fR value, \fBsetrctl()\fR expects \fInew_blk\fR to contain a
+new action-value pair for insertion into the sequence. For \fBRCTL_DELETE\fR,
+the block indicated by \fInew_blk\fR is deleted from the sequence. For
+\fBRCTL_REPLACE\fR, the block matching \fIold_blk\fR is deleted and replaced by
+the block indicated by \fInew_blk\fR. When (\fIflags\fR &
+\fBRCTL_USE_RECIPIENT_PID\fR) is non-zero, \fBsetrctl()\fR uses the process ID
+set by \fBrctlblk_set_value\fR(3C) when selecting the rctl value to insert,
+delete, or replace basic rctls. Otherwise, the process ID of the calling
+process is used.
+.sp
+.LP
+The kernel maintains a history of which resource control values have triggered
+for a particular entity, retrievable from a resource control block with the
+\fBrctlblk_set_value\fR(3C) function. The insertion or deletion of a resource
+control value at or below the currently enforced value might cause the
+currently enforced value to be reset. In the case of insertion, the newly
+inserted value becomes the actively enforced value. All higher values that
+have previously triggered will have their firing times zeroed. In the case of
+deletion of the currently enforced value, the next higher value becomes the
+actively enforced value.
+.sp
+.LP
+The various resource control block properties are described on the
+\fBrctlblk_set_value\fR(3C) manual page.
+.sp
+.LP
+Resource controls are inherited from the predecessor process or task. One of
+the \fBexec\fR(2) functions can modify the resource controls of a process by
+resetting their histories, as noted above for insertion or deletion operations.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the \fBsetrctl()\fR and \fBgetrctl()\fR functions
+return 0. Otherwise they return \(mi1 and set \fBerrno\fR to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBsetrctl()\fR and \fBgetrctl()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 12n
+.rt
+The \fIcontrolname\fR, \fIold_blk\fR, or \fInew_blk\fR argument points to an
+illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 12n
+.rt
+No resource control with the given name is known to the system, or the resource
+control block contains properties that are not valid for the resource control
+specified.
+.sp
+\fBRCTL_USE_RECIPIENT_PID\fR was used to set a process scope rctl and the
+process ID set by \fBrctlblk_set_value\fR(3C) does not match the process ID of
+calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 12n
+.rt
+No value beyond the given resource control block exists.
+.sp
+\fBRCTL_USE_RECIPIENT_PID\fR was used and the process ID set by
+\fBrctlblk_set_value\fR(3C) does not exist within the current task, project, or
+zone, depending on the resource control name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 12n
+.rt
+No value matching the given resource control block was found for any of
+\fBRCTL_NEXT\fR, \fBRCTL_DELETE\fR, or \fBRCTL_REPLACE\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUPP\fR\fR
+.ad
+.RS 12n
+.rt
+The resource control requested by \fBRCTL_USAGE\fR does not support the usage
+operation.
+.RE
+
+.sp
+.LP
+The \fBsetrctl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+The rctl value specified cannot be changed by the current process, including
+the case where the recipient process ID does not match the calling process and
+the calling process is unprivileged.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+An attempt to set a system limit was attempted.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRRetrieve a rctl value.
+.sp
+.LP
+Obtain the lowest enforced rctl value on the rctl limiting the number of LWPs
+in a task.
+
+.sp
+.in +2
+.nf
+#include <rctl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+\&...
+
+rctlblk_t *rblk;
+
+if ((rblk = (rctlblk_t *)malloc(rctlblk_size())) == NULL) {
+ (void) fprintf(stderr, "malloc failed: %s\en",
+ strerror(errno));
+ exit(1);
+}
+
+if (getrctl("task.max-lwps", NULL, rblk, RCTL_FIRST) == -1)
+ (void) fprintf(stderr, "failed to get rctl: %s\en",
+ strerror(errno));
+else
+ (void) printf("task.max-lwps = %llu\en",
+ rctlblk_get_value(rblk));
+.fi
+.in -2
+
+.SH USAGE
+.sp
+.LP
+Resource control blocks are matched on the value and privilege fields.
+Resource control operations act on the first matching resource control block.
+Duplicate resource control blocks are not permitted. Multiple blocks of equal
+value and privilege need to be entirely deleted and reinserted, rather than
+replaced, to have the correct outcome. Resource control blocks are sorted such
+that all blocks with the same value that lack the \fBRCTL_LOCAL_DENY\fR flag
+precede those having that flag set.
+.sp
+.LP
+Only one \fBRCPRIV_BASIC\fR resource control value is permitted per process per
+control. Insertion of an \fBRCPRIV_BASIC\fR value will cause any existing
+\fBRCPRIV_BASIC\fR value owned by that process on the control to be deleted.
+.sp
+.LP
+The resource control facility provides the backend implementation for both
+\fBsetrctl()\fR/\fBgetrctl()\fR and \fBsetrlimit()\fR/\fBgetrlimit()\fR. The
+facility behaves consistently when either of these interfaces is used
+exclusively; when using both interfaces, the caller must be aware of the
+ordering issues above, as well as the limit equivalencies described in the
+following paragraph.
+.sp
+.LP
+The hard and soft process limits made available with \fBsetrlimit()\fR and
+\fBgetrlimit()\fR are mapped to the resource controls implementation. (New
+process resource controls will not be made available with the rlimit
+interface.) Because of the \fBRCTL_INSERT\fR and \fBRCTL_DELETE\fR operations,
+it is possible that the set of values defined on a resource control has more or
+fewer than the two values defined for an rlimit. In this case, the soft limit
+is the lowest priority resource control value with the \fBRCTL_LOCAL_DENY\fR
+flag set, and the hard limit is the resource control value with the lowest
+priority equal to or exceeding \fBRCPRIV_PRIVILEGED\fR with the
+\fBRCTL_LOCAL_DENY\fR flag set. If no identifiable soft limit exists on the
+resource control and \fBsetrlimit()\fR is called, a new resource control value
+is created. If a resource control does not have the global
+\fBRCTL_GLOBAL_LOWERABLE\fR property set, its hard limit will not allow
+lowering by unprivileged callers.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBrctladm\fR(1M), \fBgetrlimit\fR(2), \fBerrno\fR(3C),
+\fBrctlblk_set_value\fR(3C), \fBattributes\fR(5), \fBresource_controls\fR(5)
diff --git a/usr/src/man/man2/setregid.2 b/usr/src/man/man2/setregid.2
new file mode 100644
index 0000000000..7f83e1b9cc
--- /dev/null
+++ b/usr/src/man/man2/setregid.2
@@ -0,0 +1,104 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setregid 2 "22 Mar 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+setregid \- set real and effective group IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBsetregid\fR(\fBgid_t\fR \fIrgid\fR, \fBgid_t\fR \fIegid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetregid()\fR function is used to set the real and effective group IDs
+of the calling process. If \fIrgid\fR is \(mi1, the real group ID is not
+changed; if \fIegid\fR is \(mi1, the effective group ID is not changed. The
+real and effective group IDs may be set to different values in the same call.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is asserted in the effective set of
+the calling process, the real group ID and the effective group ID can be set to
+any legal value.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set
+of the calling process, either the real group ID can be set to the saved
+set-group-ID from \fBexecve\fR(2), or the effective group ID can either be set
+to the saved set-group-ID or the real group ID.
+.sp
+.LP
+In either case, if the real group ID is being changed (that is, if \fIrgid\fR
+is not \(mi1), or the effective group ID is being changed to a value not equal
+to the real group ID, the saved set-group-ID is set equal to the new effective
+group ID.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned,
+\fBerrno\fR is set to indicate the error, and neither of the group IDs will be
+changed.
+.SH ERRORS
+.sp
+.LP
+The \fBsetregid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIrgid\fR or \fIegid\fR is less than 0 or greater than
+\fBUID_MAX\fR (defined in <\fBlimits.h\fR>).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set of
+the calling processes and a change was specified other than changing the real
+group \fBID\fR to the saved set-group-\fBID\fR or changing the effective group
+\fBID\fR to the real group \fBID\fR or the saved group ID.
+.RE
+
+.SH USAGE
+.sp
+.LP
+If a set-group-\fBID\fR process sets its effective group \fBID\fR to its real
+group \fBID\fR, it can still set its effective group \fBID\fR back to the saved
+set-group-\fBID\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexecve\fR(2), \fBgetgid\fR(2), \fBsetreuid\fR(2), \fBsetuid\fR(2),
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/setreuid.2 b/usr/src/man/man2/setreuid.2
new file mode 100644
index 0000000000..33823a6a6c
--- /dev/null
+++ b/usr/src/man/man2/setreuid.2
@@ -0,0 +1,109 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setreuid 2 "22 Mar 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+setreuid \- set real and effective user IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBsetreuid\fR(\fBuid_t\fR \fIruid\fR, \fBuid_t\fR \fIeuid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetreuid()\fR function is used to set the real and effective user IDs of
+the calling process. If \fIruid\fR is \(mi1, the real user ID is not changed;
+if \fIeuid\fR is \(mi1, the effective user ID is not changed. The real and
+effective user IDs may be set to different values in the same call.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is asserted in the effective set of
+the calling process, the real user ID and the effective user \fBID\fR can be
+set to any legal value.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set
+of the calling process, either the real user ID can be set to the effective
+user ID, or the effective user ID can either be set to the saved set-user ID
+from \fBexecve()\fR (see\fBexec\fR(2)) or the real user ID.
+.sp
+.LP
+In either case, if the real user ID is being changed (that is, if \fIruid\fR is
+not \fB\(mi1\fR), or the effective user ID is being changed to a value not
+equal to the real user ID, the saved set-user ID is set equal to the new
+effective user ID.
+.sp
+.LP
+All privileges are required to change to uid 0.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned,
+\fBerrno\fR is set to indicate the error, and neither of the user IDs will be
+changed.
+.SH ERRORS
+.sp
+.LP
+The \fBsetreuid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIruid\fR or \fIeuid\fR is less than \fB0\fR or greater than
+\fBUID_MAX\fR (defined in <\fBlimits.h\fR>).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {PRIV_PROC_SETID} privilege is not asserted in the effective set of the
+calling processes and a change was specified other than changing the real user
+\fBID\fR to the effective user \fBID\fR, or changing the effective user
+\fBID\fR to the real user \fBID\fR or the saved set-user \fBID\fR. See
+\fBprivileges\fR(5) for additional restrictions which apply when changing to
+UID 0.
+.RE
+
+.SH USAGE
+.sp
+.LP
+If a set-user-\fBID\fR process sets its effective user \fBID\fR to its real
+user \fBID\fR, it can still set its effective user \fBID\fR back to the saved
+set-user \fBID\fR.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBgetuid\fR(2), \fBsetregid\fR(2), \fBsetuid\fR(2),
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/setsid.2 b/usr/src/man/man2/setsid.2
new file mode 100644
index 0000000000..0a0bd2ee2f
--- /dev/null
+++ b/usr/src/man/man2/setsid.2
@@ -0,0 +1,90 @@
+'\" te
+.\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setsid 2 "21 Aug 2002" "SunOS 5.11" "System Calls"
+.SH NAME
+setsid \- create session and set process group ID
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBpid_t\fR \fBsetsid\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetsid()\fR function creates a new session, if the calling process is
+not a process group leader. Upon return the calling process will be the session
+leader of this new session, will be the process group leader of a new process
+group, and will have no controlling terminal. The process group \fBID\fR of
+the calling process will be set equal to the process \fBID\fR of the calling
+process. The calling process will be the only process in the new process group
+and the only process in the new session.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBsetsid()\fR returns the value of the process
+group \fBID\fR of the calling process. Otherwise it returns \fB(pid_t)\(mi1\fR
+and sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsetsid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 9n
+.rt
+The calling process is already a process group leader, or the process group
+\fBID\fR of a process other than the calling process matches the process
+\fBID\fR of the calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgetsid\fR(2), \fBsetpgid\fR(2), \fBsetpgrp\fR(2), \fBattributes\fR(5),
+\fBstandards\fR(5)
+.SH WARNINGS
+.sp
+.LP
+A call to \fBsetsid()\fR by a process that is a process group leader will fail.
+A process can become a process group leader by being the last member of a
+pipeline started by a job control shell. Thus, a process that expects to be
+part of a pipeline, and that calls \fBsetsid()\fR, should always first fork;
+the parent should exit and the child should call \fBsetsid()\fR. This will
+ensure that the calling process will work reliably when started by both job
+control shells and non-job control shells.
diff --git a/usr/src/man/man2/settaskid.2 b/usr/src/man/man2/settaskid.2
new file mode 100644
index 0000000000..92ea735323
--- /dev/null
+++ b/usr/src/man/man2/settaskid.2
@@ -0,0 +1,129 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH settaskid 2 "10 Apr 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+settaskid, gettaskid, getprojid \- set or get task or project IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/task.h>
+#include <unistd.h>
+
+\fBtaskid_t\fR \fBsettaskid\fR(\fBprojid_t\fR \fIproject\fR, \fBint\fR \fIflags\fR);
+.fi
+
+.LP
+.nf
+\fBtaskid_t\fR \fBgettaskid\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/task.h>
+#include <unistd.h>
+#include <project.h>
+
+\fBprojid_t\fR \fBgetprojid\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsettaskid()\fR function makes a request of the system to assign a new
+task \fBID\fR to the calling process, changing the associated project \fBID\fR
+to that specified. The calling process must have sufficient privileges to
+perform this operation. The \fIflags\fR argument should be either
+\fBTASK_NORMAL\fR for a regular task, or \fBTASK_FINAL\fR, which disallows
+subsequent \fBsettaskid()\fR calls by the created task.
+.sp
+.LP
+The \fBgettaskid()\fR function returns the task \fBID\fR of the calling
+process.
+.sp
+.LP
+The \fBgetprojid()\fR function returns the project \fBID\fR of the calling
+process.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, these functions return the appropriate task or
+project \fBID\fR. Otherwise, \(mi1 is returned and \fBerrno\fR is set to
+indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsettaskid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+The invoking task was created with the \fBTASK_FINAL\fR flag.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+A resource control limiting the number of tasks or LWPs in the current project
+or zone has been exceeded.
+.sp
+A resource control on the given project would be exceeded.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The given project \fBID\fR is not within the valid project \fBID\fR range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_PROC_TASKID\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsetsid\fR(2), \fBproject\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/setuid.2 b/usr/src/man/man2/setuid.2
new file mode 100644
index 0000000000..da5cfbfc85
--- /dev/null
+++ b/usr/src/man/man2/setuid.2
@@ -0,0 +1,144 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2003,Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH setuid 2 "20 Jan 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+setuid, setegid, seteuid, setgid \- set user and group IDs
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <unistd.h>
+
+\fBint\fR \fBsetuid\fR(\fBuid_t\fR \fIuid\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetgid\fR(\fBgid_t\fR \fIgid\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBseteuid\fR(\fBuid_t\fR \fIeuid\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsetegid\fR(\fBgid_t\fR \fIegid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsetuid()\fR function sets the real user ID, effective user ID, and saved
+user ID of the calling process. The \fBsetgid()\fR function sets the real group
+ID, effective group ID, and saved group ID of the calling process. The
+\fBsetegid()\fR and \fBseteuid()\fR functions set the effective group and user
+IDs respectively for the calling process. See \fBIntro\fR(2) for more
+information on real, effective, and saved user and group IDs.
+.sp
+.LP
+At login time, the real user ID, effective user ID, and saved user ID of the
+login process are set to the login ID of the user responsible for the creation
+of the process. The same is true for the real, effective, and saved group IDs;
+they are set to the group ID of the user responsible for the creation of the
+process.
+.sp
+.LP
+When a process calls one of the \fBexec\fR(2) family of functions to execute a
+file (program), the user and/or group identifiers associated with the process
+can change. If the file executed is a set-user-ID file, the effective and saved
+user IDs of the process are set to the owner of the file executed. If the file
+executed is a set-group-ID file, the effective and saved group IDs of the
+process are set to the group of the file executed. If the file executed is not
+a set-user-ID or set-group-ID file, the effective user \fBID\fR, saved user ID,
+effective group ID, and saved group ID are not changed.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is asserted in the effective set of
+the process calling \fBsetuid()\fR, the real, effective, and saved user IDs are
+set to the \fIuid\fR argument. If the \fIuid\fR argument is 0 and none of the
+saved, effective or real UID is 0, additional restrictions apply. See
+\fBprivileges\fR(5).
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set,
+but \fIuid\fR is either the real user ID or the saved user ID of the calling
+process, the effective user ID is set to \fIuid\fR.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is asserted in the effective set of
+the process calling \fBsetgid()\fR, the real, effective, and saved group IDs
+are set to the \fIgid\fR argument.
+.sp
+.LP
+If the {\fBPRIV_PROC_SETID\fR} privilege is not asserted in the effective set,
+but \fIgid\fR is either the real group ID or the saved group ID of the calling
+process, the effective group ID is set to \fIgid\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsetuid()\fR and \fBsetgid()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of \fIuid\fR or \fIgid\fR is out of range.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+For \fBsetuid()\fR and \fBseteuid()\fR, the {\fBPRIV_PROC_SETID\fR} privilege
+is not asserted in the effective set of the calling process and the \fIuid\fR
+argument does not match either the real or saved user IDs, or an attempt is
+made to change to UID 0 and none of the existing UIDs is 0, in which case
+additional privileges are required.
+.sp
+For \fBsetgid()\fR and \fBsetegid()\fR, the {\fBPRIV_PROC_SETID\fR} privilege
+is not asserted in the effective set and the \fIgid\fR argument does not match
+either the real or saved group IDs.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBexec\fR(2), \fBgetgroups\fR(2), \fBgetuid\fR(2),
+\fBstat.h\fR(3HEAD), \fBattributes\fR(5), \fBprivileges\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/shmctl.2 b/usr/src/man/man2/shmctl.2
new file mode 100644
index 0000000000..0011da9cf0
--- /dev/null
+++ b/usr/src/man/man2/shmctl.2
@@ -0,0 +1,240 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH shmctl 2 "10 Apr 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+shmctl \- shared memory control operations
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+\fBint\fR \fBshmctl\fR(\fBint\fR \fIshmid\fR, \fBint\fR \fIcmd\fR, \fBstruct shmid_ds *\fR\fIbuf\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBshmctl()\fR function provides a variety of shared memory control
+operations as specified by \fIcmd\fR. The permission required for a shared
+memory control operation is given as {\fItoken\fR}, where \fItoken\fR is the
+type of permission needed. The types of permission are interpreted as follows:
+.sp
+.in +2
+.nf
+00400 READ by user
+00200 WRITE by user
+00040 READ by group
+00020 WRITE by group
+00004 READ by others
+00002 WRITE by others
+.fi
+.in -2
+
+.sp
+.LP
+See the \fIShared Memory Operation Permissions\fR section of \fBIntro\fR(2) for
+more information.
+.sp
+.LP
+The following operations require the specified tokens:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_STAT\fR\fR
+.ad
+.RS 14n
+.rt
+Place the current value of each member of the data structure associated with
+\fIshmid\fR into the structure pointed to by \fIbuf\fR. The contents of this
+structure are defined in \fBIntro\fR(2). {\fBREAD\fR}
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_SET\fR\fR
+.ad
+.RS 14n
+.rt
+Set the value of the following members of the data structure associated with
+\fIshmid\fR to the corresponding value found in the structure pointed to by
+\fIbuf\fR:
+.sp
+.in +2
+.nf
+shm_perm.uid
+shm_perm.gid
+shm_perm.mode /* access permission bits only */
+.fi
+.in -2
+
+This command can be executed only by a process that has appropriate privileges
+or an effective user \fBID\fR equal to the value of \fBshm_perm.cuid\fR or
+\fBshm_perm.uid\fR in the data structure associated with \fIshmid\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBIPC_RMID\fR\fR
+.ad
+.RS 14n
+.rt
+Remove the shared memory identifier specified by \fIshmid\fR from the system.
+The segment referenced by the identifier will be destroyed when all processes
+with the segment attached have either detached the segment or exited. If the
+segment is not attached to any process when \fBIPC_RMID\fR is invoked, it will
+be destroyed immediately. This command can be executed only by a process that
+has appropriate privileges or an effective user ID equal to the value of
+\fBshm_perm.cuid\fR or \fBshm_perm.uid\fR in the data structure associated with
+\fIshmid\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHM_LOCK\fR\fR
+.ad
+.RS 14n
+.rt
+Lock the shared memory segment specified by \fIshmid\fR in memory. This command
+can be executed only by a process that has appropriate privileges.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSHM_UNLOCK\fR\fR
+.ad
+.RS 14n
+.rt
+Unlock the shared memory segment specified by \fIshmid\fR. This command can be
+executed only by a process that has appropriate privileges.
+.RE
+
+.sp
+.LP
+A shared memory segment must be explicitly removed using \fBIPC_RMID\fR before
+the system can deallocate it and the resources it uses.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBshmctl()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is equal to \fBIPC_STAT\fR and \fB{READ}\fR operation
+permission is denied to the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIshmid\fR argument is not a valid shared memory identifier; or the
+\fIcmd\fR argument is not a valid command or is \fBIPC_SET\fR and
+\fBshm_perm.uid\fR or \fBshm_perm.gid\fR is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is equal to \fBSHM_LOCK\fR and there is not enough
+memory, or the operation would exceed a limit or resource control on locked
+memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is \fBIPC_STAT\fR and \fIuid\fR or \fIgid\fR is too
+large to be stored in the structure pointed to by \fIbuf\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIcmd\fR argument is equal to \fBIPC_RMID\fR or \fBIPC_SET\fR, the
+effective user ID of the calling process is not equal to the value of
+\fBshm_perm.cuid\fR or \fBshm_perm.uid\fR in the data structure associated with
+\fIshmid\fR, and {\fBPRIV_IPC_OWNER\fR} is not asserted in the effective set of
+the calling process.
+.sp
+The \fIcmd\fR argument is equal to \fBSHM_LOCK\fR or \fBSHM_UNLOCK\fR and
+{\fBPRIV_PROC_LOCK_MEMORY\fR} is not asserted in the effective set of the
+calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcs\fR(1), \fBIntro\fR(2), \fBshmget\fR(2), \fBshmop\fR(2),
+\fBattributes\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/shmget.2 b/usr/src/man/man2/shmget.2
new file mode 100644
index 0000000000..682981f8d7
--- /dev/null
+++ b/usr/src/man/man2/shmget.2
@@ -0,0 +1,212 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH shmget 2 "14 Aug 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+shmget \- get shared memory segment identifier
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+\fBint\fR \fBshmget\fR(\fBkey_t\fR \fIkey\fR, \fBsize_t\fR \fIsize\fR, \fBint\fR \fIshmflg\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBshmget()\fR function returns the shared memory identifier associated
+with \fIkey\fR.
+.sp
+.LP
+A shared memory identifier and associated data structure and shared memory
+segment of at least \fIsize\fR bytes (see \fBIntro\fR(2)) are created for
+\fIkey\fR if one of the following are true:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The \fIkey\fR argument is equal to \fBIPC_PRIVATE\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The \fIkey\fR argument does not already have a shared memory identifier
+associated with it, and (\fIshmflg\fR\fB&IPC_CREAT\fR) is true.
+.RE
+.sp
+.LP
+Upon creation, the data structure associated with the new shared memory
+identifier is initialized as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The values of \fBshm_perm.cuid\fR, \fBshm_perm.uid\fR, \fBshm_perm.cgid\fR, and
+\fBshm_perm.gid\fR are set equal to the effective user \fBID\fR and effective
+group ID, respectively, of the calling process.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The access permission bits of \fBshm_perm.mode\fR are set equal to the access
+permission bits of \fIshmflg\fR. \fBshm_segsz\fR is set equal to the value of
+\fIsize\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The values of \fBshm_lpid\fR, \fBshm_nattch\fR \fBshm_atime\fR, and
+\fBshm_dtime\fR are set equal to 0.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The \fBshm_ctime\fR is set equal to the current time.
+.RE
+.sp
+.LP
+Shared memory segments must be explicitly removed after the last reference to
+them has been removed.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative integer representing a shared memory
+identifier is returned. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is
+set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBshmget()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+A shared memory identifier exists for \fIkey\fR but operation permission (see
+\fBIntro\fR(2)) as specified by the low-order 9 bits of \fIshmflg\fR would not
+be granted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 10n
+.rt
+A shared memory identifier exists for \fIkey\fR but both
+(\fIshmflg\fR\fB&IPC_CREAT\fR) and (\fIshmflg\fR\fB&IPC_EXCL\fR) are true.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsize\fR argument is less than the system-imposed minimum or greater than
+the system-imposed maximum. See NOTES.
+.sp
+A shared memory identifier exists for \fIkey\fR but the size of the segment
+associated with it is less than \fIsize\fR and \fIsize\fR is not equal to 0.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 10n
+.rt
+A shared memory identifier does not exist for \fIkey\fR and
+(\fIshmflg\fR\fB&IPC_CREAT\fR) is false.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+A shared memory identifier and associated shared memory segment are to be
+created but the amount of available memory is not sufficient to fill the
+request.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 10n
+.rt
+A shared memory identifier is to be created but the system-imposed limit on the
+maximum number of allowed shared memory identifiers system-wide would be
+exceeded. See NOTES.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBrctladm\fR(1M), \fBIntro\fR(2), \fBsetrctl\fR(2), \fBshmctl\fR(2),
+\fBshmop\fR(2), \fBftok\fR(3C), \fBgetpagesize\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The \fBproject.max-shm-memory\fR resource control restricts the total amount of
+shared memory a project can allocate. The \fBzone.max-shm-memory\fR resource
+control restricts the total amount of shared memory that can be allocated by a
+zone. The system-imposed maximum on the size of a shared memory segment is
+therefore a function of the sizes of any other shared memory segments the
+calling project might have allocated that are still in use, as well as any
+other shared memory segments allocated and still in use by processes in the
+zone. For accounting purposes, segment sizes are rounded up to the nearest
+multiple of the system page size. See \fBgetpagesize\fR(3C).
+.sp
+.LP
+The system-imposed limit on the number of shared memory identifiers is
+maintained on a per-project basis using the \fBproject.max-shm-ids\fR resource
+control. The \fBzone.max-shm-ids\fR resource control restricts the total number
+of shared memory identifiers that can be allocated by a zone.
+.sp
+.LP
+See \fBrctladm\fR(1M) and \fBsetrctl\fR(2) for information about using resource
+controls.
diff --git a/usr/src/man/man2/shmids.2 b/usr/src/man/man2/shmids.2
new file mode 100644
index 0000000000..3129cb4050
--- /dev/null
+++ b/usr/src/man/man2/shmids.2
@@ -0,0 +1,119 @@
+'\" te
+.\" Copyright (c) 2000, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH shmids 2 "8 Mar 2000" "SunOS 5.11" "System Calls"
+.SH NAME
+shmids \- discover all shared memory identifiers
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/shm.h>
+
+\fBint\fR \fBshmids\fR(\fBint *\fR\fIbuf\fR, \fBuint_t\fR \fInids\fR, \fBuint_t *\fR\fIpnids\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBshmids()\fR function copies all active shared memory identifiers from
+the system into the user-defined buffer specified by \fIbuf\fR, provided that
+the number of such identifiers is not greater than the number of integers the
+buffer can contain, as specified by \fInids\fR. If the size of the buffer is
+insufficient to contain all of the active shared memory identifiers in the
+system, none are copied.
+.sp
+.LP
+Whether or not the size of the buffer is sufficient to contain all of them, the
+number of active shared memory identifiers in the system is copied into the
+unsigned integer pointed to by \fIpnids\fR.
+.sp
+.LP
+If \fInids\fR is 0 or less than the number of active shared memory identifiers
+in the system, \fIbuf\fR is ignored.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBshmids()\fR returns \fB0\fR. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBshmids()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR or \fIpnids\fR argument points to an illegal address.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBshmids()\fR function returns a snapshot of all the active shared memory
+identifiers in the system. More may be added and some may be removed before
+they can be used by the caller.
+.SH EXAMPLES
+.LP
+\fBExample 1 \fR\fBshmids()\fR example
+.sp
+.LP
+This is sample C code indicating how to use the \fBshmids()\fR function.
+
+.sp
+.in +2
+.nf
+void
+examine_shmids()
+{
+ int *ids = NULL;
+ uint_t nids = 0;
+ uint_t n;
+ int i;
+
+ for (;;) {
+ if (shmids(ids, nids, &n) != 0) {
+ perror("shmids");
+ exit(1);
+ }
+ if (n <= nids) /* we got them all */
+ break;
+ /* we need a bigger buffer */
+ ids = realloc(ids, (nids = n) * sizeof (int));
+ }
+
+ for (i = 0; i < n; i++)
+ process_shmid(ids[i]);
+
+ free(ids);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBipcrm\fR(1), \fBipcs\fR(1), \fBIntro\fR(2), \fBshmctl\fR(2),
+\fBshmget\fR(2), \fBshmop\fR(2), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/shmop.2 b/usr/src/man/man2/shmop.2
new file mode 100644
index 0000000000..10a6cff4da
--- /dev/null
+++ b/usr/src/man/man2/shmop.2
@@ -0,0 +1,268 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH shmop 2 "10 Mar 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+shmop, shmat, shmdt \- shared memory operations
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/shm.h>
+
+\fBvoid *\fR\fBshmat\fR(\fBint\fR \fIshmid\fR, \fBconst void *\fR\fIshmaddr\fR, \fBint\fR \fIshmflg\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBshmdt\fR(\fBchar *\fR\fIshmaddr\fR);
+.fi
+
+.SS "Standard conforming"
+.LP
+.nf
+\fBint\fR \fBshmdt\fR(\fBconst void *\fR\fIshmaddr\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBshmat()\fR function attaches the shared memory segment associated with
+the shared memory identifier specified by \fIshmid\fR to the data segment of
+the calling process.
+.sp
+.LP
+The permission required for a shared memory control operation is given as
+{\fItoken\fR}, where \fItoken\fR is the type of permission needed. The types of
+permission are interpreted as follows:
+.sp
+.in +2
+.nf
+00400 READ by user
+00200 WRITE by user
+00040 READ by group
+00020 WRITE by group
+00004 READ by others
+00002 WRITE by others
+.fi
+.in -2
+
+.sp
+.LP
+See the \fIShared Memory Operation Permissions\fR section of \fBIntro\fR(2) for
+more information.
+.sp
+.LP
+For shared memory segments created with the \fBSHM_SHARE_MMU\fR or
+\fBSHM_PAGEABLE\fR flags, the default protections cannot be changed so as to
+prevent a single process from affecting other processes sharing the same shared
+segment.
+.sp
+.LP
+When (\fIshmflg\fR\fB&SHM_SHARE_MMU\fR) is true, virtual memory resources in
+addition to shared memory itself are shared among processes that use the same
+shared memory.
+.sp
+.LP
+When (\fIshmflg\fR\fB&SHM_PAGEABLE\fR) is true, virtual memory resources are
+shared and the dynamic shared memory (DISM) framework is created. The dynamic
+shared memory can be resized dynamically within the specified size in
+\fBshmget\fR(2). The DISM shared memory is pageable unless it is locked.
+.sp
+.LP
+The shared memory segment is attached to the data segment of the calling
+process at the address specified based on one of the following criteria:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIshmaddr\fR is equal to \fB(void *) 0\fR, the segment is attached to the
+first available address as selected by the system.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIshmaddr\fR is equal to \fB(void\fR \fB*)\fR \fB0\fR and (
+\fIshmflg\fR\fB&SHM_SHARE_MMU\fR\fI)\fR or (\fIshmflg\fR\fB&SHM_PAGEABLE\fR) is
+true, then the segment is attached to the first available suitably aligned
+address. When (\fIshmflg\fR\fB&SHM_SHARE_MMU\fR) or
+(\fIshmflg\fR\fB&SHM_PAGEABLE\fR) is set, however, the permission given by
+\fBshmget()\fR determines whether the segment is attached for reading or
+reading and writing.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIshmaddr\fR is not equal to \fB(void *) 0\fR and
+(\fIshmflg\fR\fB&SHM_RND\fR) is true, the segment is attached to the address
+given by (\fIshmaddr\fR\fB-\fR (\fIshmaddr\fR modulus \fBSHMLBA\fR)).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIshmaddr\fR is not equal to \fB(void *) 0\fR and
+(\fIshmflg\fR\fB&SHM_RND\fR) is false, the segment is attached to the address
+given by \fIshmaddr\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The segment is attached for reading if (\fIshmflg\fR\fB&SHM_RDONLY\fR) is true
+\fB{READ}\fR, otherwise it is attached for reading and writing
+\fB{READ/WRITE}\fR.
+.RE
+.sp
+.LP
+The \fBshmdt()\fR function detaches from the calling process's data segment the
+shared memory segment located at the address specified by \fIshmaddr\fR. If the
+application is standard-conforming (see \fBstandards\fR(5)), the \fIshmaddr\fR
+argument is of type \fBconst void *\fR. Otherwise it is of type \fBchar *\fR.
+.sp
+.LP
+Shared memory segments must be explicitly removed after the last reference to
+them has been removed.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBshmat()\fR returns the data segment start
+address of the attached shared memory segment; \fBshmdt()\fR returns \fB0\fR.
+Otherwise, \fB\(mi1\fR is returned, the shared memory segment is not attached,
+and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBshmat()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 10n
+.rt
+Operation permission is denied to the calling process (see \fBIntro\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIshmid\fR argument is not a valid shared memory identifier.
+.sp
+The \fIshmaddr\fR argument is not equal to 0, and the value of
+(\fIshmaddr\fR\fB-\fR (\fIshmaddr\fR modulus \fBSHMLBA\fR)) is an illegal
+address.
+.sp
+The \fIshmaddr\fR argument is not equal to 0, is an illegal address, and
+(\fIshmflg\fR\fB&SHM_RND\fR) is false.
+.sp
+The \fIshmaddr\fR argument is not equal to 0, is not properly aligned, and
+(\fIshmfg\fR\fB&SHM_SHARE_MMU\fR) is true.
+.sp
+\fBSHM_SHARE_MMU\fR is not supported in certain architectures.
+.sp
+Both (\fIshmflg\fR\fB&SHM_SHARE_MMU\fR) and \fI(shmflg\fR\fB&SHM_PAGEABLE\fR)
+are true.
+.sp
+(\fIshmflg\fR\fB&SHM_SHARE_MMU\fR) is true and the shared memory segment
+specified by \fBshmid()\fR had previously been attached by a call to
+\fBshmat()\fR in which (\fIshmflg\fR\fB&SHM_PAGEABLE\fR) was true.
+.sp
+(\fIshmflg\fR\fB&SHM_PAGEABLE\fR) is true and the shared memory segment
+specified by \fBshmid()\fR had previously been attached by a call to
+\fBshmat()\fR in which (\fIshmflg\fR\fB&SHM_SHARE_MMU\fR) was true.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEMFILE\fR\fR
+.ad
+.RS 10n
+.rt
+The number of shared memory segments attached to the calling process would
+exceed the system-imposed limit.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+The available data space is not large enough to accommodate the shared memory
+segment.
+.RE
+
+.sp
+.LP
+The \fBshmdt()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIshmaddr\fR argument is not the data segment start address of a shared
+memory segment.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+(\fIshmflg\fR\fB&SHM_SHARE_MMU\fR) is true and attaching to the shared memory
+segment would exceed a limit or resource control on locked memory.
+.RE
+
+.SH WARNINGS
+.sp
+.LP
+Using a fixed value for the \fIshmaddr\fR argument can adversely affect
+performance on certain platforms due to D-cache aliasing.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2), \fBshmctl\fR(2),
+\fBshmget\fR(2), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/sigaction.2 b/usr/src/man/man2/sigaction.2
new file mode 100644
index 0000000000..085f5473d0
--- /dev/null
+++ b/usr/src/man/man2/sigaction.2
@@ -0,0 +1,256 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sigaction 2 "23 Mar 2005" "SunOS 5.11" "System Calls"
+.SH NAME
+sigaction \- detailed signal management
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigaction\fR(\fBint\fR \fIsig\fR, \fBconst struct sigaction *restrict\fR \fIact\fR,
+ \fBstruct sigaction *restrict\fR \fIoact\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigaction()\fR function allows the calling process to examine or specify
+the action to be taken on delivery of a specific signal. See
+\fBsignal.h\fR(3HEAD) for an explanation of general signal concepts.
+.sp
+.LP
+The \fIsig\fR argument specifies the signal and can be assigned any of the
+signals specified in \fBsignal.h\fR(3HEAD) except \fBSIGKILL\fR and
+\fBSIGSTOP\fR.
+.sp
+.LP
+If the argument \fIact\fR is not \fINULL\fR, it points to a structure
+specifying the new action to be taken when delivering \fIsig\fR. If the
+argument \fIoact\fR is not \fINULL\fR, it points to a structure where the
+action previously associated with \fIsig\fR is to be stored on return from
+\fBsigaction()\fR.
+.sp
+.LP
+The \fBsigaction\fR structure includes the following members:
+.sp
+.in +2
+.nf
+void (*sa_handler)(\|);
+void (*sa_sigaction)(int, siginfo_t *, void *);
+sigset_t sa_mask;
+int sa_flags;
+.fi
+.in -2
+
+.sp
+.LP
+The storage occupied by \fBsa_handler\fR and \fBsa_sigaction\fR may overlap,
+and a standard-conforming application (see \fBstandards\fR(5)) must not use
+both simultaneously.
+.sp
+.LP
+The \fBsa_handler\fR member identifies the action to be associated with the
+specified signal, if the \fBSA_SIGINFO\fR flag (see below) is cleared in the
+\fBsa_flags\fR field of the sigaction structure. It may take any of the values
+specified in \fBsignal.h\fR(3HEAD) or that of a user specified signal handler.
+If the \fBSA_SIGINFO\fR flag is set in the \fBsa_flags\fR field, the
+\fBsa_sigaction\fR field specifies a signal-catching function.
+.sp
+.LP
+The \fBsa_mask\fR member specifies a set of signals to be blocked while the
+signal handler is active. On entry to the signal handler, that set of signals
+is added to the set of signals already being blocked when the signal is
+delivered. In addition, the signal that caused the handler to be executed will
+also be blocked, unless the \fBSA_NODEFER\fR flag has been specified.
+\fBSIGSTOP\fR and \fBSIGKILL\fR cannot be blocked (the system silently
+enforces this restriction).
+.sp
+.LP
+The \fBsa_flags\fR member specifies a set of flags used to modify the delivery
+of the signal. It is formed by a logical \fBOR\fR of any of the following
+values:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_ONSTACK\fR\fR
+.ad
+.RS 16n
+.rt
+If set and the signal is caught, and if the thread that is chosen to processes
+a delivered signal has an alternate signal stack declared with
+\fBsigaltstack\fR(2), then it will process the signal on that stack. Otherwise,
+the signal is delivered on the thread's normal stack.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_RESETHAND\fR\fR
+.ad
+.RS 16n
+.rt
+If set and the signal is caught, the disposition of the signal is reset to
+\fBSIG_DFL\fR and the signal will not be blocked on entry to the signal handler
+(\fBSIGILL\fR, \fBSIGTRAP\fR, and \fBSIGPWR\fR cannot be automatically reset
+when delivered; the system silently enforces this restriction).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_NODEFER\fR\fR
+.ad
+.RS 16n
+.rt
+If set and the signal is caught, the signal will not be automatically blocked
+by the kernel while it is being caught.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_RESTART\fR\fR
+.ad
+.RS 16n
+.rt
+If set and the signal is caught, functions that are interrupted by the
+execution of this signal's handler are transparently restarted by the system,
+namely \fBfcntl\fR(2), \fBioctl\fR(2), \fBwait\fR(3C), \fBwaitid\fR(2), and the
+following functions on slow devices like terminals: \fBgetmsg()\fR and
+\fBgetpmsg()\fR (see \fBgetmsg\fR(2)); \fBputmsg()\fR and \fBputpmsg()\fR (see
+\fBputmsg\fR(2)); \fBpread()\fR, \fBread()\fR, and \fBreadv()\fR (see
+\fBread\fR(2)); \fBpwrite()\fR, \fBwrite()\fR, and \fBwritev()\fR (see
+\fBwrite\fR(2)); \fBrecv()\fR, \fBrecvfrom()\fR, and \fBrecvmsg()\fR (see
+\fBrecv\fR(3SOCKET)); and \fBsend()\fR, \fBsendto()\fR, and \fBsendmsg()\fR
+(see \fBsend\fR(3SOCKET)). Otherwise, the function returns an \fBEINTR\fR
+error.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_SIGINFO\fR\fR
+.ad
+.RS 16n
+.rt
+If cleared and the signal is caught, \fIsig\fR is passed as the only argument
+to the signal-catching function. If set and the signal is caught, two
+additional arguments are passed to the signal-catching function. If the second
+argument is not equal to \fINULL\fR, it points to a \fBsiginfo_t\fR structure
+containing the reason why the signal was generated (see
+\fBsiginfo.h\fR(3HEAD)); the third argument points to a \fBucontext_t\fR
+structure containing the receiving process's context when the signal was
+delivered (see \fBucontext.h\fR(3HEAD)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_NOCLDWAIT\fR\fR
+.ad
+.RS 16n
+.rt
+If set and \fIsig\fR equals \fBSIGCHLD\fR, the system will not create zombie
+processes when children of the calling process exit. If the calling process
+subsequently issues a \fBwait\fR(3C), it blocks until all of the calling
+process's child processes terminate, and then returns \fB\(mi1\fR with
+\fBerrno\fR set to \fBECHILD\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSA_NOCLDSTOP\fR\fR
+.ad
+.RS 16n
+.rt
+If set and \fIsig\fR equals \fBSIGCHLD\fR, \fBSIGCHLD\fR will not be sent to
+the calling process when its child processes stop or continue.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, \fBerrno\fR is set to indicate the error, and no new signal handler
+is installed.
+.SH ERRORS
+.sp
+.LP
+The \fBsigaction()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of the \fIsig\fR argument is not a valid signal number or is equal to
+\fBSIGKILL\fR or \fBSIGSTOP\fR. In addition, if in a multithreaded process, it
+is equal to \fBSIGWAITING\fR, \fBSIGCANCEL\fR, or \fBSIGLWP\fR.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBkill\fR(1), \fBIntro\fR(2), \fBexit\fR(2), \fBfcntl\fR(2), \fBgetmsg\fR(2),
+\fBioctl\fR(2), \fBkill\fR(2), \fBpause\fR(2), \fBputmsg\fR(2), \fBread\fR(2),
+\fBsigaltstack\fR(2), \fBsigprocmask\fR(2), \fBsigsend\fR(2),
+\fBsigsuspend\fR(2), \fBwaitid\fR(2), \fBwrite\fR(2), \fBrecv\fR(3SOCKET),
+\fBsend\fR(3SOCKET), \fBsiginfo.h\fR(3HEAD), \fBsignal\fR(3C),
+\fBsignal.h\fR(3HEAD), \fBsigsetops\fR(3C), \fBucontext.h\fR(3HEAD),
+\fBwait\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The handler routine can be declared:
+.sp
+.in +2
+.nf
+void handler (int \fIsig\fR, siginfo_t *\fIsip\fR, ucontext_t *\fIucp\fR);
+.fi
+.in -2
+
+.sp
+.LP
+The \fIsig\fR argument is the signal number. The \fIsip\fR argument is a
+pointer (to space on the stack) to a \fBsiginfo_t\fR structure, which provides
+additional detail about the delivery of the signal. The \fIucp\fR argument is a
+pointer (again to space on the stack) to a \fBucontext_t\fR structure (defined
+in <\fBsys/ucontext.h\fR>) which contains the context from before the signal.
+It is not recommended that \fIucp\fR be used by the handler to restore the
+context from before the signal delivery.
diff --git a/usr/src/man/man2/sigaltstack.2 b/usr/src/man/man2/sigaltstack.2
new file mode 100644
index 0000000000..50e56186a2
--- /dev/null
+++ b/usr/src/man/man2/sigaltstack.2
@@ -0,0 +1,205 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sigaltstack 2 "1 Nov 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+sigaltstack \- set or get signal alternate stack context
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigaltstack\fR(\fBconst stack_t *restrict\fR \fIss\fR, \fBstack_t *restrict\fR \fIoss\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigaltstack()\fR function allows a thread to define and examine the
+state of an alternate stack area on which signals are processed. If \fIss\fR is
+non-zero, it specifies a pointer to and the size of a stack area on which to
+deliver signals, and informs the system whether the thread is currently
+executing on that stack. When a signal's action indicates its handler should
+execute on the alternate signal stack (specified with a \fBsigaction\fR(2)
+call), the system checks whether the thread chosen to execute the signal
+handler is currently executing on that stack. If the thread is not currently
+executing on the signal stack, the system arranges a switch to the alternate
+signal stack for the duration of the signal handler's execution.
+.sp
+.LP
+The \fBstack_t\fR structure includes the following members:
+.sp
+.in +2
+.nf
+int *ss_sp
+long ss_size
+int ss_flags
+.fi
+.in -2
+
+.sp
+.LP
+If \fIss\fR is not \fINULL\fR, it points to a structure specifying the
+alternate signal stack that will take effect upon successful return from
+\fBsigaltstack()\fR. The \fBss_sp\fR and \fBss_size\fR members specify the new
+base and size of the stack, which is automatically adjusted for direction of
+growth and alignment. The \fBss_flags\fR member specifies the new stack state
+and may be set to the following:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSS_DISABLE\fR\fR
+.ad
+.RS 14n
+.rt
+The stack is to be disabled and \fBss_sp\fR and \fBss_size\fR are ignored. If
+\fBSS_DISABLE\fR is not set, the stack will be enabled.
+.RE
+
+.sp
+.LP
+If \fIoss\fR is not \fINULL\fR, it points to a structure specifying the
+alternate signal stack that was in effect prior to the call to
+\fBsigaltstack()\fR. The \fBss_sp\fR and \fBss_size\fR members specify the base
+and size of that stack. The \fBss_flags\fR member specifies the stack's state,
+and may contain the following values:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSS_ONSTACK\fR\fR
+.ad
+.RS 14n
+.rt
+The thread is currently executing on the alternate signal stack. Attempts to
+modify the alternate signal stack while the thread is executing on it will
+fail.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSS_DISABLE\fR\fR
+.ad
+.RS 14n
+.rt
+The alternate signal stack is currently disabled.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is return. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsigaltstack()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIss\fR or \fIoss\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIss\fR argument is not a null pointer, and the \fBss_flags\fR member
+pointed to by \fIss\fR contains flags other than \fBSS_DISABLE\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+The size of the alternate stack area is less than \fBMINSIGSTKSZ\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+An attempt was made to modify an active stack.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBgetcontext\fR(2), \fBmmap\fR(2), \fBsigaction\fR(2),
+\fBucontext.h\fR(3HEAD), \fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The value \fBSIGSTKSZ\fR is defined to be the number of bytes that would be
+used to cover the usual case when allocating an alternate stack area. The
+value \fBMINSIGSTKSZ\fR is defined to be the minimum stack size for a signal
+handler. In computing an alternate stack size, a program should add that
+amount to its stack requirements to allow for the operating system overhead.
+.sp
+.LP
+The following code fragment is typically used to allocate an alternate stack
+with an adjacent red zone (an unmapped page) to guard against stack overflow,
+as with default stacks:
+.sp
+.in +2
+.nf
+#include <signal.h>
+#include <sys/mman.h>
+
+stack_t sigstk;
+sigstk.ss_sp = mmap(NULL, SIGSTKSZ, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+if (sigstk.ss_sp == MAP_FAILED)
+ /* error return */;
+sigstk.ss_size = SIGSTKSZ;
+sigstk.ss_flags = 0;
+if (sigaltstack(&sigstk, NULL) < 0)
+ perror("sigaltstack");
+.fi
+.in -2
+
diff --git a/usr/src/man/man2/sigpending.2 b/usr/src/man/man2/sigpending.2
new file mode 100644
index 0000000000..63a315b04a
--- /dev/null
+++ b/usr/src/man/man2/sigpending.2
@@ -0,0 +1,67 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sigpending 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+sigpending \- examine signals that are blocked and pending
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigpending\fR(\fBsigset_t *\fR\fIset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigpending()\fR function retrieves those signals that have been sent to
+the calling process but are being blocked from delivery by the calling
+process's signal mask. The signals are stored in the space pointed to by the
+\fIset\fR argument.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsigpending()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIset\fR argument points to an illegal address.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsigaction\fR(2), \fBsigprocmask\fR(2), \fBsigsetops\fR(3C),
+\fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/sigprocmask.2 b/usr/src/man/man2/sigprocmask.2
new file mode 100644
index 0000000000..4cb6f47a59
--- /dev/null
+++ b/usr/src/man/man2/sigprocmask.2
@@ -0,0 +1,115 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sigprocmask 2 "23 Mar 2005" "SunOS 5.11" "System Calls"
+.SH NAME
+sigprocmask \- change or examine caller's signal mask
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigprocmask\fR(\fBint\fR \fIhow\fR, \fBconst sigset_t *restrict\fR \fIset\fR,
+ \fBsigset_t *restrict\fR \fIoset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigprocmask()\fR function is used to examine and/or change the caller's
+signal mask. If the value is \fBSIG_BLOCK\fR, the set pointed to by the
+\fIset\fR argument is added to the current signal mask. If the value is
+\fBSIG_UNBLOCK\fR, the set pointed by the \fIset\fR argument is removed from
+the current signal mask. If the value is \fBSIG_SETMASK\fR, the current signal
+mask is replaced by the set pointed to by the \fIset\fR argument. If the
+\fIoset\fR argument is not \fINULL\fR, the previous mask is stored in the
+space pointed to by \fIoset\fR. If the value of the \fIset\fR argument is
+\fINULL\fR, the value \fIhow\fR is not significant and the caller's signal
+mask is unchanged; thus, the call can be used to inquire about currently
+blocked signals. If the \fIset\fR or \fIoset\fR argument points to an invalid
+address, the behavior is undefined and \fBerrno\fR may be set to \fBEFAULT\fR.
+.sp
+.LP
+If there are any pending unblocked signals after the call to
+\fBsigprocmask()\fR, at least one of those signals will be delivered before the
+call to \fBsigprocmask()\fR returns.
+.sp
+.LP
+It is not possible to block signals that cannot be caught or ignored (see
+\fBsigaction\fR(2)). It is also not possible to block or unblock SIGCANCEL, as
+SIGCANCEL is reserved for the implementation of POSIX thread cancellation (see
+\fBpthread_cancel\fR(3C) and \fBcancellation\fR(5)). This restriction is
+silently enforced by the standard C library.
+.sp
+.LP
+If \fBsigprocmask()\fR fails, the caller's signal mask is not changed.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsigprocmask()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The value of the \fIhow\fR argument is not equal to one of the defined values.
+.RE
+
+.sp
+.LP
+The \fBsigprocmask()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIset\fR or \fIoset\fR argument points to an illegal address.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsigaction\fR(2), \fBpthread_cancel\fR(3C), \fBpthread_sigmask\fR(3C),
+\fBsignal\fR(3C), \fBsignal.h\fR(3HEAD), \fBsigsetops\fR(3C),
+\fBattributes\fR(5), \fBcancellation\fR(5)
+.SH NOTES
+.sp
+.LP
+The call to \fBsigprocmask()\fR affects only the calling thread's signal mask.
+It is identical to a call to \fBpthread_sigmask\fR(3C).
+.sp
+.LP
+Signals that are generated synchronously should not be masked. If such a signal
+is blocked and delivered, the receiving process is killed.
diff --git a/usr/src/man/man2/sigsend.2 b/usr/src/man/man2/sigsend.2
new file mode 100644
index 0000000000..bfdf70ffef
--- /dev/null
+++ b/usr/src/man/man2/sigsend.2
@@ -0,0 +1,242 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sigsend 2 "19 Jul 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+sigsend, sigsendset \- send a signal to a process or a group of processes
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigsend\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBint\fR \fIsig\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsigsendset\fR(\fBprocset_t *\fR\fIpsp\fR, \fBint\fR \fIsig\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigsend()\fR function sends a signal to the process or group of
+processes specified by \fIid\fR and \fIidtype\fR. The signal to be sent is
+specified by \fIsig\fR and is either 0 or one of the values listed in
+\fBsignal.h\fR(3HEAD). If \fIsig\fR is 0 (the null signal), error checking is
+performed but no signal is actually sent. This value can be used to check the
+validity of \fIid\fR and \fIidtype\fR.
+.sp
+.LP
+The real or effective user \fBID\fR of the sending process must match the real
+or saved user ID of the receiving process, unless the {\fBPRIV_PROC_OWNER\fR}
+privilege is asserted in the effective set of the sending process or \fIsig\fR
+is \fBSIGCONT\fR and the sending process has the same session ID as the
+receiving process.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PID\fR, \fIsig\fR is sent to the process with process
+\fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PGID\fR, \fIsig\fR is sent to all processes with
+process group \fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_SID\fR, \fIsig\fR is sent to all processes with
+session \fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_TASKID\fR, \fIsig\fR is sent to all processes with
+task \fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_UID\fR, \fIsig\fR is sent to any process with
+effective user \fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_GID\fR, \fIsig\fR is sent to any process with
+effective group \fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_PROJID\fR, \fIsig\fR is sent to any process with
+project \fBID\fR \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_CID\fR, \fIsig\fR is sent to any process with
+scheduler class \fBID\fR \fIid\fR (see \fBpriocntl\fR(2)).
+.sp
+.LP
+If \fIidtype\fR is \fBP_CTID\fR, \fIsig\fR is sent to any process with process
+contract ID \fIid\fR.
+.sp
+.LP
+If \fIidtype\fR is \fBP_ALL\fR, \fIsig\fR is sent to all processes and
+\fIid\fR is ignored.
+.sp
+.LP
+If \fIid\fR is \fBP_MYID\fR, the value of \fIid\fR is taken from the calling
+process.
+.sp
+.LP
+The process with a process \fBID\fR of 0 is always excluded. The process with
+a process \fBID\fR of 1 is excluded unless \fIidtype\fR is equal to
+\fBP_PID\fR.
+.sp
+.LP
+The \fBsigsendset()\fR function provides an alternate interface for sending
+signals to sets of processes. This function sends signals to the set of
+processes specified by \fIpsp\fR. \fIpsp\fR is a pointer to a structure of type
+\fBprocset_t\fR, defined in <\fBsys/procset.h\fR>, which includes the following
+members:
+.sp
+.in +2
+.nf
+idop_t p_op;
+idtype_t p_lidtype;
+id_t p_lid;
+idtype_t p_ridtype;
+id_t p_rid;
+.fi
+.in -2
+
+.sp
+.LP
+The \fBp_lidtype\fR and \fBp_lid\fR members specify the \fBID\fR type and
+\fBID\fR of one ("left") set of processes; the \fBp_ridtype\fR and \fBp_rid\fR
+members specify the \fBID\fR type and \fBID\fR of a second ("right") set of
+processes. \fBID\fR types and \fBID\fRs are specified just as for the
+\fIidtype\fR and \fIid\fR arguments to \fBsigsend()\fR. The \fBp_op\fR member
+specifies the operation to be performed on the two sets of processes to get the
+set of processes the function is to apply to. The valid values for \fBp_op\fR
+and the processes they specify are:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_DIFF\fR\fR
+.ad
+.RS 12n
+.rt
+Set difference: processes in left set and not in right set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_AND\fR\fR
+.ad
+.RS 12n
+.rt
+Set intersection: processes in both left and right sets.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_OR\fR\fR
+.ad
+.RS 12n
+.rt
+Set union: processes in either left or right set or both.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBPOP_XOR\fR\fR
+.ad
+.RS 12n
+.rt
+Set exclusive-or: processes in left or right set but not in both.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is return. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsigsend()\fR and \fBsigsendset()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsig\fR argument is not a valid signal number, or the \fIidtype\fR
+argument is not a valid idtype field.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIsig\fR argument is \fBSIGKILL,\fR \fIidtype\fR is \fBP_PID\fR and
+\fIid\fR is \fB1\fR (proc1).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The effective user of the calling process does not match the real or saved user
+ID of the receiving process, the calling process does not have the
+{\fBPRIV_PROC_OWNER\fR} privilege asserted in the effective set, and the
+calling process is not sending \fBSIGCONT\fR to a process that shares the same
+session ID.
+.sp
+The calling process does not have the {\fBPRIV_PROC_SESSION\fR} privilege
+asserted and is trying to send a signal to a process with a different session
+ID, even though the effective user ID matches the real or saved ID of the
+receiving process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESRCH\fR\fR
+.ad
+.RS 10n
+.rt
+No process can be found corresponding to that specified by \fIid\fR and
+\fIidtype\fR.
+.RE
+
+.sp
+.LP
+The \fBsigsendset()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIpsp\fR argument points to an illegal address.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBkill\fR(1), \fBgetpid\fR(2), \fBkill\fR(2), \fBpriocntl\fR(2),
+\fBsignal\fR(3C), \fBsignal.h\fR(3HEAD), \fBprocess\fR(4), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/sigsuspend.2 b/usr/src/man/man2/sigsuspend.2
new file mode 100644
index 0000000000..abd0d95cdd
--- /dev/null
+++ b/usr/src/man/man2/sigsuspend.2
@@ -0,0 +1,109 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sigsuspend 2 "24 Jun 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+sigsuspend \- install a signal mask and suspend caller until signal
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigsuspend\fR(\fBconst sigset_t *\fR\fIset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigsuspend()\fR function replaces the caller's signal mask with the set
+of signals pointed to by the \fIset\fR argument and suspends the caller until
+delivery of a signal whose action is either to execute a signal catching
+function or to terminate the process. If the \fIset\fR argument points to an
+invalid address, the behavior is undefined and \fBerrno\fR may be set to
+\fBEFAULT\fR.
+.sp
+.LP
+If the action is to terminate the process, \fBsigsuspend()\fR does not return.
+If the action is to execute a signal catching function, \fBsigsuspend()\fR
+returns after the signal catching function returns. On return, the signal mask
+is restored to the set that existed before the call to \fBsigsuspend()\fR.
+.sp
+.LP
+It is not possible to block signals that cannot be ignored (see
+\fBsignal.h\fR(3HEAD)). This restriction is silently imposed by the system.
+.SH RETURN VALUES
+.sp
+.LP
+Since \fBsigsuspend()\fR suspends the caller's execution indefinitely, there is
+no successful completion return value. On failure, it returns \fB\(mi1\fR and
+sets \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsigsuspend()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 9n
+.rt
+A signal was caught by the caller and control was returned from the signal
+catching function.
+.RE
+
+.sp
+.LP
+The \fBsigsuspend()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIset\fR argument points to an illegal address.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsigaction\fR(2), \fBsigprocmask\fR(2), \fBsigwait\fR(2), \fBsignal\fR(3C),
+\fBsignal.h\fR(3HEAD), \fBsigsetops\fR(3C), \fBattributes\fR(5)
+.SH NOTES
+.sp
+.LP
+If the caller specifies more than one unblocked signal in the mask to
+\fBsigsuspend()\fR, more than one signal might be processed before the call to
+\fBsigsuspend()\fR returns.
+.sp
+.LP
+While the caller is executing the signal handler that interrupted its call to
+\fBsigsuspend()\fR, its signal mask is the one passed to \fBsigsuspend()\fR,
+modified as usual by the signal mask specification in the signal's
+\fBsigaction\fR(2) parameters. The caller's signal mask is not restored to its
+previous value until the caller returns from all the signal handlers that
+interrupted \fBsigsuspend()\fR.
diff --git a/usr/src/man/man2/sigwait.2 b/usr/src/man/man2/sigwait.2
new file mode 100644
index 0000000000..0477de92c1
--- /dev/null
+++ b/usr/src/man/man2/sigwait.2
@@ -0,0 +1,245 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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. 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. 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]
+.TH sigwait 2 "16 Apr 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+sigwait \- wait until a signal is posted
+.SH SYNOPSIS
+.LP
+.nf
+#include <signal.h>
+
+\fBint\fR \fBsigwait\fR(\fBsigset_t *\fR\fIset\fR);
+.fi
+
+.SS "Standard conforming"
+.LP
+.nf
+cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-D_POSIX_PTHREAD_SEMANTICS\fR [ \fIlibrary\fR...]
+#include <signal.h>
+
+\fBint\fR \fBsigwait\fR(\fBconst sigset_t *\fR\fIset\fR, \fBint *\fR\fIsig\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsigwait()\fR function selects a signal in \fIset\fR that is pending on
+the calling thread. If no signal in \fIset\fR is pending, \fBsigwait()\fR
+blocks until a signal in \fIset\fR becomes pending. The selected signal is
+cleared from the set of signals pending on the calling thread and the number of
+the signal is returned, or in the standard-conforming version (see
+\fBstandards\fR(5)) placed in \fIsig\fR. The selection of a signal in \fIset\fR
+is independent of the signal mask of the calling thread. This means a thread
+can synchronously wait for signals that are being blocked by the signal mask of
+the calling thread \&. To ensure that only the caller receives the signals
+defined in \fIset\fR, all threads should have signals in \fIset\fR masked
+including the calling thread.
+.sp
+.LP
+If more than one thread is using \fBsigwait()\fR to wait for the same signal,
+no more than one of these threads returns from \fBsigwait()\fR with the signal
+number. If more than a single thread is blocked in \fBsigwait()\fR for a signal
+when that signal is generated for the process, it is unspecified which of the
+waiting threads returns from \fBsigwait()\fR. If the signal is generated for a
+specific thread, as by \fBpthread_kill\fR(3C), only that thread returns.
+.sp
+.LP
+Should any of the multiple pending signals in the range \fBSIGRTMIN\fR to
+\fBSIGRTMAX\fR be selected, it will be the lowest numbered one. The selection
+order between realtime and non-realtime signals, or between multiple pending
+non-realtime signals, is unspecified.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the default version of \fBsigwait()\fR returns a
+signal number; the standard-conforming version returns \fB0\fR and stores the
+received signal number at the location pointed to by \fIsig\fR. Otherwise, the
+default version returns -1 and sets errno to indicate an error; the
+standard-conforming version returns an error number to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsigwait()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIset\fR argument points to an invalid address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+The wait was interrupted by an unblocked, caught signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIset\fR argument contains an unsupported signal number.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRCreating a thread to handle receipt of a signal
+.sp
+.LP
+The following sample C code creates a thread to handle the receipt of a signal.
+More specifically, it catches the asynchronously generated signal,
+\fBSIGINT\fR.
+
+.sp
+.in +2
+.nf
+/********************************************************************
+*
+* compile with -D_POSIX_PTHREAD_SEMANTICS switch;
+* required by sigwait()
+*
+* sigint thread handles delivery of signal. uses sigwait(\|) to wait
+* for SIGINT signal.
+*
+********************************************************************/
+#include <pthread.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+#include <synch.h>
+
+static void *threadTwo(void *);
+static void *threadThree(void *);
+static void *sigint(void *);
+
+sigset_t signalSet;
+
+void *
+main(void)
+{
+ pthread_t t;
+ pthread_t t2;
+ pthread_t t3;
+
+ sigfillset ( &signalSet );
+ /*
+ * Block signals in initial thread. New threads will
+ * inherit this signal mask.
+ */
+ pthread_sigmask ( SIG_BLOCK, &signalSet, NULL );
+
+ printf("Creating threads\en");
+
+ pthread_create(&t, NULL, sigint, NULL);
+ pthread_create(&t2, NULL, threadTwo, NULL);
+ pthread_create(&t3, NULL, threadThree, NULL);
+
+ printf("##################\en");
+ printf("press CTRL-C to deliver SIGINT to sigint thread\en");
+ printf("##################\en");
+
+ pthread_exit((void *)0);
+}
+static void *
+threadTwo(void *arg)
+{
+ printf("hello world, from threadTwo [tid: %d]\en",
+ pthread_self());
+ printf("threadTwo [tid: %d] is now complete and exiting\en",
+ pthread_self());
+ pthread_exit((void *)0);
+}
+
+static void *
+threadThree(void *arg)
+{
+ printf("hello world, from threadThree [tid: %d]\en",
+ pthread_self());
+ printf("threadThree [tid: %d] is now complete and exiting\en",
+ pthread_self());
+ pthread_exit((void *)0);
+}
+
+void *
+sigint(void *arg)
+{
+ int sig;
+ int err;
+
+ printf("thread sigint [tid: %d] awaiting SIGINT\en",
+ pthread_self());
+
+ /*
+ /* use standard-conforming sigwait() -- 2 args: signal set, signum
+ */
+ err = sigwait ( &signalSet, &sig );
+
+ /* test for SIGINT; could catch other signals */
+ if (err || sig != SIGINT)
+ abort();
+
+ printf("\enSIGINT signal %d caught by sigint thread [tid: %d]\en",
+ sig, pthread_self());
+ pthread_exit((void *)0);
+}
+.fi
+.in -2
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBsigaction\fR(2), \fBsigpending\fR(2), \fBsigprocmask\fR(2),
+\fBsigsuspend\fR(2), \fBpthread_create\fR(3C), \fBpthread_kill\fR(3C),
+\fBpthread_sigmask\fR(3C), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5),
+\fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+The \fBsigwait()\fR function cannot be used to wait for signals that cannot be
+caught (see \fBsigaction\fR(2)). This restriction is silently imposed by the
+system.
+.sp
+.LP
+Solaris 2.4 and earlier releases provided a \fBsigwait()\fR facility as
+specified in POSIX.1c Draft 6. The final POSIX.1c standard changed the
+interface as described above. Support for the Draft 6 interface is provided for
+compatibility only and may not be supported in future releases. New
+applications and libraries should use the standard-conforming interface.
diff --git a/usr/src/man/man2/stat.2 b/usr/src/man/man2/stat.2
new file mode 100644
index 0000000000..df24fda9dc
--- /dev/null
+++ b/usr/src/man/man2/stat.2
@@ -0,0 +1,699 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH stat 2 "10 Oct 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+stat, lstat, fstat, fstatat \- get file status
+.SH SYNOPSIS
+.LP
+.nf
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+\fBint\fR \fBstat\fR(\fBconst char *restrict\fR \fIpath\fR, \fBstruct stat *restrict\fR \fIbuf\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBlstat\fR(\fBconst char *restrict\fR \fIpath\fR, \fBstruct stat *restrict\fR \fIbuf\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfstat\fR(\fBint\fR \fIfildes\fR, \fBstruct stat *\fR\fIbuf\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfstatat\fR(\fBint\fR \fIfildes\fR, \fBconst char *\fR\fIpath\fR, \fBstruct stat *\fR\fIbuf\fR,
+ \fBint\fR \fIflag\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBstat()\fR function obtains information about the file pointed to by
+\fIpath\fR. Read, write, or execute permission of the named file is not
+required, but all directories listed in the path name leading to the file must
+be searchable.
+.sp
+.LP
+The \fBlstat()\fR function obtains file attributes similar to \fBstat()\fR,
+except when the named file is a symbolic link; in that case \fBlstat()\fR
+returns information about the link, while \fBstat()\fR returns information
+about the file the link references.
+.sp
+.LP
+The \fBfstat()\fR function obtains information about an open file known by the
+file descriptor \fIfildes\fR, obtained from a successful \fBopen\fR(2),
+\fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2), or \fBpipe\fR(2) function. If
+\fIfildes\fR references a shared memory object, the system updates in the
+\fBstat\fR structure pointed to by the \fIbuf\fR argument only the
+\fBst_uid\fR, \fBst_gid\fR, \fBst_size\fR, and \fBst_mode\fR fields, and only
+the \fBS_IRUSR\fR, \fBS_IWUSR\fR, \fBS_IRGRP\fR, \fBS_IWGRP\fR, \fBS_IROTH\fR,
+and \fBS_IWOTH\fR file permission bits need be valid. The system can update
+other fields and flags. The \fBfstat()\fR function updates any pending
+time-related fields before writing to the \fBstat\fR structure.
+.sp
+.LP
+The \fBfstatat()\fR function obtains file attributes similar to the
+\fBstat()\fR, \fBlstat()\fR, and \fBfstat()\fR functions. If the \fIpath\fR
+argument is a relative path, it is resolved relative to the \fIfildes\fR
+argument rather than the current working directory. If \fIpath\fR is absolute,
+the \fIfildes\fR argument is unused. If the \fIfildes\fR argument has the
+special value \fBAT_FDCWD\fR, relative paths are resolved from the current
+working directory. If \fBAT_SYMLINK_NOFOLLOW\fR is set in the \fIflag\fR
+argument, the function behaves like \fBlstat()\fR and does not automatically
+follow symbolic links. See \fBfsattr\fR(5). If \fB_ATTR_TRIGGER\fR is set in
+the \fIflag\fR argument and the vnode is a trigger mount point, the mount is
+performed and the function returns the attributes of the root of the mounted
+filesystem.
+.sp
+.LP
+The \fIbuf\fR argument is a pointer to a \fBstat\fR structure into which
+information is placed concerning the file. A \fBstat\fR structure includes the
+following members:
+.sp
+.in +2
+.nf
+mode_t st_mode; /* File mode (see mknod(2)) */
+ino_t st_ino; /* Inode number */
+dev_t st_dev; /* ID of device containing */
+ /* a directory entry for this file */
+dev_t st_rdev; /* ID of device */
+ /* This entry is defined only for */
+ /* char special or block special files */
+nlink_t st_nlink; /* Number of links */
+uid_t st_uid; /* User ID of the file's owner */
+gid_t st_gid; /* Group ID of the file's group */
+off_t st_size; /* File size in bytes */
+time_t st_atime; /* Time of last access */
+time_t st_mtime; /* Time of last data modification */
+time_t st_ctime; /* Time of last file status change */
+ /* Times measured in seconds since */
+ /* 00:00:00 UTC, Jan. 1, 1970 */
+long st_blksize; /* Preferred I/O block size */
+blkcnt_t st_blocks; /* Number of 512 byte blocks allocated*/
+char st_fstype[_ST_FSTYPSZ];
+ /* Null-terminated type of filesystem */
+.fi
+.in -2
+
+.sp
+.LP
+Descriptions of structure members are as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_mode\fR\fR
+.ad
+.RS 14n
+.rt
+The mode of the file as described for the \fBmknod()\fR function. In addition
+to the modes described on the \fBmknod\fR(2) manual page, the mode of a file
+can also be \fBS_IFSOCK\fR if the file is a socket, \fBS_IFDOOR\fR if the file
+is a door, \fBS_IFPORT\fR if the file is an event port, or \fBS_IFLNK\fR if the
+file is a symbolic link. \fBS_IFLNK\fR can be returned either by \fBlstat()\fR
+or by \fBfstat()\fR when the \fBAT_SYMLINK_NOFOLLOW\fR flag is set.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_ino\fR\fR
+.ad
+.RS 14n
+.rt
+This field uniquely identifies the file in a given file system. The pair
+\fBst_ino\fR and \fBst_dev\fR uniquely identifies regular files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_dev\fR\fR
+.ad
+.RS 14n
+.rt
+This field uniquely identifies the file system that contains the file. Its
+value may be used as input to the \fBustat()\fR function to determine more
+information about this file system. No other meaning is associated with this
+value.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_rdev\fR\fR
+.ad
+.RS 14n
+.rt
+This field should be used only by administrative commands. It is valid only for
+block special or character special files and only has meaning on the system
+where the file was configured.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_nlink\fR\fR
+.ad
+.RS 14n
+.rt
+This field should be used only by administrative commands.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_uid\fR\fR
+.ad
+.RS 14n
+.rt
+The user \fBID\fR of the file's owner.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_gid\fR\fR
+.ad
+.RS 14n
+.rt
+The group \fBID\fR of the file's group.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_size\fR\fR
+.ad
+.RS 14n
+.rt
+For regular files, this is the address of the end of the file. For block
+special or character special, this is not defined. See also \fBpipe\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_atime\fR\fR
+.ad
+.RS 14n
+.rt
+Time when file data was last accessed. Some of the functions that change this
+member are: \fBcreat()\fR, \fBmknod()\fR, \fBpipe()\fR, \fButime\fR(2), and
+\fBread\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_mtime\fR\fR
+.ad
+.RS 14n
+.rt
+Time when data was last modified. Some of the functions that change this member
+are: \fBcreat()\fR, \fBmknod()\fR, \fBpipe()\fR, \fButime()\fR, and
+\fBwrite\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_ctime\fR\fR
+.ad
+.RS 14n
+.rt
+Time when file status was last changed. Some of the functions that change this
+member are: \fBchmod\fR(2), \fBchown\fR(2), \fBcreat\fR(2), \fBlink\fR(2),
+\fBmknod\fR(2), \fBpipe\fR(2), \fBrename\fR(2), \fBunlink\fR(2),
+\fButime\fR(2), and \fBwrite\fR(2).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_blksize\fR\fR
+.ad
+.RS 14n
+.rt
+A hint as to the "best" unit size for I/O operations. This field is not defined
+for block special or character special files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_blocks\fR\fR
+.ad
+.RS 14n
+.rt
+The total number of physical blocks of size 512 bytes actually allocated on
+disk. This field is not defined for block special or character special files.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBst_fstype\fR\fR
+.ad
+.RS 14n
+.rt
+A null-teminated string that uniquely identifies the type of the filesystem
+that contains the file.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBstat()\fR, \fBfstat()\fR, \fBlstat()\fR, and \fBfstatat()\fR functions
+will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 13n
+.rt
+An error occurred while reading from the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The file size in bytes or the number of blocks allocated to the file or the
+file serial number cannot be represented correctly in the structure pointed to
+by \fIbuf\fR.
+.RE
+
+.sp
+.LP
+The \fBstat()\fR, \fBlstat()\fR, and \fBfstatat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIbuf\fR or \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBstat()\fR or \fBlstat()\fR
+function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+A loop exists in symbolic links encountered during the resolution of the
+\fIpath\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR}, or the length
+of a \fIpath\fR component exceeds {\fBNAME_MAX\fR} while \fB_POSIX_NO_TRUNC\fR
+is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of \fIpath\fR does not name an existing file or \fIpath\fR is an
+empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory, or the \fIfildes\fR argument
+does not refer to a valid directory when given a non-null relative path.
+.RE
+
+.sp
+.LP
+The \fBfstat()\fR and \fBfstatat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not a valid open file descriptor. The \fIfildes\fR
+argument to \fBfstatat()\fR can also have the valid value of \fBAT_FDCWD\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during the execution of the \fBfstat()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument points to a remote machine and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.LP
+The \fBstat()\fR, \fBfstat()\fR, and \fBlstat()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+One of the members is too large to store in the \fBstat\fR structure pointed to
+by \fIbuf\fR.
+.RE
+
+.sp
+.LP
+The \fBstat()\fR and \fBlstat()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+More than {\fBSYMLOOP_MAX\fR} symbolic links were encountered during the
+resolution of the \fIpath\fR argument.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+As a result of encountering a symbolic link in resolution of the\fIpath\fR
+argument, the length of the substituted pathname strings exceeds
+{\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.LP
+The \fBstat()\fR and \fBfstatat()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 9n
+.rt
+The \fIpath\fR argument names a character or block device special file and the
+corresponding I/O device has been retired by the fault management framework.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRUse \fBstat()\fR to obtain file status information.
+.sp
+.LP
+The following example shows how to obtain file status information for a file
+named \fB/home/cnd/mod1\fR. The structure variable buffer is defined for the
+\fBstat\fR structure.
+
+.sp
+.in +2
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+struct stat buffer;
+int status;
+\&...
+status = stat("/home/cnd/mod1", &buffer);
+.fi
+.in -2
+
+.LP
+\fBExample 2 \fRUse \fBstat()\fR to get directory information.
+.sp
+.LP
+The following example fragment gets status information for each entry in a
+directory. The call to the \fBstat()\fR function stores file information in the
+\fBstat\fR structure pointed to by \fIstatbuf\fR. The lines that follow the
+\fBstat()\fR call format the fields in the \fBstat\fR structure for
+presentation to the user of the program.
+
+.sp
+.in +2
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <pwd.h>
+#include <grp.h>
+#include <time.h>
+#include <locale.h>
+#include <langinfo.h>
+#include <stdio.h>
+#include <stdint.h>
+struct dirent *dp;
+struct stat statbuf;
+struct passwd *pwd;
+struct group *grp;
+struct tm *tm;
+char datestring[256];
+\&...
+/* Loop through directory entries */
+while ((dp = readdir(dir)) != NULL) {
+ /* Get entry's information. */
+ if (stat(dp->d_name, &statbuf) == -1)
+ continue;
+
+ /* Print out type, permissions, and number of links. */
+ printf("%10.10s", sperm (statbuf.st_mode));
+ printf("%4d", statbuf.st_nlink);
+
+ /* Print out owners name if it is found using getpwuid(). */
+ if ((pwd = getpwuid(statbuf.st_uid)) != NULL)
+ printf(" %-8.8s", pwd->pw_name);
+ else
+ printf(" %-8d", statbuf.st_uid);
+
+ /* Print out group name if it's found using getgrgid(). */
+ if ((grp = getgrgid(statbuf.st_gid)) != NULL)
+ printf(" %-8.8s", grp->gr_name);
+ else
+ printf(" %-8d", statbuf.st_gid);
+
+ /* Print size of file. */
+ printf(" %9jd", (intmax_t)statbuf.st_size);
+ tm = localtime(&statbuf.st_mtime);
+
+ /* Get localized date string. */
+ strftime(datestring, sizeof(datestring), nl_langinfo(D_T_FMT), tm);
+
+ printf(" %s %s\en", datestring, dp->d_name);
+ }
+.fi
+.in -2
+
+.LP
+\fBExample 3 \fRUse \fBfstat()\fR to obtain file status information.
+.sp
+.LP
+The following example shows how to obtain file status information for a file
+named \fB/home/cnd/mod1\fR. The structure variable buffer is defined for the
+\fBstat\fR structure. The \fB/home/cnd/mod1 file\fR is opened with read/write
+privileges and is passed to the open file descriptor \fIfildes\fR.
+
+.sp
+.in +2
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+struct stat buffer;
+int status;
+\&...
+fildes = open("/home/cnd/mod1", O_RDWR);
+status = fstat(fildes, &buffer);
+.fi
+.in -2
+
+.LP
+\fBExample 4 \fRUse \fBlstat()\fR to obtain symbolic link status information.
+.sp
+.LP
+The following example shows how to obtain status information for a symbolic
+link named \fB/modules/pass1\fR. The structure variable buffer is defined for
+the \fBstat\fR structure. If the \fIpath\fR argument specified the filename for
+the file pointed to by the symbolic link (\fB/home/cnd/mod1\fR), the results of
+calling the function would be the same as those returned by a call to the
+\fBstat()\fR function.
+
+.sp
+.in +2
+.nf
+#include <sys/stat.h>
+struct stat buffer;
+int status;
+\&...
+status = lstat("/modules/pass1", &buffer);
+.fi
+.in -2
+
+.SH USAGE
+.sp
+.LP
+If \fBchmod()\fR or \fBfchmod()\fR is used to change the file group owner
+permissions on a file with non-trivial ACL entries, only the ACL mask is set to
+the new permissions and the group owner permission bits in the file's mode
+field (defined in \fBmknod\fR(2)) are unchanged. A non-trivial ACL entry is
+one whose meaning cannot be represented in the file's mode field alone. The new
+ACL mask permissions might change the effective permissions for additional
+users and groups that have ACL entries on the file.
+.sp
+.LP
+The \fBstat()\fR, \fBfstat()\fR, and \fBlstat()\fR functions have transitional
+interfaces for 64-bit file offsets. See \fBlf64\fR(5).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+Standard See below.
+.TE
+
+.sp
+.LP
+For \fBstat()\fR, \fBfstat()\fR, and \fBlstat()\fR, see \fBstandards\fR(5).
+.SH SEE ALSO
+.sp
+.LP
+\fBaccess\fR(2), \fBchmod\fR(2), \fBchown\fR(2), \fBcreat\fR(2), \fBlink\fR(2),
+\fBmknod\fR(2), \fBpipe\fR(2), \fBread\fR(2), \fBtime\fR(2), \fBunlink\fR(2),
+\fButime\fR(2), \fBwrite\fR(2), \fBfattach\fR(3C), \fBstat.h\fR(3HEAD),
+\fBattributes\fR(5), \fBfsattr\fR(5), \fBlf64\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/statvfs.2 b/usr/src/man/man2/statvfs.2
new file mode 100644
index 0000000000..86e417de60
--- /dev/null
+++ b/usr/src/man/man2/statvfs.2
@@ -0,0 +1,294 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH statvfs 2 "22 Mar 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+statvfs, fstatvfs \- get file system information
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/statvfs.h>
+
+\fBint\fR \fBstatvfs\fR(\fBconst char *restrict\fR \fIpath\fR, \fBstruct statvfs *restrict\fR \fIbuf\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfstatvfs\fR(\fBint\fR \fIfildes\fR, \fBstruct statvfs *\fR\fIbuf\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBstatvfs()\fR function returns a "generic superblock" describing a file
+system; it can be used to acquire information about mounted file systems. The
+\fIbuf\fR argument is a pointer to a structure (described below) that is filled
+by the function.
+.sp
+.LP
+The \fIpath\fR argument should name a file that resides on that file system.
+The file system type is known to the operating system. Read, write, or execute
+permission for the named file is not required, but all directories listed in
+the path name leading to the file must be searchable.
+.sp
+.LP
+The \fBstatvfs\fR structure pointed to by \fIbuf\fR includes the following
+members:
+.sp
+.in +2
+.nf
+u_long f_bsize; /* preferred file system block size */
+u_long f_frsize; /* fundamental filesystem block
+ (size if supported) */
+fsblkcnt_t f_blocks; /* total # of blocks on file system
+ in units of f_frsize */
+fsblkcnt_t f_bfree; /* total # of free blocks */
+fsblkcnt_t f_bavail; /* # of free blocks avail to
+ non-privileged user */
+fsfilcnt_t f_files; /* total # of file nodes (inodes) */
+fsfilcnt_t f_ffree; /* total # of free file nodes */
+fsfilcnt_t f_favail; /* # of inodes avail to
+ non-privileged user*/
+u_long f_fsid; /* file system id (dev for now) */
+char f_basetype[FSTYPSZ]; /* target fs type name,
+ null-terminated */
+u_long f_flag; /* bit mask of flags */
+u_long f_namemax; /* maximum file name length */
+char f_fstr[32]; /* file system specific string */
+u_long f_filler[16]; /* reserved for future expansion */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBf_basetype\fR member contains a null-terminated FSType name of the
+mounted target.
+.sp
+.LP
+The following values can be returned in the \fBf_flag\fR field:
+.sp
+.in +2
+.nf
+ST_RDONLY 0x01 /* read-only file system */
+ST_NOSUID 0x02 /* does not support setuid/setgid semantics */
+ST_NOTRUNC 0x04 /* does not truncate file names longer than
+ NAME_MAX */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBfstatvfs()\fR function is similar to \fBstatvfs()\fR, except that the
+file named by \fIpath\fR in \fBstatvfs()\fR is instead identified by an open
+file descriptor \fIfildes\fR obtained from a successful \fBopen\fR(2),
+\fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2), or \fBpipe\fR(2) function call.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBstatvfs()\fR and \fBfstatvfs()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+One of the values to be returned cannot be represented correctly in the
+structure pointed to by \fIbuf\fR.
+.RE
+
+.sp
+.LP
+The \fBstatvfs()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied on a component of the path prefix.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR or \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBstatvfs()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of a \fIpath\fR component exceeds \fBNAME_MAX\fR characters, or the
+length of \fIpath\fR The exceeds \fBPATH_MAX\fR characters.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+Either a component of the path prefix or the file referred to by \fIpath\fR
+does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIpath\fR is not a directory.
+.RE
+
+.sp
+.LP
+The \fBfstatvfs()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is not an open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+A signal was caught during the execution of the \fBfstatvfs()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 10n
+.rt
+An I/O error occurred while reading the file system.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBstatvfs()\fR and \fBfstatvfs()\fR functions have transitional interfaces
+for 64-bit file offsets. See \fBlf64\fR(5).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBchmod\fR(2), \fBchown\fR(2), \fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2),
+\fBlink\fR(2), \fBmknod\fR(2), \fBopen\fR(2), \fBpipe\fR(2), \fBread\fR(2),
+\fBtime\fR(2), \fBunlink\fR(2), \fButime\fR(2), \fBwrite\fR(2),
+\fBattributes\fR(5), \fBlf64\fR(5), \fBstandards\fR(5)
+.SH BUGS
+.sp
+.LP
+The values returned for \fBf_files\fR, \fBf_ffree\fR, and \fBf_favail\fR may
+not be valid for \fBNFS\fR mounted file systems.
diff --git a/usr/src/man/man2/stime.2 b/usr/src/man/man2/stime.2
new file mode 100644
index 0000000000..ed53229a64
--- /dev/null
+++ b/usr/src/man/man2/stime.2
@@ -0,0 +1,58 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH stime 2 "22 Mar 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+stime \- set system time and date
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBstime\fR(\fBconst time_t *\fR\fItp\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBstime()\fR function sets the system's idea of the time and date. The
+\fItp\fR argument points to the value of time as measured in seconds from
+00:00:00 UTC January 1, 1970.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBstime()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fItp\fR argument points to an invalid (negative) value.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_TIME\fR} privilege is not asserted in the effective set of the
+calling process.
+.RE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBtime\fR(2), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/swapctl.2 b/usr/src/man/man2/swapctl.2
new file mode 100644
index 0000000000..2ad39ff122
--- /dev/null
+++ b/usr/src/man/man2/swapctl.2
@@ -0,0 +1,344 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH swapctl 2 "25 Sep 1997" "SunOS 5.11" "System Calls"
+.SH NAME
+swapctl \- manage swap space
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/stat.h>
+#include <sys/swap.h>
+
+\fBint\fR \fBswapctl\fR(\fBint\fR \fIcmd\fR, \fBvoid *\fR\fIarg\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBswapctl()\fR function adds, deletes, or returns information about swap
+resources. \fIcmd\fR specifies one of the following options contained in
+<\fBsys/swap.h\fR>:
+.sp
+.in +2
+.nf
+SC_ADD /* add a resource for swapping */
+SC_LIST /* list the resources for swapping */
+SC_REMOVE /* remove a resource for swapping */
+SC_GETNSWP /* return number of swap resources */
+.fi
+.in -2
+
+.sp
+.LP
+When \fBSC_ADD\fR or \fBSC_REMOVE\fR is specified, \fIarg\fR is a pointer to a
+\fBswapres\fR structure containing the following members:
+.sp
+.in +2
+.nf
+char *sr_name; /* pathname of resource */
+off_t sr_start; /* offset to start of swap area */
+off_t sr_length; /* length of swap area */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBsr_start\fR and \fBsr_length\fR members are specified in 512-byte
+blocks. A swap resource can only be removed by specifying the same values for
+the \fBsr_start\fR and \fBsr_length\fR members as were specified when it was
+added. Swap resources need not be removed in the order in which they were
+added.
+.sp
+.LP
+When \fBSC_LIST\fR is specified, \fIarg\fR is a pointer to a \fBswaptable\fR
+structure containing the following members:
+.sp
+.in +2
+.nf
+int swt_n; /* number of swapents following */
+struct swapent swt_ent[]; /* array of swt_n swapents */
+.fi
+.in -2
+
+.sp
+.LP
+A \fBswapent\fR structure contains the following members:
+.sp
+.in +2
+.nf
+char *ste_path; /* name of the swap file */
+off_t ste_start; /* starting block for swapping */
+off_t ste_length; /* length of swap area */
+long ste_pages; /* number of pages for swapping */
+long ste_free; /* number of ste_pages free */
+long ste_flags; /* ST_INDEL bit set if swap file */
+ /* is now being deleted */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBSC_LIST\fR function causes \fBswapctl()\fR to return at most \fBswt_n\fR
+entries. The return value of \fBswapctl()\fR is the number actually returned.
+The \fBST_INDEL\fR bit is turned on in \fBste_flags\fR if the swap file is in
+the process of being deleted.
+.sp
+.LP
+When \fBSC_GETNSWP\fR is specified, \fBswapctl()\fR returns as its value the
+number of swap resources in use. \fIarg\fR is ignored for this operation.
+.sp
+.LP
+The \fBSC_ADD\fR and \fBSC_REMOVE\fR functions will fail if calling process
+does not have appropriate privileges.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the function \fBswapctl()\fR returns a value of
+\fB0\fR for \fBSC_ADD\fR or \fBSC_REMOVE\fR, the number of \fBstruct\fR
+\fBswapent\fR entries actually returned for \fBSC_LIST\fR, or the number of
+swap resources in use for \fBSC_GETNSWP\fR. Upon failure, the function
+\fBswapctl()\fR returns a value of \fB\(mi1\fR and sets \fBerrno\fR to
+indicate an error.
+.SH ERRORS
+.sp
+.LP
+Under the following conditions, the function \fBswapctl()\fR fails and sets
+\fBerrno\fR to:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+Part of the range specified by \fBsr_start\fR and \fBsr_length\fR is already
+being used for swapping on the specified resource (\fBSC_ADD\fR).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+Either \fIarg\fR, \fBsr_name\fR, or \fBste_path\fR points to an illegal
+address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The specified function value is not valid, the path specified is not a swap
+resource (\fBSC_REMOVE\fR), part of the range specified by \fBsr_start\fR and
+\fBsr_length\fR lies outside the resource specified (\fBSC_ADD\fR), or the
+specified swap area is less than one page (\fBSC_ADD\fR).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEISDIR\fR\fR
+.ad
+.RS 16n
+.rt
+The path specified for \fBSC_ADD\fR is a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating the pathname provided
+to \fBSC_ADD\fR or \fBSC_REMOVE\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of a component of the path specified for \fBSC_ADD\fR or
+\fBSC_REMOVE\fR exceeds \fBNAME_MAX\fR characters or the length of the path
+exceeds \fBPATH_MAX\fR characters and \fB_POSIX_NO_TRUNC\fR is in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The pathname specified for \fBSC_ADD\fR or \fBSC_REMOVE\fR does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 16n
+.rt
+An insufficient number of \fBstruct\fR \fBswapent\fR structures were provided
+to \fBSC_LIST\fR, or there were insufficient system storage resources available
+during an \fBSC_ADD\fR or \fBSC_REMOVE\fR, or the system would not have enough
+swap space after an \fBSC_REMOVE\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSYS\fR\fR
+.ad
+.RS 16n
+.rt
+The pathname specified for \fBSC_ADD\fR or \fBSC_REMOVE\fR is not a file or
+block special device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+Pathname provided to \fBSC_ADD\fR or \fBSC_REMOVE\fR contained a component in
+the path prefix that was not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The {\fBPRIV_SYS_MOUNT\fR} was not asserted in the effective set of the calling
+process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The pathname specified for \fBSC_ADD\fR is a read-only file system.
+.RE
+
+.sp
+.LP
+Additionally, the \fBswapctl()\fR function will fail for 32-bit interfaces if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+The amount of swap space configured on the machine is too large to be
+represented by a 32-bit quantity.
+.RE
+
+.SH EXAMPLES
+.LP
+\fBExample 1 \fRThe usage of the \fBSC_GETNSWP\fR and \fBSC_LIST\fR commands.
+.sp
+.LP
+The following example demonstrates the usage of the \fBSC_GETNSWP\fR and
+\fBSC_LIST\fR commands.
+
+.sp
+.in +2
+.nf
+#include <sys/stat.h>
+#include <sys/swap.h>
+#include <stdio.h>
+
+#define MAXSTRSIZE 80
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ swaptbl_t *s;
+ int i, n, num;
+ char *strtab; /* string table for path names */
+
+again:
+ if ((num = swapctl(SC_GETNSWP, 0)) == -1) {
+ perror("swapctl: GETNSWP");
+ exit(1);
+ }
+ if (num == 0) {
+ fprintf(stderr, "No Swap Devices Configured\en");
+ exit(2);
+ }
+ /* allocate swaptable for num+1 entries */
+ if ((s = (swaptbl_t *)
+ malloc(num * sizeof(swapent_t) +
+ sizeof(struct swaptable))) ==
+ (void *) 0) {
+ fprintf(stderr, "Malloc Failed\en");
+ exit(3);
+ }
+ /* allocate num+1 string holders */
+ if ((strtab = (char *)
+ malloc((num + 1) * MAXSTRSIZE)) == (void *) 0) {
+ fprintf(stderr, "Malloc Failed\en");
+ exit(3);
+ }
+ /* initialize string pointers */
+ for (i = 0; i < (num + 1); i++) {
+ s->swt_ent[i].ste_path = strtab + (i * MAXSTRSIZE);
+ }
+
+ s->swt_n = num + 1;
+ if ((n = swapctl(SC_LIST, s)) < 0) {
+ perror("swapctl");
+ exit(1);
+ }
+ if (n > num) { /* more were added */
+ free(s);
+ free(strtab);
+ goto again;
+ }
+ for (i = 0; i < n; i++)
+ printf("%s %ld\en",
+ s->swt_ent[i].ste_path, s->swt_ent[i].ste_pages);
+}
+.fi
+.in -2
+
+.SH SEE ALSO
+.sp
+.LP
+\fBprivileges\fR(5)
diff --git a/usr/src/man/man2/symlink.2 b/usr/src/man/man2/symlink.2
new file mode 100644
index 0000000000..3cc3df4ccb
--- /dev/null
+++ b/usr/src/man/man2/symlink.2
@@ -0,0 +1,219 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH symlink 2 "18 May 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+symlink \- make a symbolic link to a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBsymlink\fR(\fBconst char *\fR\fIname1\fR, \fBconst char *\fR\fIname2\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsymlink()\fR function creates a symbolic link \fIname2\fR to the file
+\fIname1\fR. Either name may be an arbitrary pathname, the files need not be on
+the same file system, and \fIname1\fR may be nonexistent.
+.sp
+.LP
+The file to which the symbolic link points is used when an \fBopen\fR(2)
+operation is performed on the link. A \fBstat()\fR operation performed on a
+symbolic link returns the linked-to file, while an \fBlstat()\fR operation
+returns information about the link itself. See \fBstat\fR(2). Unexpected
+results may occur when a symbolic link is made to a directory. To avoid
+confusion in applications, the \fBreadlink\fR(2) call can be used to read the
+contents of a symbolic link.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, \fBerrno\fR is set to indicate the error, and the symbolic link is
+not made.
+.SH ERRORS
+.sp
+.LP
+The \fBsymlink()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the path prefix of \fIname2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 16n
+.rt
+The directory where the entry for the new symbolic link is being placed cannot
+be extended because the user's quota of disk blocks on that file system has
+been exhausted; the new symbolic link cannot be created because the user's
+quota of disk blocks on that file system has been exhausted; or the user's
+quota of inodes on the file system where the file is being created has been
+exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEEXIST\fR\fR
+.ad
+.RS 16n
+.rt
+The file referred to by \fIname2\fR already exists.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIname1\fR or \fIname2\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The path argument includes non-UTF8 characters and the file system accepts only
+file names where all characters are part of the UTF-8 character codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurs while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links are encountered in translating \fIname2\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIname2\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIname2\fR component exceeds \fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is
+in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIname2\fR does not exist.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 16n
+.rt
+The directory in which the entry for the new symbolic link is being placed
+cannot be extended because no space is left on the file system containing the
+directory; the new symbolic link cannot be created because no space is left on
+the file system which will contain the link; or there are no free inodes on the
+file system on which the file is being created.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSYS\fR\fR
+.ad
+.RS 16n
+.rt
+The file system does not support symbolic links.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix of \fIname2\fR is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The file \fIname2\fR would reside on a read-only file system.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBcp\fR(1), \fBlink\fR(2), \fBopen\fR(2), \fBreadlink\fR(2), \fBstat\fR(2),
+\fBunlink\fR(2), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/sync.2 b/usr/src/man/man2/sync.2
new file mode 100644
index 0000000000..42022980d6
--- /dev/null
+++ b/usr/src/man/man2/sync.2
@@ -0,0 +1,54 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sync 2 "5 Jul 1990" "SunOS 5.11" "System Calls"
+.SH NAME
+sync \- update super block
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBvoid\fR \fBsync\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsync()\fR function writes all information in memory that should be on
+disk, including modified super blocks, modified inodes, and delayed block I/O.
+.sp
+.LP
+Unlike \fBfsync\fR(3C), which completes the writing before it returns,
+\fBsync()\fR schedules but does not necessarily complete the writing before
+returning.
+.SH USAGE
+.sp
+.LP
+The \fBsync()\fR function should be used by applications that examine a file
+system, such as \fBfsck\fR(1M), and \fBdf\fR(1M), and is mandatory before
+rebooting.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBdf\fR(1M), \fBfsck\fR(1M), \fBfsync\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/sysfs.2 b/usr/src/man/man2/sysfs.2
new file mode 100644
index 0000000000..7e079fb49f
--- /dev/null
+++ b/usr/src/man/man2/sysfs.2
@@ -0,0 +1,140 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sysfs 2 "5 Jul 1990" "SunOS 5.11" "System Calls"
+.SH NAME
+sysfs \- get file system type information
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/fstyp.h>
+#include <sys/fsid.h>
+
+\fBint\fR \fBsysfs\fR(\fBint\fR \fIopcode\fR, \fBconst char *\fR\fIfsname\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsysfs\fR(\fBint\fR \fIopcode\fR, \fBint\fR \fIfs_index\fR, \fBchar *\fR\fIbuf\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBsysfs\fR(\fBint\fR \fIopcode\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsysfs()\fR function returns information about the file system types
+configured in the system. The number of arguments accepted by \fBsysfs()\fR
+depends on the \fIopcode\fR argument, which can take the following values:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETFSIND\fR\fR
+.ad
+.RS 13n
+.rt
+Translate \fIfsname\fR, a null-terminated file-system type identifier, into a
+file-system type index.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETFSTYP\fR\fR
+.ad
+.RS 13n
+.rt
+Translate \fIfs_index\fR, a file-system type index, into a null-terminated
+file-system type identifier and write it into the buffer pointed to by
+\fIbuf\fR, which must be at least of size \fBFSTYPSZ\fR as defined in
+<\fBsys/fstyp.h\fR>.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETNFSTYP\fR\fR
+.ad
+.RS 13n
+.rt
+Return the total number of file system types configured in the system.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the value returned depends upon the \fIopcode\fR
+argument as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETFSIND\fR\fR
+.ad
+.RS 13n
+.rt
+the file-system type index
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETFSTYP\fR\fR
+.ad
+.RS 13n
+.rt
+\fB0\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBGETNFSTYP\fR\fR
+.ad
+.RS 13n
+.rt
+the number of file system types configured
+.RE
+
+.sp
+.LP
+Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBsysfs()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR or \fIfsname\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfsname\fR argument points to an invalid file-system identifier; the
+\fIfs_index\fR argument is 0 or invalid; or the \fIopcode\fR argument is
+invalid.
+.RE
+
diff --git a/usr/src/man/man2/sysinfo.2 b/usr/src/man/man2/sysinfo.2
new file mode 100644
index 0000000000..a62d1f7c61
--- /dev/null
+++ b/usr/src/man/man2/sysinfo.2
@@ -0,0 +1,379 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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.
+.\" 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.
+.\" 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]
+.TH sysinfo 2 "29 Jan 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+sysinfo \- get and set system information strings
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/systeminfo.h>
+
+\fBint\fR \fBsysinfo\fR(\fBint\fR \fIcommand\fR, \fBchar *\fR\fIbuf\fR, \fBlong\fR \fIcount\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBsysinfo()\fR function copies information relating to the operating
+system on which the process is executing into the buffer pointed to by
+\fIbuf\fR. It can also set certain information where appropriate commands are
+available. The \fIcount\fR parameter indicates the size of the buffer.
+.sp
+.LP
+The POSIX P1003.1 interface (see \fBstandards\fR(5)) \fBsysconf\fR(3C) provides
+a similar class of configuration information, but returns an integer rather
+than a string.
+.sp
+.LP
+The values for \fIcommand\fR are as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_SYSNAME\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR the string that would be returned
+by \fBuname\fR(2) in the \fIsysname\fRfield. This is the name of the
+implementation of the operating system, for example, \fBSunOS\fR or \fBUTS\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_HOSTNAME\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string that names the present
+host machine. This is the string that would be returned by \fBuname()\fR in the
+\fInodename\fRfield. This hostname or nodename is often the name the machine is
+known by locally. The \fIhostname\fR is the name of this machine as a node in
+some network. Different networks might have different names for the node, but
+presenting the nodename to the appropriate network directory or name-to-address
+mapping service should produce a transport end point address. The name might
+not be fully qualified. Internet host names can be up to \fB256\fR bytes in
+length (plus the terminating null).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_SET_HOSTNAME\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy the null-terminated contents of the array pointed to by \fIbuf\fR into the
+string maintained by the kernel whose value will be returned by succeeding
+calls to \fBsysinfo()\fR with the command \fBSI_HOSTNAME\fR. This command
+requires that {\fBPRIV_SYS_ADMIN\fR} is asserted in the effective set of the
+calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_RELEASE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR the string that would be returned
+by \fBuname\fR(2) in the \fIrelease\fR field. Typical values might be \fB5.2\fR
+or \fB4.1\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_VERSION\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR the string that would be returned
+by \fBuname\fR(2) in the \fIversion\fRfield. The syntax and semantics of this
+string are defined by the system provider.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_MACHINE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR the string that would be returned
+by \fBuname\fR(2) in the \fImachine\fR field, for example, \fBsun4u\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_ARCHITECTURE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the basic
+instruction set architecture of the current system, for example, \fBsparc\fR,
+\fBmc68030\fR, \fBm32100\fR, or \fBi386\fR. These names might not match
+predefined names in the C language compilation system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_ARCHITECTURE_64\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the 64-bit
+instruction set architecture of the current system, for example, \fBsparcv9\fR
+or \fBamd64\fR. These names might not match predefined names in the C language
+compilation system. This subcode is not recognized on systems that do not
+allow a 64-bit application to run.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_ARCHITECTURE_32\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the 32-bit
+instruction set architecture of the current system, for example, \fBsparc\fR or
+\fBi386\fR. These names might not match predefined names in the C language
+compilation system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_ARCHITECTURE_K\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the kernel
+instruction set architecture of the current system for example \fBsparcv9\fR or
+\fBi386\fR. These names might not match predefined names in the C language
+compilation system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_ARCHITECTURE_NATIVE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the native
+instruction set architecture of the current system, for example \fBsparcv9\fR
+or \fBi386\fR. These names might not match predefined names in the C language
+compilation system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_ISALIST\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR the names of the variant
+instruction set architectures executable on the current system.
+.sp
+The names are space-separated and are ordered in the sense of best performance.
+That is, earlier-named instruction sets might contain more instructions than
+later-named instruction sets; a program that is compiled for an earlier-named
+instruction set will most likely run faster on this machine than the same
+program compiled for a later-named instruction set.
+.sp
+Programs compiled for an instruction set that does not appear in the list will
+most likely experience performance degradation or not run at all on this
+machine.
+.sp
+The instruction set names known to the system are listed in \fBisalist\fR(5);
+these names might not match predefined names or compiler options in the C
+language compilation system.
+.sp
+This command is obsolete and might be removed in a future release. See
+\fBgetisax\fR(2) and the \fILinker and Libraries Guide\fR for a better way to
+handle instruction set extensions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_PLATFORM\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the specific
+model of the hardware platform, for example, \fBSUNW,Sun-Blade-1500\fR,
+\fBSUNW,Sun-Fire-T200\fR, or \fBi86pc\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_HW_PROVIDER\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copies the name of the hardware manufacturer into the array pointed to by
+\fIbuf\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_HW_SERIAL\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string which is the ASCII
+representation of the hardware-specific serial number of the physical machine
+on which the function is executed. This might be implemented in Read-Only
+Memory, using software constants set when building the operating system, or by
+other means, and might contain non-numeric characters. If the function is
+executed within a non-global zone that emulates a host identifier, then the
+ASCII representation of the zone's host identifier is copied into the array
+pointed to by \fIbuf\fR. It is anticipated that manufacturers will not issue
+the same "serial number" to more than one physical machine. The pair of strings
+returned by \fBSI_HW_PROVIDER\fR and \fBSI_HW_SERIAL\fR is not guaranteed to be
+unique across all vendor's SVR4 implementations and could change over the
+lifetime of a given system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_SRPC_DOMAIN\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copies the Secure Remote Procedure Call domain name into the array pointed to
+by \fIbuf\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_SET_SRPC_DOMAIN\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set the string to be returned by \fBsysinfo()\fR with the \fBSI_SRPC_DOMAIN\fR
+command to the value contained in the array pointed to by \fIbuf\fR. This
+command requires that {\fBPRIV_SYS_ADMIN\fR} is asserted in the effective set
+of the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBSI_DHCP_CACHE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR an ASCII string consisting of the
+ASCII hexidecimal encoding of the name of the interface configured by
+\fBboot\fR(1M) followed by the DHCPACK reply from the server. This command is
+intended for use only by the \fBdhcpagent\fR(1M) DHCP client daemon for the
+purpose of adopting the DHCP maintenance of the interface configured by
+\fBboot\fR.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the value returned indicates the buffer size in
+bytes required to hold the complete value and the terminating null character.
+If this value is no greater than the value passed in \fIcount\fR, the entire
+string was copied. If this value is greater than \fIcount\fR, the string copied
+into \fIbuf\fR has been truncated to \fIcount\fR\(mi1 bytes plus a terminating
+null character.
+.sp
+.LP
+Otherwise, \(mi1 is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBsysinfo()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR argument does not point to a valid address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIcount\fR argument for a non-SET command is less than 0 or the data for a
+SET command exceeds the limits established by the implementation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+The {\fBPRIV_SYS_ADMIN\fR} was not asserted in the effective set of the calling
+process.
+.RE
+
+.SH USAGE
+.sp
+.LP
+In many cases there is no corresponding programming interface to set these
+values; such strings are typically settable only by the system administrator
+modifying entries in the \fB/etc/system\fR directory or the code provided by
+the particular OEM reading a serial number or code out of read-only memory, or
+hard-coded in the version of the operating system.
+.sp
+.LP
+A good estimation for \fIcount\fR is 257, which is likely to cover all strings
+returned by this interface in typical installations.
+.SH SEE ALSO
+.sp
+.LP
+\fBboot\fR(1M), \fBdhcpagent\fR(1M), \fBgetisax\fR(2), \fBuname\fR(2),
+\fBgethostid\fR(3C), \fBgethostname\fR(3C), \fBsysconf\fR(3C),
+\fBisalist\fR(5), \fBprivileges\fR(5), \fBstandards\fR(5), \fBzones\fR(5)
+.sp
+.LP
+\fILinker and Libraries Guide\fR
diff --git a/usr/src/man/man2/time.2 b/usr/src/man/man2/time.2
new file mode 100644
index 0000000000..b83999fd31
--- /dev/null
+++ b/usr/src/man/man2/time.2
@@ -0,0 +1,55 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH time 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+time \- get time
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <time.h>
+
+\fBtime_t\fR \fBtime\fR(\fBtime_t *\fR\fItloc\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBtime()\fR function returns the value of time in seconds since 00:00:00
+UTC, January 1, 1970.
+.sp
+.LP
+If \fItloc\fR is non-zero, the return value is also stored in the location to
+which \fItloc\fR points. If \fItloc\fR points to an illegal address,
+\fBtime()\fR fails and its actions are undefined.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBtime()\fR returns the value of time. Otherwise,
+\fB(time_t)\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBstime\fR(2), \fBctime\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/times.2 b/usr/src/man/man2/times.2
new file mode 100644
index 0000000000..8dd857282c
--- /dev/null
+++ b/usr/src/man/man2/times.2
@@ -0,0 +1,109 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH times 2 "14 May 1997" "SunOS 5.11" "System Calls"
+.SH NAME
+times \- get process and child process times
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/times.h>
+#include <limits.h>
+
+\fBclock_t\fR \fBtimes\fR(\fBstruct tms *\fR\fIbuffer\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBtimes()\fR function fills the \fBtms\fR structure pointed to by
+\fIbuffer\fR with time-accounting information. The \fBtms\fR structure, defined
+in \fB<sys/times.h>\fR, contains the following members:
+.sp
+.in +2
+.nf
+clock_t tms_utime;
+clock_t tms_stime;
+clock_t tms_cutime;
+clock_t tms_cstime;
+.fi
+.in -2
+
+.sp
+.LP
+All times are reported in clock ticks. The specific value for a clock tick is
+defined by the variable \fBCLK_TCK\fR, found in the header <\fBlimits.h\fR>.
+.sp
+.LP
+The times of a terminated child process are included in the \fBtms_cutime\fR
+and \fBtms_cstime\fR members of the parent when \fBwait\fR(3C) or
+\fBwaitpid\fR(3C) returns the process \fBID\fR of this terminated child. If a
+child process has not waited for its children, their times will not be included
+in its times.
+.sp
+.LP
+The \fBtms_utime\fR member is the \fBCPU\fR time used while executing
+instructions in the user space of the calling process.
+.sp
+.LP
+The \fBtms_stime\fR member is the \fBCPU\fR time used by the system on behalf
+of the calling process.
+.sp
+.LP
+The \fBtms_cutime\fR member is the sum of the \fBtms_utime\fR and the
+\fBtms_cutime\fR of the child processes.
+.sp
+.LP
+The \fBtms_cstime\fR member is the sum of the \fBtms_stime\fR and the
+\fBtms_cstime\fR of the child processes.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBtimes()\fR returns the elapsed real time, in
+clock ticks, since an arbitrary point in the past (for example, system start-up
+time). This point does not change from one invocation of \fBtimes()\fR within
+the process to another. The return value may overflow the possible range of
+type \fBclock_t\fR. If \fBtimes()\fR fails, \fB(clock_t)\(mi1\fR is returned
+and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBtimes()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuffer\fR argument points to an illegal address.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBtime\fR(1), \fBtimex\fR(1), \fBexec\fR(2), \fBfork\fR(2), \fBtime\fR(2),
+\fBwaitid\fR(2), \fBwait\fR(3C), \fBwaitpid\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/uadmin.2 b/usr/src/man/man2/uadmin.2
new file mode 100644
index 0000000000..a38a011636
--- /dev/null
+++ b/usr/src/man/man2/uadmin.2
@@ -0,0 +1,424 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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. 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. 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]
+.TH uadmin 2 "25 Mar 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+uadmin \- administrative control
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/uadmin.h>
+
+\fBint\fR \fBuadmin\fR(\fBint\fR \fIcmd\fR, \fBint\fR \fIfcn\fR, \fBuintptr_t\fR \fImdep\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBuadmin()\fR function provides control for basic administrative
+functions. This function is tightly coupled to the system administrative
+procedures and is not intended for general use. The argument \fImdep\fR is
+provided for machine-dependent use and is not defined here. It should be
+initialized to \fINULL\fR if not used.
+.sp
+.LP
+As specified by \fIcmd\fR, the following commands are available:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SHUTDOWN\fR\fR
+.ad
+.RS 14n
+.rt
+The system is shut down. All user processes are killed, the buffer cache is
+flushed, and the root file system is unmounted. The action to be taken after
+the system has been shut down is specified by \fIfcn\fR. The functions are
+generic; the hardware capabilities vary on specific machines.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_HALT\fR\fR
+.ad
+.RS 17n
+.rt
+Halt the processor(s).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_POWEROFF\fR\fR
+.ad
+.RS 17n
+.rt
+Halt the processor(s) and turn off the power.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_BOOT\fR\fR
+.ad
+.RS 17n
+.rt
+Reboot the system, using the kernel file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_IBOOT\fR\fR
+.ad
+.RS 17n
+.rt
+Interactive reboot; user is prompted for bootable program name.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_FASTREBOOT\fR\fR
+.ad
+.RS 17n
+.rt
+Bypass BIOS and boot loader
+.RE
+
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_REBOOT\fR\fR
+.ad
+.RS 14n
+.rt
+The system stops immediately without any further processing. The action to be
+taken next is specified by \fIfcn\fR as above.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_DUMP\fR\fR
+.ad
+.RS 14n
+.rt
+The system is forced to panic immediately without any further processing and a
+crash dump is written to the dump device (see \fBdumpadm\fR(1M)). The action
+to be taken next is specified by \fIfcn\fR, as above.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_REMOUNT\fR\fR
+.ad
+.RS 14n
+.rt
+The root file system is mounted again after having been fixed. This should be
+used only during the startup process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_FREEZE\fR\fR
+.ad
+.RS 14n
+.rt
+Suspend the whole system. The system state is preserved in the state file. The
+following subcommands, specified by \fIfcn\fR, are available.
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_SUSPEND_TO_DISK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Save the system state to the state file. This subcommand is equivalent to ACPI
+state S4.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_CHECK_SUSPEND_TO_DISK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Check if your system supports suspend to disk. Without performing a system
+suspend/resume, this subcommand checks if this feature is currently available
+on your system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_SUSPEND_TO_RAM\fR\fR
+.ad
+.sp .6
+.RS 4n
+Save the system state to memory This subcommand is equivalent to ACPI state S3.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_CHECK_SUSPEND_TO_RAM\fR\fR
+.ad
+.sp .6
+.RS 4n
+Check if your system supports suspend to memory. Without performing a system
+suspend/resume, this subcommand checks if this feature is currently available
+on your system.
+.RE
+
+The following subcommands, specified by \fIfcn\fR, are obsolete and might be
+removed in a subsequent release:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_COMPRESS\fR\fR
+.ad
+.sp .6
+.RS 4n
+Save the system state to the state file with compression of data. This
+subcommand has been replaced by \fBAD_SUSPEND_TO_DISK\fR, which should be used
+instead.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_CHECK\fR\fR
+.ad
+.sp .6
+.RS 4n
+Check if your system supports suspend and resume. Without performing a system
+suspend/resume, this command checks if this feature is currently available on
+your system. This subcommand has been replaced by
+\fBAD_CHECK_SUSPEND_TO_DISK\fR, which should be used instead.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBAD_FORCE\fR\fR
+.ad
+.sp .6
+.RS 4n
+Force \fBAD_COMPRESS\fR even when threads of user applications are not
+suspendable. This subcommand should never be used, as it might result in
+undefined behavior.
+.RE
+
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, the value returned depends on \fIcmd\fR as follows:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_SHUTDOWN\fR\fR
+.ad
+.RS 14n
+.rt
+Never returns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_REBOOT\fR\fR
+.ad
+.RS 14n
+.rt
+Never returns.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_FREEZE\fR\fR
+.ad
+.RS 14n
+.rt
+\fB0\fR upon resume.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBA_REMOUNT\fR\fR
+.ad
+.RS 14n
+.rt
+\fB0\fR.
+.RE
+
+.sp
+.LP
+Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the
+error.
+.SH ERRORS
+.sp
+.LP
+The \fBuadmin()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 11n
+.rt
+Suspend is already in progress.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIcmd\fR argument is invalid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 11n
+.rt
+Suspend/resume ran out of physical memory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 11n
+.rt
+Suspend/resume could not allocate enough space on the root file system to store
+system information.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+Suspend/resume is not supported on this platform or the command specified by
+\fIcmd\fR is not allowed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 11n
+.rt
+Unable to successfully suspend system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 11n
+.rt
+The {\fBPRIV_SYS_CONFIG\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilitySee below.
+.TE
+
+.sp
+.LP
+The \fBA_FREEZE\fR command and its subcommands are Committed.
+.SH SEE ALSO
+.sp
+.LP
+\fBdumpadm\fR(1M), \fBhalt\fR(1M), \fBkernel\fR(1M), \fBreboot\fR(1M),
+\fBuadmin\fR(1M), \fBattributes\fR(5), \fBprivileges\fR(5)
+.SH WARNINGS
+.sp
+.LP
+Shutting down or halting the system by means of \fBuadmin\fR(1M) does not
+update the boot archive. Avoid using this command after
+.RS +4
+.TP
+.ie t \(bu
+.el o
+editing of files such as \fB/etc/system\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+installing new driver binaries or kernel binaries
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+updating existing driver binaries or kernel binaries.
+.RE
+.sp
+.LP
+Use \fBreboot\fR(1M) or \fBhalt\fR(1M) instead.
diff --git a/usr/src/man/man2/ulimit.2 b/usr/src/man/man2/ulimit.2
new file mode 100644
index 0000000000..00b04e52ff
--- /dev/null
+++ b/usr/src/man/man2/ulimit.2
@@ -0,0 +1,150 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH ulimit 2 "1 Feb 2003" "SunOS 5.11" "System Calls"
+.SH NAME
+ulimit \- get and set process limits
+.SH SYNOPSIS
+.LP
+.nf
+#include <ulimit.h>
+
+\fBlong\fR \fBulimit\fR(\fBint\fR \fIcmd\fR, \fB/*\fR \fInewlimit\fR */...);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBulimit()\fR function provides for control over process limits. It is
+effective in limiting the growth of regular files. Pipes are limited to
+\fBPIPE_MAX\fR bytes.
+.sp
+.LP
+The \fIcmd\fR values, defined in <\fBulimit.h\fR>, include:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUL_GETFSIZE\fR\fR
+.ad
+.RS 15n
+.rt
+Return the soft file size limit of the process. The limit is in units of
+512-byte blocks and is inherited by child processes. Files of any size can be
+read. The return value is the integer part of the soft file size limit divided
+by 512. If the result cannot be represented as a \fBlong int\fR, the result is
+unspecified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUL_SETFSIZE\fR\fR
+.ad
+.RS 15n
+.rt
+Set the hard and soft file size limits for output operations of the process to
+the value of the second argument, taken as a \fBlong int\fR. Any process may
+decrease its own hard limit, but only a process with appropriate privileges may
+increase the limit. The new file size limit is returned. The hard and soft file
+size limits are set to the specified value multiplied by 512. If the result
+would overflow an \fBrlimit_t\fR, the actual value set is unspecified.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUL_GMEMLIM\fR\fR
+.ad
+.RS 15n
+.rt
+Get the maximum possible break value (see \fBbrk\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBUL_GDESLIM\fR\fR
+.ad
+.RS 15n
+.rt
+Get the current value of the maximum number of open files per process
+configured in the system.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBulimit()\fR returns the value of the requested
+limit. Otherwise, \fB\(mi1\fR is returned, the limit is not changed, and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBulimit()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIcmd\fR argument is not valid.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 10n
+.rt
+A process that has not asserted {\fBPRIV_SYS_RESOURCE\fR} in its effective set
+is trying to increase its file size limit.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Since all return values are permissible in a successful situation, an
+application wishing to check for error situations should set \fBerrno\fR to 0,
+then call \fBulimit()\fR, and if it returns \fB\(mi1\fR, check if \fBerrno\fR
+is non-zero.
+.sp
+.LP
+The \fBgetrlimit()\fR and \fBsetrlimit()\fR functions provide a more general
+interface for controlling process limits, and are preferred over
+\fBulimit()\fR. See \fBgetrlimit\fR(2).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBbrk\fR(2), \fBgetrlimit\fR(2), \fBwrite\fR(2), \fBattributes\fR(5),
+\fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/umask.2 b/usr/src/man/man2/umask.2
new file mode 100644
index 0000000000..06bd79f838
--- /dev/null
+++ b/usr/src/man/man2/umask.2
@@ -0,0 +1,54 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH umask 2 "28 Dec 1996" "SunOS 5.11" "System Calls"
+.SH NAME
+umask \- set and get file creation mask
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <sys/stat.h>
+
+\fBmode_t\fR \fBumask\fR(\fBmode_t\fR \fIcmask\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBumask()\fR function sets the process's file mode creation mask to
+\fIcmask\fR and returns the previous value of the mask. Only the access
+permission bits of \fIcmask\fR and the file mode creation mask are used. The
+mask is inherited by child processes. See \fBIntro\fR(2) for more information
+on masks.
+.SH RETURN VALUES
+.sp
+.LP
+The previous value of the file mode creation mask is returned.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBmkdir\fR(1), \fBsh\fR(1), \fBIntro\fR(2), \fBchmod\fR(2), \fBcreat\fR(2),
+\fBmknod\fR(2), \fBopen\fR(2), \fBstat.h\fR(3HEAD), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/umount.2 b/usr/src/man/man2/umount.2
new file mode 100644
index 0000000000..a7f64379c1
--- /dev/null
+++ b/usr/src/man/man2/umount.2
@@ -0,0 +1,235 @@
+'\" te
+.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH umount 2 "4 Aug 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+umount, umount2 \- unmount a file system
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/mount.h>
+
+\fBint\fR \fBumount\fR(\fBconst char *\fR\fIfile\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBumount2\fR(\fBconst char *\fR\fIfile\fR, \fBint\fR \fImflag\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBumount()\fR function requests that a previously mounted file system
+contained on a block special device or directory be unmounted. The \fIfile\fR
+argument is a pointer to the absolute pathname of the file system to be
+unmounted. After unmounting the file system, the directory upon which the file
+system was mounted reverts to its ordinary interpretation.
+.sp
+.LP
+The \fBumount2()\fR function is identical to \fBumount()\fR, with the
+additional capability of unmounting file systems even if there are open files
+active. The \fImflag\fR argument must contain one of the following values:
+.sp
+.ne 2
+.mk
+.na
+\fB0\fR
+.ad
+.RS 12n
+.rt
+Perform a normal unmount that is equivalent to \fBumount()\fR. The
+\fBumount2()\fR function returns \fBEBUSY\fR if there are open files active
+within the file system to be unmounted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBMS_FORCE\fR\fR
+.ad
+.RS 12n
+.rt
+Unmount the file system, even if there are open files active. A forced unmount
+can result in loss of data, so it should be used only when a regular unmount is
+unsuccessful. The \fBumount2()\fR function returns \fBENOTSUP\fR if the
+specified file systems does not support \fBMS_FORCE\fR. Only file systems of
+type \fBnfs\fR, \fBufs\fR, \fBpcfs\fR, and \fBzfs\fR support \fBMS_FORCE\fR.
+.RE
+
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBumount()\fR and \fBumount2()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+The permission bits of the mount point do not permit read/write access or
+search permission is denied on a component of the path prefix.
+.sp
+The calling process is not the owner of the mountpoint.
+.sp
+The mountpoint is not a regular file or a directory and the caller does not
+have all privileges available in a its zone.
+.sp
+The special device device does not permit read access in the case of read-only
+mounts or read-write access in the case of read/write mounts.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 16n
+.rt
+A file on \fIfile\fR is busy.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The file pointed to by \fIfile\fR points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The file pointed to by \fIfile\fR is not mounted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating the path pointed to by
+\fIfile\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIfile\fR argument exceeds \fIPATH_MAX\fR, or the length of
+a \fIfile\fR component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is
+in effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The file pointed to by \fIfile\fR does not exist or is not an absolute path.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The file pointed to by \fIfile\fR is on a remote machine and the link to that
+machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTBLK\fR\fR
+.ad
+.RS 16n
+.rt
+The file pointed to by \fIfile\fR is not a block special device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The {\fBPRIV_SYS_MOUNT\fR} privilege is not asserted in the effective set of
+the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEREMOTE\fR\fR
+.ad
+.RS 16n
+.rt
+The file pointed to by \fIfile\fR is remote.
+.RE
+
+.sp
+.LP
+The \fBumount2()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTSUP\fR\fR
+.ad
+.RS 11n
+.rt
+The file pointed to by \fIfile\fR does not support this operation.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBumount()\fR and \fBumount2()\fR functions can be invoked only by a
+process that has the {\fBPRIV_SYS_MOUNT\fR} privilege asserted in its effective
+set.
+.sp
+.LP
+Because it provides greater functionality, the \fBumount2()\fR function is
+preferred.
+.SH SEE ALSO
+.sp
+.LP
+\fBmount\fR(2), \fBprivileges\fR(5)
diff --git a/usr/src/man/man2/uname.2 b/usr/src/man/man2/uname.2
new file mode 100644
index 0000000000..29344755c1
--- /dev/null
+++ b/usr/src/man/man2/uname.2
@@ -0,0 +1,88 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 1999, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH uname 2 "21 Jul 1999" "SunOS 5.11" "System Calls"
+.SH NAME
+uname \- get name of current operating system
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/utsname.h>
+
+\fBint\fR \fBuname\fR(\fBstruct utsname *\fR\fIname\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBuname()\fR function stores information identifying the current operating
+system in the structure pointed to by \fIname\fR.
+.sp
+.LP
+The \fBuname()\fR function uses the \fButsname\fR structure, defined in
+<\fBsys/utsname.h\fR>, whose members include:
+.sp
+.in +2
+.nf
+char sysname[SYS_NMLN];
+char nodename[SYS_NMLN];
+char release[SYS_NMLN];
+char version[SYS_NMLN];
+char machine[SYS_NMLN];
+.fi
+.in -2
+
+.sp
+.LP
+The \fBuname()\fR function returns a null-terminated character string naming
+the current operating system in the character array \fBsysname\fR. Similarly,
+the \fBnodename\fR member contains the name by which the system is known on a
+communications network. The \fBrelease\fR and \fBversion\fR members further
+identify the operating system. The \fBmachine\fR member contains a standard
+name that identifies the hardware on which the operating system is running.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, a non-negative value is returned. Otherwise,
+\fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBuname()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIname\fR argument points to an illegal address.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBuname\fR(1), \fBsysinfo\fR(2), \fBsysconf\fR(3C), \fBattributes\fR(5),
+\fBstandards\fR(5)
diff --git a/usr/src/man/man2/unlink.2 b/usr/src/man/man2/unlink.2
new file mode 100644
index 0000000000..a1459f9fd4
--- /dev/null
+++ b/usr/src/man/man2/unlink.2
@@ -0,0 +1,301 @@
+'\" te
+.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH unlink 2 "18 May 2007" "SunOS 5.11" "System Calls"
+.SH NAME
+unlink, unlinkat \- remove directory entry
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBint\fR \fBunlink\fR(\fBconst char *\fR\fIpath\fR);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBunlinkat\fR(\fBint\fR \fIdirfd\fR, \fBconst char *\fR\fIpath\fR, \fBint\fR \fIflag\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBunlink()\fR function removes a link to a file. If \fIpath\fR names a
+symbolic link, \fBunlink()\fR removes the symbolic link named by \fIpath\fR and
+does not affect any file or directory named by the contents of the symbolic
+link. Otherwise, \fBunlink()\fR removes the link named by the pathname pointed
+to by \fIpath\fR and decrements the link count of the file referenced by the
+link.
+.sp
+.LP
+The \fBunlinkat()\fR function also removes a link to a file. See
+\fBfsattr\fR(5). If the \fIflag\fR argument is 0, the behavior of
+\fBunlinkat()\fR is the same as \fBunlink()\fR except in the processing of its
+\fIpath\fR argument. If \fIpath\fR is absolute, \fBunlinkat()\fR behaves the
+same as \fBunlink()\fR and the \fIdirfd\fR argument is unused. If \fIpath\fR is
+relative and \fIdirfd\fR has the value \fBAT_FDCWD\fR, defined in
+<\fBfcntl.h\fR>, \fBunlinkat()\fR also behaves the same as \fBunlink()\fR.
+Otherwise, \fIpath\fR is resolved relative to the directory referenced by the
+\fIdirfd\fR argument.
+.sp
+.LP
+If the \fIflag\fR argument is set to the value \fBAT_REMOVEDIR\fR, defined in
+<\fBfcntl.h\fR>, \fBunlinkat()\fR behaves the same as \fBrmdir\fR(2) except in
+the processing of the \fIpath\fR argument as described above.
+.sp
+.LP
+When the file's link count becomes 0 and no process has the file open, the
+space occupied by the file will be freed and the file is no longer accessible.
+If one or more processes have the file open when the last link is removed, the
+link is removed before \fBunlink()\fR or \fBunlinkat()\fR returns, but the
+removal of the file contents is postponed until all references to the file are
+closed.
+.sp
+.LP
+If the \fIpath\fR argument is a directory and the filesystem supports
+\fBunlink()\fR and \fBunlinkat()\fR on directories, the directory is unlinked
+from its parent with no cleanup being performed. In UFS, the disconnected
+directory will be found the next time the filesystem is checked with
+\fBfsck\fR(1M). The \fBunlink()\fR and \fBunlinkat()\fR functions will not fail
+simply because a directory is not empty. The user with appropriate privileges
+can orphan a non-empty directory without generating an error message.
+.sp
+.LP
+If the \fIpath\fR argument is a directory and the filesystem does not support
+\fBunlink()\fR and \fBunlink()\fR on directories (for example, ZFS), the call
+will fail with \fBerrno\fR set to \fBEPERM\fR.
+.sp
+.LP
+Upon successful completion, \fBunlink()\fR and \fBunlinkat()\fR will mark for
+update the \fBst_ctime\fR and \fBst_mtime\fR fields of the parent directory.
+If the file's link count is not 0, the \fBst_ctime\fR field of the file will be
+marked for update.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, \fBerrno\fR is set to indicate the error, and the file is not
+unlinked.
+.SH ERRORS
+.sp
+.LP
+The \fBunlink()\fR and \fBunlinkat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied for a component of the \fIpath\fR prefix, or write
+permission is denied on the directory containing the link to be removed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+The parent directory has the sticky bit set and the file is not writable by the
+user, the user does not own the parent directory, the user does not own the
+file, and the user is not a privileged user.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBUSY\fR\fR
+.ad
+.RS 16n
+.rt
+The entry to be unlinked is the mount point for a mounted file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEILSEQ\fR\fR
+.ad
+.RS 16n
+.rt
+The path argument includes non-UTF8 characters and the file system accepts only
+file names where all characters are part of the UTF-8 character codeset.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fBunlink()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fBPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fBNAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The named file does not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the \fIpath\fR prefix is not a directory or the provided
+directory descriptor for \fBunlinkat()\fR is not \fBAT_FDCWD\fR or does not
+reference a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The named file is a directory and {\fBPRIV_SYS_LINKDIR\fR} is not asserted in
+the effective set of the calling process, or the filesystem implementation does
+not support \fBunlink()\fR or \fBunlinkat()\fR on directories.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The directory entry to be unlinked is part of a read-only file system.
+.RE
+
+.sp
+.LP
+The \fBunlink()\fR and \fBunlinkat()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+Pathname resolution of a symbolic link produced an intermediate result whose
+length exceeds {\fBPATH_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBETXTBSY\fR\fR
+.ad
+.RS 16n
+.rt
+The entry to be unlinked is the last directory entry to a pure procedure
+(shared text) file that is being executed.
+.RE
+
+.SH USAGE
+.sp
+.LP
+Applications should use \fBrmdir\fR(2) to remove a directory.
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityT{
+\fBunlink()\fR is Standard; \fBunlinkat()\fR is Evolving
+T}
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBrm\fR(1), \fBclose\fR(2), \fBlink\fR(2), \fBopen\fR(2), \fBrmdir\fR(2),
+\fBremove\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5), \fBfsattr\fR(5)
diff --git a/usr/src/man/man2/ustat.2 b/usr/src/man/man2/ustat.2
new file mode 100644
index 0000000000..4219f7fbbd
--- /dev/null
+++ b/usr/src/man/man2/ustat.2
@@ -0,0 +1,132 @@
+'\" te
+.\" Copyright 1989 AT&T Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH ustat 2 "23 Jul 2001" "SunOS 5.11" "System Calls"
+.SH NAME
+ustat \- get file system statistics
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <ustat.h>
+
+\fBint\fR \fBustat\fR(\fBdev_t\fR \fIdev\fR, \fBstruct ustat *\fR\fIbuf\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBustat()\fR function returns information about a mounted file system.
+The \fIdev\fR argument is a device number identifying a device containing a
+mounted file system (see \fBmakedev\fR(3C)). The \fIbuf\fR argument is a
+pointer to a \fBustat\fR structure that includes the following members:
+.sp
+.in +2
+.nf
+daddr_t f_tfree; /* Total free blocks */
+ino_t f_tinode; /* Number of free inodes */
+char f_fname[6]; /* Filsys name */
+char f_fpack[6]; /* Filsys pack name */
+.fi
+.in -2
+
+.sp
+.LP
+The \fBf_fname\fR and \fBf_fpack\fR members may not contain significant
+information on all systems; in this case, these members will contain the null
+character as the first character.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBustat()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBECOMM\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIdev\fR argument is on a remote machine and the link to that machine is
+no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 13n
+.rt
+A signal was caught during the execution of the \fBustat()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIdev\fR argument is not the device number of a device containing a
+mounted file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 13n
+.rt
+The \fIdev\fR argument refers to a device on a remote machine and the link to
+that machine is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEOVERFLOW\fR\fR
+.ad
+.RS 13n
+.rt
+One of the values returned cannot be represented in the structure pointed to by
+\fIbuf\fR.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBstatvfs\fR(2) function should be used in favor of \fBustat()\fR.
+.SH SEE ALSO
+.sp
+.LP
+\fBstat\fR(2), \fBstatvfs\fR(2), \fBmakedev\fR(3C), \fBlfcompile\fR(5)
+.SH BUGS
+.sp
+.LP
+The \fBNFS\fR revision 2 protocol does not permit the number of free files to
+be provided to the client; therefore, when \fBustat()\fR has completed on an
+\fBNFS\fR file system, \fBf_tinode\fR is always \fB\(mi1\fR\&.
diff --git a/usr/src/man/man2/utime.2 b/usr/src/man/man2/utime.2
new file mode 100644
index 0000000000..8c91bdd841
--- /dev/null
+++ b/usr/src/man/man2/utime.2
@@ -0,0 +1,224 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" 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. 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. 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]
+.TH utime 2 "1 Sep 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+utime \- set file access and modification times
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/types.h>
+#include <utime.h>
+
+\fBint\fR \fButime\fR(\fBconst char *\fR\fIpath\fR, \fBconst struct utimbuf *\fR\fItimes\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fButime()\fR function sets the access and modification times of the file
+pointed to by \fIpath\fR, and causes the time of the last file status change
+(\fBst_ctime\fR) to be updated.
+.sp
+.LP
+If \fItimes\fR is \fINULL\fR, the access and modification times of the file are
+set to the current time. A process must be the owner of the file or have write
+permission to use \fButime()\fR in this manner.
+.sp
+.LP
+If \fItimes\fR is not \fINULL\fR, \fItimes\fR is interpreted as a pointer to a
+\fButimbuf\fR structure (defined in <\fButime.h\fR>) and the access and
+modification times are set to the values contained in the designated structure.
+Only the owner of the file or a process that has the {\fBPRIV_FILE_OWNER\fR}
+privilege asserted in its effective set can use \fButime()\fR in this manner.
+.sp
+.LP
+The \fButimbuf\fR structure contains the following members:
+.sp
+.in +2
+.nf
+time_t actime; /* access time */
+time_t modtime; /* modification time */
+.fi
+.in -2
+
+.sp
+.LP
+The times contained in the members of the \fButimbuf\fR structure are measured
+in seconds since 00:00:00 UTC, January 1, 1970.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, 0 is returned. Otherwise, \(mi1 is returned and
+\fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fButime()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied by a component of the \fIpath\fR prefix.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+The process does not have appropriate privileges and is not the owner of the
+file, write permission is denied for the file, and \fItimes\fR is \fINULL\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fButime()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in translating \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds \fIPATH_MAX\fR, or the length of
+a \fIpath\fR component exceeds \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in
+effect.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+The named file does not exist or is a null pathname.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the \fIpath\fR prefix is not a directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The effective user of the calling process is not the owner of the file,
+{\fBPRIV_FILE_OWNER\fR} is not asserted in the effective set of the calling
+process, and \fItimes\fR is not \fINULL\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The file system containing the file is mounted read-only.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-LevelAsync-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBfutimens\fR(2), \fBstat\fR(2), \fButimes\fR(2), \fBattributes\fR(5),
+\fBprivileges\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/utimes.2 b/usr/src/man/man2/utimes.2
new file mode 100644
index 0000000000..57a7e977c3
--- /dev/null
+++ b/usr/src/man/man2/utimes.2
@@ -0,0 +1,258 @@
+'\" te
+.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
+.\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
+.\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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. 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. 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]
+.TH utimes 2 "1 Sep 2009" "SunOS 5.11" "System Calls"
+.SH NAME
+utimes, futimesat \- set file access and modification times
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/time.h>
+
+\fBint\fR \fButimes\fR(\fBconst char *\fR\fIpath\fR, \fBconst struct timeval\fR \fItimes\fR[2]);
+.fi
+
+.LP
+.nf
+\fBint\fR \fBfutimesat\fR(\fBint\fR \fIfildes\fR, \fBconst char *\fR\fIpath\fR,
+ \fBconst struct timeval\fR \fItimes\fR[2]);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fButimes()\fR function sets the access and modification times of the file
+pointed to by the \fIpath\fR argument to the value of the \fItimes\fR argument.
+It allows time specifications accurate to the microsecond.
+.sp
+.LP
+The \fBfutimesat()\fR function also sets access and modification times. See
+\fBfsattr\fR(5). If \fIpath\fR is a relative path name, however,
+\fBfutimesat()\fR resolves the path relative to the \fIfildes\fR argument
+rather than the current working directory. If \fIfildes\fR is set to
+\fBAT_FDCWD\fR, defined in <\fBfcntl.h\fR>, \fBfutimesat()\fR resolves the path
+relative to the current working directory. If \fIpath\fR is a null pointer,
+\fBfutimesat()\fR sets the access and modification times on the file referenced
+by \fIfildes\fR. The \fIfildes\fR argument is ignored even when
+\fBfutimesat()\fR is provided with an absolute path.
+.sp
+.LP
+The \fItimes\fR argument is an array of \fBtimeval\fR structures. The first
+array member represents the date and time of last access, and the second member
+represents the date and time of last modification. The times in the
+\fBtimeval\fR structure are measured in seconds and microseconds since the
+Epoch, although rounding toward the nearest second may occur.
+.sp
+.LP
+If the \fItimes\fR argument is a null pointer, the access and modification
+times of the file are set to the current time. The effective user \fBID\fR of
+the process must be the same as the owner of the file, or must have write
+access to the file or the {\fBPRIV_FILE_OWNER\fR} privilege to use this call in
+this manner. Upon completion, \fButimes()\fR will mark the time of the last
+file status change, \fBst_ctime\fR, for update.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned, \fBerrno\fR is set to indicate the error, and the file times will not
+be affected.
+.SH ERRORS
+.sp
+.LP
+The \fButimes()\fR and \fBfutimesat()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEACCES\fR\fR
+.ad
+.RS 16n
+.rt
+Search permission is denied by a component of the path prefix; or the
+\fItimes\fR argument is a null pointer and the effective user \fBID\fR of the
+process does not match the owner of the file and write access is denied.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR or \fItimes\fR argument points to an illegal address. For
+\fBfutimesat()\fR, \fIpath\fR might have the value \fINULL\fR if the
+\fIfildes\fR argument refers to a valid open file descriptor.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 16n
+.rt
+A signal was caught during the execution of the \fButimes()\fR function.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 16n
+.rt
+The number of microseconds specified in one or both of the \fBtimeval\fR
+structures pointed to by \fItimes\fR was greater than or equal to 1,000,000 or
+less than 0.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 16n
+.rt
+An I/O error occurred while reading from or writing to the file system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBELOOP\fR\fR
+.ad
+.RS 16n
+.rt
+Too many symbolic links were encountered in resolving \fIpath\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+The length of the \fIpath\fR argument exceeds {\fIPATH_MAX\fR} or a pathname
+component is longer than {\fINAME_MAX\fR}.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 16n
+.rt
+The \fIpath\fR argument points to a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOENT\fR\fR
+.ad
+.RS 16n
+.rt
+A component of \fIpath\fR does not name an existing file or \fIpath\fR is an
+empty string.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOTDIR\fR\fR
+.ad
+.RS 16n
+.rt
+A component of the path prefix is not a directory or the \fIpath\fR argument is
+relative and the \fIfildes\fR argument is not \fBAT_FDCWD\fR or does not refer
+to a valid directory.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPERM\fR\fR
+.ad
+.RS 16n
+.rt
+The \fItimes\fR argument is not a null pointer and the calling process's
+effective user \fBID\fR has write access to the file but does not match the
+owner of the file and the calling process does not have the appropriate
+privileges.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEROFS\fR\fR
+.ad
+.RS 16n
+.rt
+The file system containing the file is read-only.
+.RE
+
+.sp
+.LP
+The \fButimes()\fR and \fBfutimesat()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENAMETOOLONG\fR\fR
+.ad
+.RS 16n
+.rt
+Path name resolution of a symbolic link produced an intermediate result whose
+length exceeds {\fIPATH_MAX\fR}.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+StandardSee below.
+.TE
+
+.sp
+.LP
+For \fButimes()\fR, see \fBstandards\fR(5).
+.SH SEE ALSO
+.sp
+.LP
+\fBfutimens\fR(2), \fBstat\fR(2), \fButime\fR(2), \fBattributes\fR(5),
+\fBfsattr\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/uucopy.2 b/usr/src/man/man2/uucopy.2
new file mode 100644
index 0000000000..7b7cfd631a
--- /dev/null
+++ b/usr/src/man/man2/uucopy.2
@@ -0,0 +1,72 @@
+'\" te
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH uucopy 2 "12 Sep 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+uucopy \- no-fault memory-to-memory copy
+.SH SYNOPSIS
+.LP
+.nf
+#include <strings.h>
+
+\fBint\fR \fBuucopy\fR(\fBconst void *\fR\fIs1\fR, \fBvoid *\fR\fIs2\fR, \fBsize_t\fR \fIn\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBuucopy()\fR function copies \fIn\fR bytes from memory area \fIs1\fR to
+\fIs2\fR. Copying between objects that overlap could corrupt one or both
+buffers.
+.sp
+.LP
+Unlike \fBbcopy\fR(3C), \fBuucopy()\fR does not cause a segmentation fault if
+either the source or destination buffer includes an illegal address. Instead,
+it returns \(mi1 and sets \fBerrno\fR to \fBEFAULT\fR. This error could occur
+after the operation has partially completed, so the contents of the buffer at
+\fIs2\fR are defined if the operation fails.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBuucopy()\fR returns 0. Otherwise, the function
+returns \(mi1 and set \fBerrno\fR to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBuucopy()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+Either the \fIs1\fR or \fIs2\fR arguments points to an illegal address.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityEvolving
+_
+MT-LevelMT-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBbcopy\fR(3C), \fBattributes\fR(5)
diff --git a/usr/src/man/man2/vfork.2 b/usr/src/man/man2/vfork.2
new file mode 100644
index 0000000000..c93b666fc5
--- /dev/null
+++ b/usr/src/man/man2/vfork.2
@@ -0,0 +1,186 @@
+'\" te
+.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T.
+.\" Copyright (c) 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
+.TH vfork 2 "13 Dec 2006" "SunOS 5.11" "System Calls"
+.SH NAME
+vfork, vforkx \- spawn new process in a virtual memory efficient way
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBpid_t\fR \fBvfork\fR(\fBvoid\fR);
+.fi
+
+.LP
+.nf
+#include <sys/fork.h>
+
+\fBpid_t\fR \fBvforkx\fR(\fBint\fR \fIflags\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBvfork()\fR and \fBvforkx()\fR functions create a new process without
+fully copying the address space of the old process. These functions are useful
+in instances where the purpose of a \fBfork\fR(2) operation is to create a new
+system context for an \fBexecve()\fR operation (see \fBexec\fR(2)).
+.sp
+.LP
+Unlike with the \fBfork()\fR function, the child process borrows the parent's
+memory and thread of control until a call to \fBexecve()\fR or an exit (either
+abnormally or by a call to \fB_exit()\fR (see \fBexit\fR(2)). Any modification
+made during this time to any part of memory in the child process is reflected
+in the parent process on return from \fBvfork()\fR or \fBvforkx()\fR. The
+parent process is suspended while the child is using its resources.
+.sp
+.LP
+In a multithreaded application, \fBvfork()\fR and \fBvforkx()\fR borrow only
+the thread of control that called \fBvfork()\fR or \fBvforkx()\fR in the
+parent; that is, the child contains only one thread. The use of \fBvfork()\fR
+or \fBvforkx()\fR in multithreaded applications, however, is unsafe due to race
+conditions that can cause the child process to become deadlocked and
+consequently block both the child and parent process from execution
+indefinitely.
+.sp
+.LP
+The \fBvfork()\fR and \fBvforkx()\fR functions can normally be used the same
+way as \fBfork()\fR and \fBforkx()\fR, respectively. The calling procedure,
+however, should not return while running in the child's context, since the
+eventual return from \fBvfork()\fR or \fBvforkx()\fR in the parent would be to
+a stack frame that no longer exists. The \fB_exit()\fR function should be used
+in favor of \fBexit\fR(3C) if unable to perform an \fBexecve()\fR operation,
+since \fBexit()\fR will invoke all functions registered by \fBatexit\fR(3C) and
+will flush and close standard I/O channels, thereby corrupting the parent
+process's standard I/O data structures. Care must be taken in the child process
+not to modify any global or local data that affects the behavior of the parent
+process on return from \fBvfork()\fR or \fBvforkx()\fR, unless such an effect
+is intentional.
+.sp
+.LP
+Unlike \fBfork()\fR and \fBforkx()\fR, fork handlers are not run when
+\fBvfork()\fR and \fBvforkx()\fR are called.
+.sp
+.LP
+The \fBvfork()\fR and \fBvforkx()\fR functions are deprecated. Their sole
+legitimate use as a prelude to an immediate call to a function from the
+\fBexec\fR family can be achieved safely by \fBposix_spawn\fR(3C) or
+\fBposix_spawnp\fR(3C).
+.SS "Fork Extensions"
+.sp
+.LP
+The \fBvforkx()\fR function accepts a \fIflags\fR argument consisting of a
+bitwise inclusive-OR of zero or more of the following flags, which are defined
+in the header \fB<sys/fork.h>\fR:
+.br
+.in +2
+\fBFORK_NOSIGCHLD\fR
+.in -2
+.br
+.in +2
+\fBFORK_WAITPID\fR
+.in -2
+.sp
+.LP
+See \fBfork\fR(2) for descriptions of these flags. If the \fIflags\fR argument
+is 0, \fBvforkx()\fR is identical to \fBvfork()\fR.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBvfork()\fR and \fBvforkx()\fR return \fB0\fR to
+the child process and returns the process ID of the child process to the parent
+process. Otherwise, \fB\(mi1\fR is returned to the parent process, no child
+process is created, and \fBerrno\fR is set to indicate the error.
+.SH ERRORS
+.sp
+.LP
+The \fBvfork()\fR and \fBvforkx()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 10n
+.rt
+The system-imposed limit on the total number of processes under execution
+(either system-quality or by a single user) would be exceeded. This limit is
+determined when the system is generated.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOMEM\fR\fR
+.ad
+.RS 10n
+.rt
+There is insufficient swap space for the new process.
+.RE
+
+.sp
+.LP
+The \fBvforkx()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIflags\fR argument is invalid.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityObsolete
+_
+MT-LevelUnsafe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBatexit\fR(3C),
+\fBexit\fR(3C), \fBposix_spawn\fR(3C), \fBposix_spawnp\fR(3C),
+\fBsignal.h\fR(3HEAD), \fBwait\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
+.SH NOTES
+.sp
+.LP
+To avoid a possible deadlock situation, processes that are children in the
+middle of a \fBvfork()\fR or \fBvforkx()\fR are never sent \fBSIGTTOU\fR or
+\fBSIGTTIN\fR signals; rather, output or ioctls are allowed and input attempts
+result in an \fBEOF\fR indication.
+.sp
+.LP
+To forestall parent memory corruption due to race conditions with signal
+handling, \fBvfork()\fR and \fBvforkx()\fR treat signal handlers in the child
+process in the same manner as the \fBexec\fR(2) functions: signals set to be
+caught by the parent process are set to the default action (\fBSIG_DFL\fR) in
+the child process (see \fBsignal.h\fR(3HEAD)). Any attempt to set a signal
+handler in the child before \fBexecve()\fR to anything other than \fBSIG_DFL\fR
+or \fBSIG_IGN\fR is disallowed and results in setting the handler to
+\fBSIG_DFL\fR.
+.sp
+.LP
+On some systems, the implementation of \fBvfork()\fR and \fBvforkx()\fR cause
+the parent to inherit register values from the child. This can create problems
+for certain optimizing compilers if \fB<unistd.h>\fR is not included in the
+source calling \fBvfork()\fR or if \fB<sys/fork.h>\fR is not included in the
+source calling \fBvforkx()\fR.
diff --git a/usr/src/man/man2/vhangup.2 b/usr/src/man/man2/vhangup.2
new file mode 100644
index 0000000000..6e0875d2a0
--- /dev/null
+++ b/usr/src/man/man2/vhangup.2
@@ -0,0 +1,38 @@
+'\" te
+.\" Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
+.TH vhangup 2 "19 Mar 1998" "SunOS 5.11" "System Calls"
+.SH NAME
+vhangup \- virtually "hangup" the current controlling terminal
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBvoid\fR \fBvhangup\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBvhangup()\fR function is used by the initialization process
+\fBinit\fR(1M) (among others) to ensure that users are given "clean" terminals
+at login by revoking access of the previous users' processes to the terminal.
+To effect this, \fBvhangup()\fR searches the system tables for references to
+the controlling terminal of the invoking process and revokes access permissions
+on each instance of the terminal that it finds. Further attempts to access the
+terminal by the affected processes will yield I/O errors (\fBEBADF\fR or
+\fBEIO\fR). A \fBSIGHUP\fR (hangup signal) is sent to the process group of the
+controlling terminal.
+.SH SEE ALSO
+.sp
+.LP
+\fBinit\fR(1M)
+.SH BUGS
+.sp
+.LP
+Access to the controlling terminal using \fB/dev/tty\fR is still possible.
+.sp
+.LP
+This call should be replaced by an automatic mechanism that takes place on
+process exit.
diff --git a/usr/src/man/man2/waitid.2 b/usr/src/man/man2/waitid.2
new file mode 100644
index 0000000000..914d25ce6a
--- /dev/null
+++ b/usr/src/man/man2/waitid.2
@@ -0,0 +1,231 @@
+'\" te
+.\" Copyright 1989 AT&T. Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved. Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH waitid 2 "9 Jun 2004" "SunOS 5.11" "System Calls"
+.SH NAME
+waitid \- wait for child process to change state
+.SH SYNOPSIS
+.LP
+.nf
+#include <wait.h>
+
+\fBint\fR \fBwaitid\fR(\fBidtype_t\fR \fIidtype\fR, \fBid_t\fR \fIid\fR, \fBsiginfo_t *\fR\fIinfop\fR, \fBint\fR \fIoptions\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBwaitid()\fR function suspends the calling process until one of its child
+processes changes state. It records the current state of a child in the
+structure pointed to by \fIinfop\fR. It returns immediately if a child process
+changed state prior to the call.
+.sp
+.LP
+The \fIidtype\fR and \fIid\fR arguments specify which children \fBwaitid()\fR
+is to wait for, as follows:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIidtype\fR is \fBP_PID\fR, \fBwaitid()\fR waits for the child with a
+process \fBID\fR equal to \fB(pid_t)\fR\fIid\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIidtype\fR is \fBP_PGID\fR, \fBwaitid()\fR waits for any child with a
+process group \fBID\fR equal to \fB(pid_t)\fR\fIid\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fIidtype\fR is \fBP_ALL\fR, \fBwaitid()\fR waits for any child and \fIid\fR
+is ignored.
+.RE
+.sp
+.LP
+The \fIoptions\fR argument is used to specify which state changes
+\fBwaitid()\fR is to wait for. It is formed by bitwise \fBOR\fR operation of
+any of the following flags:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBWCONTINUED\fR\fR
+.ad
+.RS 14n
+.rt
+Return the status for any child that was stopped and has been continued.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBWEXITED\fR\fR
+.ad
+.RS 14n
+.rt
+Wait for process(es) to exit.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBWNOHANG\fR\fR
+.ad
+.RS 14n
+.rt
+Return immediately.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBWNOWAIT\fR\fR
+.ad
+.RS 14n
+.rt
+Keep the process in a waitable state.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBWSTOPPED\fR\fR
+.ad
+.RS 14n
+.rt
+Wait for and return the process status of any child that has stopped upon
+receipt of a signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBWTRAPPED\fR\fR
+.ad
+.RS 14n
+.rt
+Wait for traced process(es) to become trapped or reach a breakpoint (see
+\fBptrace\fR(3C)).
+.RE
+
+.sp
+.LP
+The \fIinfop\fR argument must point to a \fBsiginfo_t\fR structure, as defined
+in \fBsiginfo.h\fR(3HEAD). If \fBwaitid()\fR returns because a child process
+was found that satisfies the conditions indicated by the arguments \fIidtype\fR
+and \fIoptions\fR, then the structure pointed to by \fIinfop\fR will be filled
+by the system with the status of the process. The \fBsi_signo\fR member will
+always be equal to \fBSIGCHLD\fR.
+.sp
+.LP
+One instance of a \fBSIGCHLD\fR signal is queued for each child process whose
+status has changed. If \fBwaitid()\fR returns because the status of a child
+process is available and \fBWNOWAIT\fR was not specified in \fIoptions\fR, any
+pending \fBSIGCHLD\fR signal associated with the process ID of that child
+process is discarded. Any other pending \fBSIGCHLD\fR signals remain pending.
+.SH RETURN VALUES
+.sp
+.LP
+If \fBwaitid()\fR returns due to a change of state of one of its children and
+\fBWNOHANG\fR was not used, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
+returned and \fBerrno\fR is set to indicate the error. If \fBWNOHANG\fR was
+used, \fB0\fR can be returned (indicating no error); however, no children may
+have changed state if \fBinfo->si_pid\fR is \fB0\fR.
+.SH ERRORS
+.sp
+.LP
+The \fBwaitid()\fR function will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBECHILD\fR\fR
+.ad
+.RS 10n
+.rt
+The set of processes specified by \fIidtype\fR and \fIid\fR does not contain
+any unwaited processes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIinfop\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 10n
+.rt
+The \fBwaitid()\fR function was interrupted due to the receipt of a signal by
+the calling process.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+An invalid value was specified for \fIoptions\fR, or \fIidtype\fR and \fIid\fR
+specify an invalid set of processes.
+.RE
+
+.SH USAGE
+.sp
+.LP
+With \fIoptions\fR equal to \fBWEXITED\fR | \fBWTRAPPED\fR, \fBwaitid()\fR is
+equivalent to \fBwaitpid\fR(3C). With \fIidtype\fR equal to \fBP_ALL\fR and
+\fIoptions\fR equal to \fBWEXITED\fR | \fBWTRAPPED\fR, \fBwaitid()\fR is
+equivalent to \fBwait\fR(3C).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityStandard
+_
+MT-LevelAsync-Signal-Safe
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBexec\fR(2), \fBexit\fR(2), \fBfork\fR(2), \fBpause\fR(2),
+\fBsigaction\fR(2), \fBptrace\fR(3C), \fBsignal\fR(3C), \fBsiginfo.h\fR(3HEAD),
+\fBwait\fR(3C), \fBwaitpid\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man2/write.2 b/usr/src/man/man2/write.2
new file mode 100644
index 0000000000..f3a84a7dc7
--- /dev/null
+++ b/usr/src/man/man2/write.2
@@ -0,0 +1,635 @@
+'\" te
+.\" Copyright (c) 2087, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 1989 AT&T
+.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
+.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
+.\" http://www.opengroup.org/bookstore/.
+.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
+.\" This notice shall appear on any product containing this material.
+.\" 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.
+.\" 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.
+.\" 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]
+.TH write 2 "29 Jan 2008" "SunOS 5.11" "System Calls"
+.SH NAME
+write, pwrite, writev \- write on a file
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBssize_t\fR \fBwrite\fR(\fBint\fR \fIfildes\fR, \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fInbyte\fR);
+.fi
+
+.LP
+.nf
+\fBssize_t\fR \fBpwrite\fR(\fBint\fR \fIfildes\fR, \fBconst void *\fR\fIbuf\fR, \fBsize_t\fR \fInbyte\fR,
+ \fBoff_t\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+#include <sys/uio.h>
+
+\fBssize_t\fR \fBwritev\fR(\fBint\fR \fIfildes\fR, \fBconst struct iovec *\fR\fIiov\fR, \fBint\fR \fIiovcnt\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fBwrite()\fR function attempts to write \fInbyte\fR bytes from the buffer
+pointed to by \fIbuf\fR to the file associated with the open file descriptor,
+\fIfildes\fR.
+.sp
+.LP
+If \fInbyte\fR is 0, \fBwrite()\fR will return 0 and have no other results if
+the file is a regular file; otherwise, the results are unspecified.
+.sp
+.LP
+On a regular file or other file capable of seeking, the actual writing of data
+proceeds from the position in the file indicated by the file offset associated
+with \fIfildes\fR. Before successful return from \fBwrite()\fR, the file offset
+is incremented by the number of bytes actually written. On a regular file, if
+this incremented file offset is greater than the length of the file, the length
+of the file will be set to this file offset.
+.sp
+.LP
+If the \fBO_SYNC\fR bit has been set, write I/O operations on the file
+descriptor complete as defined by synchronized I/O file integrity completion.
+.sp
+.LP
+If \fIfildes\fR refers to a socket, \fBwrite()\fR is equivalent to
+\fBsend\fR(3SOCKET) with no flags set.
+.sp
+.LP
+On a file not capable of seeking, writing always takes place starting at the
+current position. The value of a file offset associated with such a device is
+undefined.
+.sp
+.LP
+If the \fBO_APPEND\fR flag of the file status flags is set, the file offset
+will be set to the end of the file prior to each write and no intervening file
+modification operation will occur between changing the file offset and the
+write operation.
+.sp
+.LP
+For regular files, no data transfer will occur past the offset maximum
+established in the open file description with \fIfildes\fR.
+.sp
+.LP
+A \fBwrite()\fR to a regular file is blocked if mandatory file/record locking
+is set (see \fBchmod\fR(2)), and there is a record lock owned by another
+process on the segment of the file to be written:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is set, \fBwrite()\fR returns \fB\(mi1\fR
+and sets \fBerrno\fR to \fBEAGAIN\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear, \fBwrite()\fR sleeps until
+all blocking locks are removed or the \fBwrite()\fR is terminated by a signal.
+.RE
+.sp
+.LP
+If a \fBwrite()\fR requests that more bytes be written than there is room
+for\(emfor example, if the write would exceed the process file size limit (see
+\fBgetrlimit\fR(2) and \fBulimit\fR(2)), the system file size limit, or the
+free space on the device\(emonly as many bytes as there is room for will be
+written. For example, suppose there is space for 20 bytes more in a file before
+reaching a limit. A \fBwrite()\fR of 512-bytes returns 20. The next
+\fBwrite()\fR of a non-zero number of bytes gives a failure return (except as
+noted for pipes and FIFO below).
+.sp
+.LP
+If \fBwrite()\fR is interrupted by a signal before it writes any data, it will
+return \(mi1 with \fBerrno\fR set to \fBEINTR\fR.
+.sp
+.LP
+If \fBwrite()\fR is interrupted by a signal after it successfully writes some
+data, it will return the number of bytes written.
+.sp
+.LP
+If \fBwrite()\fR exceeds the process file size limit, the application generates
+a \fBSIGXFSZ\fR signal, whose default behavior is to dump core.
+.sp
+.LP
+After a \fBwrite()\fR to a regular file has successfully returned:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Any successful \fBread\fR(2) from each byte position in the file that was
+modified by that write will return the data specified by the \fBwrite()\fR for
+that position until such byte positions are again modified.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Any subsequent successful \fBwrite()\fR to the same byte position in the file
+will overwrite that file data.
+.RE
+.sp
+.LP
+Write requests to a pipe or FIFO are handled the same as a regular file with
+the following exceptions:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+There is no file offset associated with a pipe, hence each write request
+appends to the end of the pipe.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Write requests of \fB{PIPE_BUF}\fR bytes or less are guaranteed not to be
+interleaved with data from other processes doing writes on the same pipe.
+Writes of greater than \fB{PIPE_BUF}\fR bytes may have data interleaved, on
+arbitrary boundaries, with writes by other processes, whether or not the
+\fBO_NONBLOCK\fR or \fBO_NDELAY\fR flags are set.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR and \fBO_NDELAY\fR are clear, a write request may cause the
+process to block, but on normal completion it returns \fInbyte\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR and \fBO_NDELAY\fR are set, \fBwrite()\fR does not block
+the process. If a \fBwrite()\fR request for \fBPIPE_BUF\fR or fewer bytes
+succeeds completely \fBwrite()\fR returns \fInbyte\fR. Otherwise, if
+\fBO_NONBLOCK\fR is set, it returns \fB\(mi1\fR and sets \fBerrno\fR to
+\fBEAGAIN\fR or if \fBO_NDELAY\fR is set, it returns \fB0\fR. A \fBwrite()\fR
+request for greater than \fB{PIPE_BUF}\fR bytes transfers what it can and
+returns the number of bytes written or it transfers no data and, if
+\fBO_NONBLOCK\fR is set, returns \fB\(mi1\fR with \fBerrno\fR set to
+\fBEAGAIN\fR or if \fBO_NDELAY\fR is set, it returns \fB0\fR. Finally, if a
+request is greater than \fBPIPE_BUF\fR bytes and all data previously written to
+the pipe has been read, \fBwrite()\fR transfers at least \fBPIPE_BUF\fR bytes.
+.RE
+.sp
+.LP
+When attempting to write to a file descriptor (other than a pipe, a FIFO, a
+socket, or a stream) that supports nonblocking writes and cannot accept the
+data immediately:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR and \fBO_NDELAY\fR are clear, \fBwrite()\fR blocks until
+the data can be accepted.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NONBLOCK\fR or \fBO_NDELAY\fR is set, \fBwrite()\fR does not block the
+process. If some data can be written without blocking the process,
+\fBwrite()\fR writes what it can and returns the number of bytes written.
+Otherwise, if \fBO_NONBLOCK\fR is set, it returns \fB\(mi1\fR and sets
+\fBerrno\fR to \fBEAGAIN\fR or if \fBO_NDELAY\fR is set, it returns \fB0\fR.
+.RE
+.sp
+.LP
+Upon successful completion, where \fInbyte\fR is greater than 0, \fBwrite()\fR
+will mark for update the \fBst_ctime\fR and \fBst_mtime\fR fields of the file,
+and if the file is a regular file, the \fBS_ISUID\fR and \fBS_ISGID\fR bits of
+the file mode may be cleared.
+.sp
+.LP
+For streams files (see \fBIntro\fR(2) and \fBstreamio\fR(7I)), the operation of
+\fBwrite()\fR is determined by the values of the minimum and maximum
+\fInbyte\fR range ("packet size") accepted by the stream. These values are
+contained in the topmost stream module, and can not be set or tested from user
+level. If \fInbyte\fR falls within the packet size range, \fInbyte\fR bytes are
+written. If \fInbyte\fR does not fall within the range and the minimum packet
+size value is zero, \fBwrite()\fR breaks the buffer into maximum packet size
+segments prior to sending the data downstream (the last segment may be smaller
+than the maximum packet size). If \fInbyte\fR does not fall within the range
+and the minimum value is non-zero, \fBwrite()\fR fails and sets \fBerrno\fR to
+\fBERANGE\fR. Writing a zero-length buffer (\fInbyte\fR is zero) to a streams
+device sends a zero length message with zero returned. However, writing a
+zero-length buffer to a pipe or FIFO sends no message and zero is returned.
+The user program may issue the \fBI_SWROPT\fR \fBioctl\fR(2) to enable
+zero-length messages to be sent across the pipe or FIFO (see
+\fBstreamio\fR(7I)).
+.sp
+.LP
+When writing to a stream, data messages are created with a priority band of
+zero. When writing to a socket or to a stream that is not a pipe or a FIFO:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are not set, and the stream cannot
+accept data (the stream write queue is full due to internal flow control
+conditions), \fBwrite()\fR blocks until data can be accepted.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is set and the stream cannot accept data,
+\fBwrite()\fR returns \fB-1\fR and sets \fBerrno\fR to \fBEAGAIN\fR.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+If \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is set and part of the buffer has already
+been written when a condition occurs in which the stream cannot accept
+additional data, \fBwrite()\fR terminates and returns the number of bytes
+written.
+.RE
+.sp
+.LP
+The \fBwrite()\fR and \fBwritev()\fR functions will fail if the stream head had
+processed an asynchronous error before the call. In this case, the value of
+\fBerrno\fR does not reflect the result of \fBwrite()\fR or \fBwritev()\fR but
+reflects the prior error.
+.SS "\fBpwrite()\fR"
+.sp
+.LP
+The \fBpwrite()\fR function is equivalent to \fBwrite()\fR, except that it
+writes into a given position and does not change the file offset (regardless of
+whether \fBO_APPEND\fR is set). The first three arguments to \fBpwrite()\fR are
+the same as \fBwrite()\fR, with the addition of a fourth argument \fIoffset\fR
+for the desired position inside the file.
+.SS "\fBwritev()\fR"
+.sp
+.LP
+The \fBwritev()\fR function performs the same action as \fBwrite()\fR, but
+gathers the output data from the \fIiovcnt\fR buffers specified by the members
+of the \fIiov\fR array: \fIiov\fR[0], \fIiov\fR[1], \&.\|.\|.,
+\fIiov\fR[\fIiovcnt\fR\|\(mi\|1]. The \fIiovcnt\fR buffer is valid if greater
+than 0 and less than or equal to \fB{IOV_MAX}\fR. See \fBIntro\fR(2) for a
+definition of \fB{IOV_MAX}\fR.
+.sp
+.LP
+The \fBiovec\fR structure contains the following members:
+.sp
+.in +2
+.nf
+caddr_t iov_base;
+int iov_len;
+.fi
+.in -2
+
+.sp
+.LP
+Each \fBiovec\fR entry specifies the base address and length of an area in
+memory from which data should be written. The \fBwritev()\fR function always
+writes all data from an area before proceeding to the next.
+.sp
+.LP
+If \fIfildes\fR refers to a regular file and all of the \fBiov_len\fR members
+in the array pointed to by \fIiov\fR are 0, \fBwritev()\fR will return 0 and
+have no other effect. For other file types, the behavior is unspecified.
+.sp
+.LP
+If the sum of the \fBiov_len\fR values is greater than \fBSSIZE_MAX\fR, the
+operation fails and no data is transferred.
+.SH RETURN VALUES
+.sp
+.LP
+Upon successful completion, \fBwrite()\fR returns the number of bytes actually
+written to the file associated with \fIfildes\fR. This number is never greater
+than \fInbyte\fR. Otherwise, \fB\(mi1\fR is returned, the file-pointer remains
+unchanged, and \fBerrno\fR is set to indicate the error.
+.sp
+.LP
+Upon successful completion, \fBwritev()\fR returns the number of bytes actually
+written. Otherwise, it returns \fB\(mi1\fR, the file-pointer remains
+unchanged, and \fBerrno\fR is set to indicate an error.
+.SH ERRORS
+.sp
+.LP
+The \fBwrite()\fR, \fBpwrite()\fR, and \fBwritev()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEAGAIN\fR\fR
+.ad
+.RS 11n
+.rt
+Mandatory file/record locking is set, \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is
+set, and there is a blocking record lock; an attempt is made to write to a
+stream that can not accept data with the \fBO_NDELAY\fR or \fBO_NONBLOCK\fR
+flag set; or a write to a pipe or FIFO of \fBPIPE_BUF\fR bytes or less is
+requested and less than \fInbytes\fR of free space is available.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEBADF\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is not a valid file descriptor open for writing.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDEADLK\fR\fR
+.ad
+.RS 11n
+.rt
+The write was going to go to sleep and cause a deadlock situation to occur.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEDQUOT\fR\fR
+.ad
+.RS 11n
+.rt
+The user's quota of disk blocks on the file system containing the file has been
+exhausted.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFBIG\fR\fR
+.ad
+.RS 11n
+.rt
+An attempt is made to write a file that exceeds the process's file size limit
+or the maximum file size (see \fBgetrlimit\fR(2) and \fBulimit\fR(2)).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFBIG\fR\fR
+.ad
+.RS 11n
+.rt
+The file is a regular file, \fInbyte\fR is greater than 0, and the starting
+position is greater than or equal to the offset maximum established in the file
+description associated with \fIfildes\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINTR\fR\fR
+.ad
+.RS 11n
+.rt
+A signal was caught during the write operation and no data was transferred.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEIO\fR\fR
+.ad
+.RS 11n
+.rt
+The process is in the background and is attempting to write to its controlling
+terminal whose \fBTOSTOP\fR flag is set, or the process is neither ignoring
+nor blocking \fBSIGTTOU\fR signals and the process group of the process is
+orphaned.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLCK\fR\fR
+.ad
+.RS 11n
+.rt
+Enforced record locking was enabled and \fB{LOCK_MAX}\fR regions are already
+locked in the system, or the system record lock table was full and the write
+could not go to sleep until the blocking record lock was removed.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOLINK\fR\fR
+.ad
+.RS 11n
+.rt
+The \fIfildes\fR argument is on a remote machine and the link to that machine
+is no longer active.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSPC\fR\fR
+.ad
+.RS 11n
+.rt
+During a write to an ordinary file, there is no free space left on the device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENOSR\fR\fR
+.ad
+.RS 11n
+.rt
+An attempt is made to write to a streams with insufficient streams memory
+resources available in the system.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 11n
+.rt
+A hangup occurred on the stream being written to.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEPIPE\fR\fR
+.ad
+.RS 11n
+.rt
+An attempt is made to write to a pipe or a \fBFIFO\fR that is not open for
+reading by any process, or that has only one end open (or to a file descriptor
+created by \fBsocket\fR(3SOCKET), using type \fBSOCK_STREAM\fR that is no
+longer connected to a peer endpoint). A \fBSIGPIPE\fR signal will also be sent
+to the thread. The process dies unless special provisions were taken to catch
+or ignore the signal.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBERANGE\fR\fR
+.ad
+.RS 11n
+.rt
+The transfer request size was outside the range supported by the streams file
+associated with \fIfildes\fR.
+.RE
+
+.sp
+.LP
+The \fBwrite()\fR and \fBpwrite()\fR functions will fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEFAULT\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIbuf\fR argument points to an illegal address.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fInbyte\fR argument overflowed an \fBssize_t\fR.
+.RE
+
+.sp
+.LP
+The \fBpwrite()\fR function fails and the file pointer remains unchanged if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBESPIPE\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIfildes\fR argument is associated with a pipe or FIFO.
+.RE
+
+.sp
+.LP
+The \fBwrite()\fR and \fBwritev()\fR functions may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The stream or multiplexer referenced by \fIfildes\fR is linked (directly or
+indirectly) downstream from a multiplexer.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 10n
+.rt
+A request was made of a non-existent device, or the request was outside the
+capabilities of the device.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBENXIO\fR\fR
+.ad
+.RS 10n
+.rt
+A hangup occurred on the stream being written to.
+.RE
+
+.sp
+.LP
+A write to a streams file may fail if an error message has been received at the
+stream head. In this case, \fBerrno\fR is set to the value included in the
+error message.
+.sp
+.LP
+The \fBwritev()\fR function may fail if:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBEINVAL\fR\fR
+.ad
+.RS 10n
+.rt
+The \fIiovcnt\fR argument was less than or equal to 0 or greater than
+{\fBIOV_MAX\fR}; one of the \fBiov_len\fR values in the \fIiov\fR array was
+negative; or the sum of the \fBiov_len\fR values in the \fIiov\fR array
+overflowed an \fBssize_t\fR.
+.RE
+
+.SH USAGE
+.sp
+.LP
+The \fBpwrite()\fR function has a transitional interface for 64-bit file
+offsets. See \fBlf64\fR(5).
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+Interface StabilityCommitted
+_
+MT-Level\fBwrite()\fR is Async-Signal-Safe
+_
+StandardSee \fBstandards\fR(5).
+.TE
+
+.SH SEE ALSO
+.sp
+.LP
+\fBIntro\fR(2), \fBchmod\fR(2), \fBcreat\fR(2), \fBdup\fR(2), \fBfcntl\fR(2),
+\fBgetrlimit\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBopen\fR(2),
+\fBpipe\fR(2), \fBulimit\fR(2), \fBsend\fR(3SOCKET), \fBsocket\fR(3SOCKET),
+\fBattributes\fR(5), \fBlf64\fR(5), \fBstandards\fR(5), \fBstreamio\fR(7I)
diff --git a/usr/src/man/man2/yield.2 b/usr/src/man/man2/yield.2
new file mode 100644
index 0000000000..7aff55f449
--- /dev/null
+++ b/usr/src/man/man2/yield.2
@@ -0,0 +1,26 @@
+'\" te
+.\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
+.\" 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.
+.\" 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.
+.\" 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]
+.TH yield 2 "20 Jul 1993" "SunOS 5.11" "System Calls"
+.SH NAME
+yield \- yield execution to another lightweight process
+.SH SYNOPSIS
+.LP
+.nf
+#include <unistd.h>
+
+\fBvoid\fR \fByield\fR(\fBvoid\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The \fByield()\fR function causes the current lightweight process to yield its
+execution in favor of another lightweight process with the same or greater
+priority.
+.SH SEE ALSO
+.sp
+.LP
+\fBthr_yield\fR(3C)