'\" te .\" Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. .TH posix_spawn_file_actions_addchdir_np 3C "1 Apr 2015" "SunOS 5.11" "Standard C Library Functions" .SH NAME posix_spawn_file_actions_addchdir_np \- add chdir action to spawn file actions object .SH SYNOPSIS .LP .nf #include \fBint\fR \fBposix_spawn_file_actions_addchdir_np\fR( \fBposix_spawn_file_actions_t *\fR\fIrestrict file_actions\fR, \fBconst char *\fR\fIrestrict path\fR); .fi .SH DESCRIPTION .sp .LP The \fBposix_spawn_file_actions_addchdir_np()\fR function adds a \fBchdir\fR action to to the object referenced by \fIfile_actions\fR. This causes a new process that is spawned using this file actions object to change its working directory to path (see \fBchdir\fR(2)). .sp .LP A spawn file actions object is as defined in \fBposix_spawn_file_actions_addclose\fR(3C). .sp .LP File actions are performed in a new process created by \fBposix_spawn()\fR or \fBposix_spawnp()\fR in the same order that they were added to the file actions object. Thus, the execution of an \fBaddopen\fR action that was created by a call to \fBposix_spawn_file_actions_addopen()\fR that specifies a relative path will be affected by the execution of a \fBchdir\fR action that was created by a previous call to \fBposix_spawn_file_actions_addchdir_np()\fR. Likewise, a relative path passed to \fBposix_spawn()\fR is affected by the last \fBchdir\fR action in the file action list. .sp .LP The string described by path is copied by the \fBposix_spawn_file_actions_addchdir_np()\fR function. .SH RETURN VALUES .sp .LP Upon successful completion, \fBposix_spawn_file_actions_addchdir_np()\fR returns 0. Otherwise, an error number is returned to indicate the error. .SH ERRORS .sp .LP The \fBposix_spawn_file_actions_addchdir_np()\fR function may fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The value specified by \fIfile_actions\fR is invalid. .RE .sp .ne 2 .mk .na \fB\fBENOMEM\fR\fR .ad .RS 10n .rt Insufficient memory exists to add to the spawn file actions object. .RE .sp .LP It is not considered an error for the path argument passed to \fBposix_spawn_file_actions_addchdir_np()\fR to specify a path 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 \fBposix_spawn()\fR or \fBposix_spawnp()\fR operation. .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 \fBchdir\fR(2), \fBopen\fR(2), \fBposix_spawn\fR(3C), \fBposix_spawn_file_actions_addclose\fR(3C), \fBposix_spawn_file_actions_addopen\fR(3C), \fBposix_spawn_file_actions_destroy\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)