diff options
Diffstat (limited to 'usr/src/man/man3c')
-rw-r--r-- | usr/src/man/man3c/Makefile | 3 | ||||
-rw-r--r-- | usr/src/man/man3c/inotify_add_watch.3c | 120 | ||||
-rw-r--r-- | usr/src/man/man3c/inotify_init.3c | 107 | ||||
-rw-r--r-- | usr/src/man/man3c/inotify_rm_watch.3c | 81 | ||||
-rw-r--r-- | usr/src/man/man3c/psignal.3c | 9 | ||||
-rw-r--r-- | usr/src/man/man3c/putenv.3c | 14 | ||||
-rw-r--r-- | usr/src/man/man3c/signalfd.3c | 22 | ||||
-rw-r--r-- | usr/src/man/man3c/timer_create.3c | 16 | ||||
-rw-r--r-- | usr/src/man/man3c/timer_settime.3c | 12 |
9 files changed, 354 insertions, 30 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index 61591de7e7..4b8e8336a0 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -210,6 +210,9 @@ MANFILES= __fbufsize.3c \ imaxdiv.3c \ index.3c \ initgroups.3c \ + inotify_init.3c \ + inotify_add_watch.3c \ + inotify_rm_watch.3c \ insque.3c \ is_system_labeled.3c \ isaexec.3c \ diff --git a/usr/src/man/man3c/inotify_add_watch.3c b/usr/src/man/man3c/inotify_add_watch.3c new file mode 100644 index 0000000000..4f79e03c82 --- /dev/null +++ b/usr/src/man/man3c/inotify_add_watch.3c @@ -0,0 +1,120 @@ +'\" te +.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved. +.\" 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. +.TH INOTIFY_ADD_WATCH 3C "Sep 17, 2014" +.SH NAME +inotify_add_watch \- add a watch to an inotify instance +.SH SYNOPSIS + +.LP +.nf +#include <sys/inotify.h> + +\fBint\fR \fBinotify_add_watch\fR(\fBint\fR \fIfd\fR, \fBconst char *\fR\fIpathname\fR, \fBuint32_t\fR \fImask\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBinotify_add_watch()\fR function adds a watch for the file or +directory specified by \fIpathname\fR to the inotify instance +specified by \fIfd\fR for the events specified by \fImask\fR. See +\fBinotify\fR(5) for details on the meaning of \fImask\fR, how +it affects the interpretation of \fIpathname\fR, and how +events for the watched file or directory are subsequently +retrieved via \fBread\fR(2). + +.SH RETURN VALUES +.sp +.LP +Upon succesful completion, \fBinotify_add_watch()\fR returns the +watch descriptor associated with the new watch. +If an error occurs, -1 is returned and errno is set to indicate +the error. + +.SH ERRORS +.sp +.LP +\fBinotify_add_watch()\fR will fail if: +.sp +.ne 2 +.na +\fB\fBEACCES\fR\fR +.ad +.RS 10n +\fIpathname\fR could not be opened for reading. +.RE + +.sp +.ne 2 +.na +\fB\fBEBADF\fR\fR +.ad +.RS 10n +The \fIfd\fR argument is not a valid open file descriptor. +.RE + +.sp +.ne 2 +.na +\fB\fBEFAULT\fR\fR +.ad +.RS 10n +The memory associated with \fIpathname\fR was not mapped. +.RE + +.sp +.ne 2 +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +The \fIfd\fR argument does not correspond to an +\fBinotify\fR(5) instance as initialized with +\fBinotify_init\fR(3C) or \fBinotify_init1\fR(3C). +.RE + +.sp +.ne 2 +.na +\fB\fBENOSPC\fR\fR +.ad +.RS 10n +The number of watches on the specified instance would exceed the +maximum number of watches per \fBinotify\fR(5) instance. +.RE + +.sp +.ne 2 +.na +\fB\fBENOTDIR\fR\fR +.ad +.RS 10n +\fIpathname\fR does not correspond to a directory and +\fBIN_ONLYDIR\fR was specified in \fImask\fR. +.RE + +.sp +.SH NOTES +.sp +.LP + +While the \fBinotify\fR(5) facility is implemented for purposes of +offering compatibility for Linux-borne applications, native +applications may opt to use it instead of (or in addition to) the +\fBPORT_SOURCE_FILE\fR capability of event ports. See +\fBinotify\fR(5) for details and restrictions. + +.SH SEE ALSO +.sp +.LP +\fBinotify_init\fR(3C), \fBinotify_init1\fR(3C), +\fBport_create\fR(3C), \fBport_associate\fR(3C), \fBport_get\fR(3C), +\fBinotify\fR(5) diff --git a/usr/src/man/man3c/inotify_init.3c b/usr/src/man/man3c/inotify_init.3c new file mode 100644 index 0000000000..551a2ca798 --- /dev/null +++ b/usr/src/man/man3c/inotify_init.3c @@ -0,0 +1,107 @@ +'\" te +.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved. +.\" 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. +.TH INOTIFY_INIT 3C "Sep 17, 2014" +.SH NAME +inotify_init, inotify_init1 \- initialize an inotify instance +.SH SYNOPSIS + +.LP +.nf +#include <sys/inotify.h> + +\fBint\fR \fBinotify_init\fR(\fBvoid\fR); +.fi + +.LP +.nf +\fBint\fR \fBinotify_init1\fR(\fBint\fR \fIflags\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBinotify_init()\fR and \fBinotify_init1()\fR functions both create an +\fBinotify\fR(5) instance that can be operated upon via +\fBinotify_add_watch\fR(3C), \fBinotify_rm_watch\fR(3C) and \fBread\fR(2). +\fBinotify\fR instances are +represented as file descriptors, and should be closed via \fBclose\fR(2). + +The only difference between the two functions is their signature; +\fBinotify_init()\fR takes no arguments, +while \fBinotify_init1()\fR takes a \fIflags\fR argument that can have +any of the following values: + +.sp +.ne 2 +.na +\fBIN_CLOEXEC\fR +.ad +.RS 12n +Instance should be closed upon an +\fBexec\fR(2); see \fBopen\fR(2)'s description of \fBO_CLOEXEC\fR. +.RE + +.sp +.ne 2 +.na +\fBIN_NONBLOCK\fR +.ad +.RS 12n +Instance will be set to be non-blocking. A \fBread\fR(2) on an +\fBinotify\fR instance that has been initialized with +\fBIN_NONBLOCK\fR will return \fBEAGAIN\fR if there are +no events enqueued in lieu of blocking. +.RE + +.SH RETURN VALUES +.sp +.LP +Upon succesful completion, 0 is returned. Otherwise, -1 is returned and errno +is set to indicate the error. +.SH ERRORS +.sp +.LP +The \fBinotify_init()\fR and \fBinotify_init1()\fR functions will fail if: +.sp +.ne 2 +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +The \fIflags\fR are invalid (\fBinotify_init1()\fR). +.RE + +.sp +.ne 2 +.na +\fB\fBEMFILE\fR\fR +.ad +.RS 10n +There are currently {\fBOPEN_MAX\fR} file descriptors open in the calling +process, or the maximum number of \fBinotify\fR instances for the user +would be exceeded. +.RE + +.sp +.SH NOTES +.sp +.LP + +While the \fBinotify\fR(5) facility is implemented for purposes of +offering compatibility for Linux-borne applications, native +applications may opt to use it instead of (or in addition to) the +\fBPORT_SOURCE_FILE\fR capability of event ports. See +\fBinotify\fR(5) for details and restrictions. + +.SH SEE ALSO +.sp +.LP +\fBinotiy_add_watch\fR(3C), \fBinotify_rm_watch\fR(3C), \fBinotify\fR(5) diff --git a/usr/src/man/man3c/inotify_rm_watch.3c b/usr/src/man/man3c/inotify_rm_watch.3c new file mode 100644 index 0000000000..de568f8e24 --- /dev/null +++ b/usr/src/man/man3c/inotify_rm_watch.3c @@ -0,0 +1,81 @@ +'\" te +.\" Copyright (c) 2014, Joyent, Inc. All Rights Reserved. +.\" 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. +.TH INOTIFY_RM_WATCH 3C "Sep 17, 2014" +.SH NAME +inotify_rm_watch \- remove a watch from an inotify instance +.SH SYNOPSIS + +.LP +.nf +#include <sys/inotify.h> + +\fBint\fR \fBinotify_rm_watch\fR(\fBint\fR \fIfd\fR, \fBint\fR \fIwd\fR); +.fi + +.SH DESCRIPTION +.sp +.LP +The \fBinotify_rm_watch()\fR function removes the watch specified +by \fIwd\fR from the inotify instance associated with \fIfd\fR. +Removing a watch will induce an \fBIN_IGNORED\fR event; see +\fBinotify\fR(5) for details. + +.SH RETURN VALUES +.sp +.LP +Upon succesful completion, \fBinotify_add_watch()\fR returns the +watch descriptor associated with the new watch. +If an error occurs, -1 is returned and errno is set to indicate +the error. + +.SH ERRORS +.sp +.LP +\fBinotify_rm_watch()\fR will fail if: +.sp +.ne 2 +.na +\fB\fBEBADF\fR\fR +.ad +.RS 10n +The \fIfd\fR argument is not a valid open file descriptor. +.RE + +.sp +.ne 2 +.na +\fB\fBEINVAL\fR\fR +.ad +.RS 10n +The \fIfd\fR argument does not correspond to an +\fBinotify\fR(5) instance as initialized with +\fBinotify_init\fR(3C) or \fBinotify_init1\fR(3C), or +\fIwd\fR is not a valid watch for the specified inotify +instance. +.RE + +.sp +.SH NOTES +.sp +.LP + +While the \fBinotify\fR(5) facility is implemented for purposes of +offering compatibility for Linux-borne applications, native +applications may opt to use it instead of (or in addition to) the +\fBPORT_SOURCE_FILE\fR capability of event ports. See +\fBinotify\fR(5) for details and restrictions. + +.SH SEE ALSO +.sp +.LP +\fBinotify_init\fR(3C), \fBinotify_init1\fR(3C), +\fBport_create\fR(3C), \fBport_associate\fR(3C), \fBport_get\fR(3C), +\fBinotify\fR(5) diff --git a/usr/src/man/man3c/psignal.3c b/usr/src/man/man3c/psignal.3c index 655dedb022..a977fb6df4 100644 --- a/usr/src/man/man3c/psignal.3c +++ b/usr/src/man/man3c/psignal.3c @@ -1,16 +1,17 @@ '\" te .\" Copyright 1989 AT&T. Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright 2015 Circonus, 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 PSIGNAL 3C "Mar 31, 2005" +.TH PSIGNAL 3C "Aug 14, 2014" .SH NAME psignal, psiginfo \- system signal messages .SH SYNOPSIS .LP .nf -#include <siginfo.h> +#include <signal.h> \fBvoid\fR \fBpsignal\fR(\fBint\fR \fIsig\fR, \fBconst char *\fR\fIs\fR); .fi @@ -28,7 +29,9 @@ that may have been passed as the first argument to a signal handler. The \fIpinfo\fR argument is a pointer to a \fBsiginfo\fR structure that may have been passed as the second argument to an enhanced signal handler. See \fBsigaction\fR(2). The argument string \fIs\fR is printed first, followed by a -colon and a blank, followed by the message and a \fBNEWLINE\fR character. +colon and a blank, followed by the message and a \fBNEWLINE\fR character. If +\fBs\fR is the value \fBNULL\fR or an empty string, then nothing is printed for +the user's string and the colon and blank are omitted. .SH USAGE .LP Messages printed from these functions are in the native language specified by diff --git a/usr/src/man/man3c/putenv.3c b/usr/src/man/man3c/putenv.3c index 05e7f01594..d5b59a42fe 100644 --- a/usr/src/man/man3c/putenv.3c +++ b/usr/src/man/man3c/putenv.3c @@ -1,5 +1,6 @@ '\" 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. +.\" Copyright 2016 Joyent, Inc. .\" 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. @@ -19,7 +20,6 @@ putenv \- change or add value to environment .fi .SH DESCRIPTION -.sp .LP The \fBputenv()\fR function makes the value of the environment variable \fIname\fR equal to \fIvalue\fR by altering an existing variable or creating a @@ -29,7 +29,11 @@ the environment, so altering the string will change the environment. .LP The \fIstring\fR argument points to a string of the form \fIname\fR\fB=\fR\fIvalue\fR. The space used by \fIstring\fR is no longer used -once a new string-defining \fIname\fR is passed to \fBputenv()\fR. +once a new string-defining \fIname\fR is passed to \fBputenv()\fR. If +there is no equals sign (\fB=\fR) present as a separator, then +\fIstring\fR is treated as the \fIname\fR of an environment variable to +remove from the environment, as though \fBunsetenv\fR(3C) had been +called. .sp .LP The \fBputenv()\fR function uses \fBmalloc\fR(3C) to enlarge the environment. @@ -38,12 +42,10 @@ The \fBputenv()\fR function uses \fBmalloc\fR(3C) to enlarge the environment. After \fBputenv()\fR is called, environment variables are not in alphabetical order. .SH RETURN VALUES -.sp .LP Upon successful completion, \fBputenv()\fR returns 0. Otherwise, it returns a non-zero value and sets \fBerrno\fR to indicate the error. .SH ERRORS -.sp .LP The \fBputenv()\fR function may fail if: .sp @@ -56,7 +58,6 @@ Insufficient memory was available. .RE .SH USAGE -.sp .LP The \fBputenv()\fR function can be safely called from multithreaded programs. Caution must be exercised when using this function and \fBgetenv\fR(3C) in @@ -66,7 +67,6 @@ list from being accessed simultaneously by two different threads. It does not, however, prevent two threads from successively accessing the environment list using \fBputenv()\fR or \fBgetenv()\fR. .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -84,12 +84,10 @@ MT-Level Safe .TE .SH SEE ALSO -.sp .LP \fBexec\fR(2), \fBgetenv\fR(3C), \fBmalloc\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5) .SH WARNINGS -.sp .LP The \fIstring\fR argument should not be an automatic variable. It should be declared static if it is declared within a function because it cannot be diff --git a/usr/src/man/man3c/signalfd.3c b/usr/src/man/man3c/signalfd.3c index ad7bafca1a..f08e85b273 100644 --- a/usr/src/man/man3c/signalfd.3c +++ b/usr/src/man/man3c/signalfd.3c @@ -8,9 +8,9 @@ .\" source. A copy of the CDDL is also available via the Internet at .\" http://www.illumos.org/license/CDDL. .\" -.\" Copyright 2015, Joyent, Inc. +.\" Copyright 2016, Joyent, Inc. .\" -.Dd "April 9, 2016" +.Dd "May 05, 2016" .Dt SIGNALFD 3C .Os .Sh NAME @@ -150,6 +150,20 @@ typedef struct signalfd_siginfo { uint8_t ssi_pad[48]; /* pad size to 128 bytes */ } signalfd_siginfo_t; .Ed +.Sh NOTES +File descriptor duplication during fork presents a challenge to the +.Sy signalfd +facility since signal data and events are dependent on the process from which +they are queried. Its use with caching event systems such as +.Xr epoll 5 , +.Sy /dev/poll , +or +.Xr port_create 3C +can result in undefined behavior if signalfd and polling descriptors are used +together after being shared across a fork. Such restrictions do not apply if +the child only calls +.Xr close 2 +on the descriptors. .Sh RETURN VALUES Upon successful completion, a file descriptor associated with the instance is returned. Otherwise, -1 is returned and errno is set to indicate the error. @@ -187,6 +201,8 @@ Unable to allocate state for the file descriptor. .Sh SEE ALSO .Xr poll 2 , .Xr sigwait 2 , +.Xr port_create 3C , .Xr sigsetops 3C , .Xr sigwaitinfo 3C , -.Xr signal.h 3HEAD +.Xr signal.h 3HEAD , +.Xr epoll 5 diff --git a/usr/src/man/man3c/timer_create.3c b/usr/src/man/man3c/timer_create.3c index 2f93e954e3..f57bf1d25f 100644 --- a/usr/src/man/man3c/timer_create.3c +++ b/usr/src/man/man3c/timer_create.3c @@ -9,7 +9,7 @@ .\" 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 TIMER_CREATE 3C "Sep 15, 2015" +.TH TIMER_CREATE 3C "Mar 24, 2016" .SH NAME timer_create \- create a timer .SH SYNOPSIS @@ -125,17 +125,6 @@ system. The specified clock \fBID\fR, \fIclock_id\fR, is not defined. .RE -.sp -.ne 2 -.na -\fB\fBEPERM\fR\fR -.ad -.RS 10n -The specified clock \fBID\fR, \fIclock_id\fR, is \fBCLOCK_HIGHRES\fR and the -{\fBPRIV_PROC_CLOCK_HIGHRES\fR} is not asserted in the effective set of the -calling process. -.RE - .SH ATTRIBUTES .LP See \fBattributes\fR(5) for descriptions of the following attributes: @@ -159,5 +148,4 @@ Standard See \fBstandards\fR(5). .LP \fBexec\fR(2), \fBfork\fR(2), \fBtime\fR(2), \fBclock_settime\fR(3C), \fBsignal\fR(3C), \fBsignal.h\fR(3HEAD), \fBtimer_delete\fR(3C), -\fBtimer_settime\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5), -\fBstandards\fR(5) +\fBtimer_settime\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5) diff --git a/usr/src/man/man3c/timer_settime.3c b/usr/src/man/man3c/timer_settime.3c index 543f042aba..8ae32ccc91 100644 --- a/usr/src/man/man3c/timer_settime.3c +++ b/usr/src/man/man3c/timer_settime.3c @@ -1,5 +1,6 @@ '\" te .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2016, Joyent, Inc. .\" 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 @@ -9,7 +10,7 @@ .\" 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 TIMER_SETTIME 3C "Feb 5, 2008" +.TH TIMER_SETTIME 3C "Mar 24, 2016" .SH NAME timer_settime, timer_gettime, timer_getoverrun \- per-process timers .SH SYNOPSIS @@ -103,6 +104,12 @@ set to \fBDELAYTIMER_MAX\fR. The value returned by \fBtimer_getoverrun()\fR applies to the most recent expiration signal delivery or acceptance for the timer. If no expiration signal has been delivered for the timer, the meaning of the overrun count returned is undefined. +.sp +.LP +If the specified timer is of type \fBCLOCK_HIGHRES\fR and the time value is +smaller than a system defined threshold, then {\fBPRIV_PROC_CLOCK_HIGHRES\fR} +must be asserted in the effective set of the calling process or the time values +will be adjusted up to the threshold value. .SH RETURN VALUES .sp .LP @@ -171,4 +178,5 @@ Standard See \fBstandards\fR(5). .sp .LP \fBtime.h\fR(3HEAD), \fBclock_settime\fR(3C), \fBtimer_create\fR(3C), -\fBtimer_delete\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5) +\fBtimer_delete\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5), +\fBstandards\fR(5) |