Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen Add man pages for posix_spawn_file_actions_add{...



details:   https://anonhg.NetBSD.org/src/rev/b48472868d70
branches:  trunk
changeset: 1026264:b48472868d70
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Nov 15 14:01:50 2021 +0000

description:
Add man pages for posix_spawn_file_actions_add{f,}chdir from piyush

diffstat:

 distrib/sets/lists/comp/mi                       |    8 +-
 lib/libc/gen/Makefile.inc                        |    4 +-
 lib/libc/gen/posix_spawn.3                       |    4 +-
 lib/libc/gen/posix_spawn_file_actions_addchdir.3 |  164 +++++++++++++++++++++++
 4 files changed, 177 insertions(+), 3 deletions(-)

diffs (247 lines):

diff -r 53380d0d60e6 -r b48472868d70 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Mon Nov 15 13:59:16 2021 +0000
+++ b/distrib/sets/lists/comp/mi        Mon Nov 15 14:01:50 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2397 2021/10/29 19:12:29 macallan Exp $
+#      $NetBSD: mi,v 1.2398 2021/11/15 14:01:50 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -9287,6 +9287,8 @@
 ./usr/share/man/cat3/posix_spawn_file_actions_addclose.0       comp-c-catman           .cat
 ./usr/share/man/cat3/posix_spawn_file_actions_adddup2.0 comp-c-catman          .cat
 ./usr/share/man/cat3/posix_spawn_file_actions_addopen.0 comp-c-catman          .cat
+./usr/share/man/cat3/posix_spawn_file_actions_addfchdir.0 comp-c-catman                .cat
+./usr/share/man/cat3/posix_spawn_file_actions_addchdir.0 comp-c-catman         .cat
 ./usr/share/man/cat3/posix_spawn_file_actions_destroy.0 comp-c-catman          .cat
 ./usr/share/man/cat3/posix_spawn_file_actions_init.0   comp-c-catman           .cat
 ./usr/share/man/cat3/posix_spawnattr_destroy.0 comp-c-catman           .cat
@@ -17565,6 +17567,8 @@
 ./usr/share/man/html3/posix_spawn_file_actions_addclose.html   comp-c-htmlman          html
 ./usr/share/man/html3/posix_spawn_file_actions_adddup2.html    comp-c-htmlman          html
 ./usr/share/man/html3/posix_spawn_file_actions_addopen.html    comp-c-htmlman          html
+./usr/share/man/html3/posix_spawn_file_actions_addfchdir.html  comp-c-htmlman          html
+./usr/share/man/html3/posix_spawn_file_actions_addchdir.html   comp-c-htmlman          html
 ./usr/share/man/html3/posix_spawn_file_actions_destroy.html    comp-c-htmlman          html
 ./usr/share/man/html3/posix_spawn_file_actions_init.html       comp-c-htmlman          html
 ./usr/share/man/html3/posix_spawnattr_destroy.html     comp-c-htmlman          html
@@ -25833,6 +25837,8 @@
 ./usr/share/man/man3/posix_spawn_file_actions_addclose.3       comp-c-man              .man
 ./usr/share/man/man3/posix_spawn_file_actions_adddup2.3 comp-c-man             .man
 ./usr/share/man/man3/posix_spawn_file_actions_addopen.3 comp-c-man             .man
+./usr/share/man/man3/posix_spawn_file_actions_addfchdir.3 comp-c-man           .man
+./usr/share/man/man3/posix_spawn_file_actions_addchdir.3 comp-c-man            .man
 ./usr/share/man/man3/posix_spawn_file_actions_destroy.3 comp-c-man             .man
 ./usr/share/man/man3/posix_spawn_file_actions_init.3   comp-c-man              .man
 ./usr/share/man/man3/posix_spawnattr_destroy.3 comp-c-man              .man
diff -r 53380d0d60e6 -r b48472868d70 lib/libc/gen/Makefile.inc
--- a/lib/libc/gen/Makefile.inc Mon Nov 15 13:59:16 2021 +0000
+++ b/lib/libc/gen/Makefile.inc Mon Nov 15 14:01:50 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.214 2021/05/03 11:07:55 simonb Exp $
+#      $NetBSD: Makefile.inc,v 1.215 2021/11/15 14:01:51 christos Exp $
 #      from: @(#)Makefile.inc  8.6 (Berkeley) 5/4/95
 
 # gen sources
@@ -73,6 +73,7 @@
        nice.3 nlist.3 \
        pause.3 popen.3 \
        posix_spawn.3 posix_spawn_file_actions_addopen.3 \
+       posix_spawn_file_actions_addchdir.3 \
        posix_spawn_file_actions_init.3 posix_spawnattr_getflags.3 \
        posix_spawnattr_getpgroup.3 posix_spawnattr_getschedparam.3 \
        posix_spawnattr_getschedpolicy.3 posix_spawnattr_init.3 \
@@ -159,6 +160,7 @@
 MLINKS+=posix_spawn.3 posix_spawnp.3 \
        posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \
        posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_adddup2.3 \
+       posix_spawn_file_actions_addchdir.3 posix_spawn_file_actions_addfchdir.3 \
        posix_spawn_file_actions_init.3 posix_spawn_file_actions_destroy.3 \
        posix_spawnattr_getflags.3 posix_spawnattr_setflags.3 \
        posix_spawnattr_getpgroup.3 posix_spawnattr_setpgroup.3 \
diff -r 53380d0d60e6 -r b48472868d70 lib/libc/gen/posix_spawn.3
--- a/lib/libc/gen/posix_spawn.3        Mon Nov 15 13:59:16 2021 +0000
+++ b/lib/libc/gen/posix_spawn.3        Mon Nov 15 14:01:50 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: posix_spawn.3,v 1.11 2019/06/12 12:32:54 wiz Exp $
+.\" $NetBSD: posix_spawn.3,v 1.12 2021/11/15 14:01:51 christos Exp $
 .\"
 .\" Copyright (c) 2008 Ed Schouten <ed%FreeBSD.org@localhost>
 .\" All rights reserved.
@@ -445,6 +445,8 @@
 .Xr posix_spawn_file_actions_addclose 3 ,
 .Xr posix_spawn_file_actions_adddup2 3 ,
 .Xr posix_spawn_file_actions_addopen 3 ,
+.Xr posix_spawn_file_actions_addchdir 3 ,
+.Xr posix_spawn_file_actions_addfchdir 3 ,
 .Xr posix_spawn_file_actions_destroy 3 ,
 .Xr posix_spawn_file_actions_init 3 ,
 .Xr posix_spawnattr_destroy 3 ,
diff -r 53380d0d60e6 -r b48472868d70 lib/libc/gen/posix_spawn_file_actions_addchdir.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/gen/posix_spawn_file_actions_addchdir.3  Mon Nov 15 14:01:50 2021 +0000
@@ -0,0 +1,164 @@
+.\" $NetBSD: posix_spawn_file_actions_addchdir.3,v 1.1 2021/11/15 14:01:51 christos Exp $
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" Portions of this text are reprinted and reproduced in electronic form
+.\" 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 this version 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.
+.\"
+.Dd July 8, 2020
+.Dt POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR 3
+.Os
+.Sh NAME
+.Nm posix_spawn_file_actions_addchdir ,
+.Nm posix_spawn_file_actions_addfchdir
+.Nd "add chdir or fchdir action to spawn file actions object"
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In spawn.h
+.Ft int
+.Fn posix_spawn_file_actions_addchdir "posix_spawn_file_actions_t *restrict file_actions" "const char *restrict path"
+.Ft int
+.Fn posix_spawn_file_actions_addfchdir "posix_spawn_file_actions_t * file_actions" "int fildes"
+.Sh DESCRIPTION
+The
+.Fn posix_spawn_file_actions_addchdir
+function shall add a chdir action to the object referenced by
+.Fa file_actions
+that shall cause the working directory to be set to
+.Fa path
+(as if
+.Bd -literal -offset indent
+chdir(path)
+.Ed
+.Pp
+had been called) when a new process is spawned usign this file actions
+object.
+A relative
+.Fa path
+shall be interpreted in relation to the working directory determined by any
+prior actions.
+The string pointed to by
+.Fa path
+shall be copied by the
+.Fn posix_spawn_file_actions_addchdir
+function.
+.Pp
+The
+.Fn posix_spawn_file_actions_addfchdir
+function shall add a fchdir action to the object reference by
+.Fa file_actions
+that shall cause the working directory to be set to
+.Fa fildes
+(as if
+.Bd -literal -offset indent
+fchdir(fildes)
+.Ed
+.Pp
+had been called) when a new process is spawned using this file actions object.
+.\" The last paragraph of APPLICATION USAGE
+.Pp
+File actions are performed in the new process created by
+.Fn posix_spawn
+or
+.Fn posix_spawnp
+in the same order that they were added to the file actions object.
+Thus the execution of an "open" action that was created by a call to
+.Fn posix_spawn_file_actions_addopen
+that specifies a relative path will be affected by the execution of a
+chdir or fchdir action that was created by a previous call to
+.Fn posix_spawn_file_actions_addchdir
+or
+.Fn posix_spawn_file_actions_addfchdir
+\&. Likewise, a relaive path passed to
+.Fn posix_spawn
+will be affected by the last chdir or fchdir action in the file action list.
+.Sh RETURN VALUES
+Upon successful completion, these function return zero;
+otherwise, an error number shall be returned to indicate the error.
+.Sh ERRORS
+The
+.Fn posix_spawn_file_actions_addfchdir
+function shall fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+The value specified by
+.Fa fildes
+is negative.
+.El
+.Pp
+These functions shall fail if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient memory exists to add the spawn file actions object.
+.El
+.Pp
+These functions may fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The value specified by
+.Fa file_actions
+is invalid.
+.El
+.Pp
+It shall not be considered an error for the
+.Fa path
+or
+.Fa fildes
+argument passed to these functions to specify a pathanme or file descriptor
+for which the specified operation could not be performed at the time of the call.
+Any such error will be detected when the associated file actions object is
+later used during a
+.Fn posix_spawn
+or
+.Fn posix_spawnp
+operation.
+.Sh SEE ALSO
+.Xr chdir 2 ,
+.Xr fchdir 2 ,
+.Xr posix_spawn 3 ,
+.Xr posix_spawn_file_actions_destroy 3 ,
+.Xr posix_spawn_file_actions_init 3 ,
+.Xr posix_spawnp 3
+.Sh STANDARDS
+The
+.Fn posix_spawn_file_actions_addchdir
+and
+.Fn posix_spawn_file_actions_addfchdir
+functions conform to
+.St -p1003.1-2001 .
+.Sh HISTORY
+The POSIX implementation of
+.Fn posix_spawn_file_actions_addchdir
+and
+.Fn posix_spawn_file_actions_addfchdir
+is derived from SOLARIS kernel's
+.Fn posix_spawn_file_actions_addchdir_np .
+.Sh AUTHORS
+.An Piyush Sachdeva



Home | Main Index | Thread Index | Old Index