Print this page
9842 man page typos and spelling
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man2/exec.2
+++ new/usr/src/man/man2/exec.2
1 1 .\"
2 2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 3 .\" permission to reproduce portions of its copyrighted documentation.
4 4 .\" Original documentation from The Open Group can be obtained online at
5 5 .\" http://www.opengroup.org/bookstore/.
6 6 .\"
7 7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 8 .\" Group, have given us permission to reprint portions of their
9 9 .\" documentation.
10 10 .\"
11 11 .\" In the following statement, the phrase ``this text'' refers to portions
12 12 .\" of the system documentation.
13 13 .\"
14 14 .\" Portions of this text are reprinted and reproduced in electronic form
15 15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 16 .\" Standard for Information Technology -- Portable Operating System
17 17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 20 .\" between these versions and the original IEEE and The Open Group
21 21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 22 .\" document. The original Standard can be obtained online at
23 23 .\" http://www.opengroup.org/unix/online.html.
24 24 .\"
25 25 .\" This notice shall appear on any product containing this material.
26 26 .\"
27 27 .\" The contents of this file are subject to the terms of the
28 28 .\" Common Development and Distribution License (the "License").
29 29 .\" You may not use this file except in compliance with the License.
30 30 .\"
31 31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 32 .\" or http://www.opensolaris.org/os/licensing.
33 33 .\" See the License for the specific language governing permissions
34 34 .\" and limitations under the License.
35 35 .\"
36 36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 38 .\" If applicable, add the following below this CDDL HEADER, with the
39 39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 41 .\"
42 42 .\"
43 43 .\" Copyright 1989 AT&T.
44 44 .\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
45 45 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
46 46 .\" Copyright 2015, Joyent, Inc.
47 47 .\"
48 48 .TH EXEC 2 "Oct 27, 2015"
49 49 .SH NAME
50 50 exec, execl, execle, execlp, execv, execve, execvp \- execute a file
51 51 .SH SYNOPSIS
52 52 .LP
53 53 .nf
54 54 #include <unistd.h>
55 55
56 56 \fBint\fR \fBexecl\fR(\fBconst char *\fR\fIpath\fR, \fBconst char *\fR\fIarg0\fR, \fB\&...
57 57 /* const char *\fR\fIargn\fR, \fB(char *)0 */);\fR
58 58 .fi
59 59
60 60 .LP
61 61 .nf
62 62 \fBint\fR \fBexecv\fR(\fBconst char *\fR\fIpath\fR, \fBchar *const\fR \fIargv[]\fR);
63 63 .fi
64 64
65 65 .LP
66 66 .nf
67 67 \fBint\fR \fBexecle\fR(\fBconst char *\fR\fIpath\fR, \fBconst char *\fR\fIarg0\fR, \fB\&...
68 68 /* const char *\fR\fIargn\fR, \fB(char *)0\fR,\fBchar *const\fR \fIenvp\fR[]*/);
69 69 .fi
70 70
71 71 .LP
72 72 .nf
73 73 \fBint\fR \fBexecve\fR(\fBconst char *\fR\fIpath\fR, \fBchar *const\fR \fIargv[]\fR,
74 74 \fBchar *const\fR \fIenvp[]\fR);
75 75 .fi
76 76
77 77 .LP
78 78 .nf
79 79 \fBint\fR \fBexeclp\fR(\fBconst char *\fR\fIfile\fR, \fBconst char *\fR\fIarg0\fR, \fB\&...
80 80 /* const char *\fR\fIargn\fR, \fB(char *)0 */);\fR
81 81 .fi
82 82
83 83 .LP
84 84 .nf
85 85 \fBint\fR \fBexecvp\fR(\fBconst char *\fR\fIfile\fR, \fBchar *const\fR \fIargv[]\fR);
86 86 .fi
87 87
88 88 .SH DESCRIPTION
89 89 .LP
90 90 Each of the functions in the \fBexec\fR family replaces the current process
91 91 image with a new process image. The new image is constructed from a regular,
92 92 executable file called the \fBnew process image file\fR. This file is either an
93 93 executable object file or a file of data for an interpreter. There is no return
94 94 from a successful call to one of these functions because the calling process
95 95 image is overlaid by the new process image.
96 96 .sp
97 97 .LP
98 98 An interpreter file begins with a line of the form
99 99 .sp
100 100 .in +2
101 101 .nf
102 102 #! pathname [\fIarg\fR]
103 103 .fi
104 104 .in -2
105 105
106 106 .sp
107 107 .LP
108 108 where \fIpathname\fR is the path of the interpreter, and \fIarg\fR is an
109 109 optional argument. When an interpreter file is executed, the system invokes the
110 110 specified interpreter. The pathname specified in the interpreter file is passed
111 111 as \fIarg0\fR to the interpreter. If \fIarg\fR was specified in the interpreter
112 112 file, it is passed as \fIarg1\fR to the interpreter. The remaining arguments to
113 113 the interpreter are \fIarg0\fR through \fIargn\fR of the originally exec'd
114 114 file. The interpreter named by \fIpathname\fR may also be an interpreter file.
115 115 There can be up to four nested interpreter files before the final interpreter.
116 116 The setid bits on nested interpreters are silently ignored.
117 117 .sp
118 118 .LP
119 119 When a C-language program is executed as a result of this call, it is entered
120 120 as a C-language function call as follows:
121 121 .sp
122 122 .in +2
123 123 .nf
124 124 int main (int argc, char *argv[]);
125 125 .fi
126 126 .in -2
127 127
128 128 .sp
129 129 .LP
130 130 where \fIargc\fR is the argument count and \fIargv\fR is an array of character
131 131 pointers to the arguments themselves. In addition, the following variable:
132 132 .sp
133 133 .in +2
134 134 .nf
135 135 extern char **environ;
136 136 .fi
137 137 .in -2
138 138
139 139 .sp
140 140 .LP
141 141 is initialized as a pointer to an array of character pointers to the
142 142 environment strings. The \fIargv\fR and \fIenviron\fR arrays are each
143 143 terminated by a null pointer. The null pointer terminating the \fIargv\fR array
144 144 is not counted in \fIargc\fR.
145 145 .sp
146 146 .LP
147 147 The value of \fIargc\fR is non-negative, and if greater than 0, \fIargv\fR[0]
148 148 points to a string containing the name of the file. If \fIargc\fR is 0,
149 149 \fIargv\fR[0] is a null pointer, in which case there are no arguments.
150 150 Applications should verify that \fIargc\fR is greater than 0 or that
151 151 \fIargv\fR[0] is not a null pointer before dereferencing \fIargv\fR[0].
152 152 .sp
153 153 .LP
154 154 The arguments specified by a program with one of the \fBexec\fR functions are
155 155 passed on to the new process image in the \fBmain()\fR arguments.
156 156 .sp
157 157 .LP
158 158 The \fIpath\fR argument points to a path name that identifies the new process
159 159 image file.
160 160 .sp
161 161 .LP
162 162 The \fIfile\fR argument is used to construct a pathname that identifies the new
163 163 process image file. If the \fIfile\fR argument contains a slash character, it
164 164 is used as the pathname for this file. Otherwise, the path prefix for this file
165 165 is obtained by a search of the directories passed in the \fBPATH\fR environment
166 166 variable (see \fBenviron\fR(5)). The environment is supplied typically by the
167 167 shell. If the process image file is not a valid executable object file,
168 168 \fBexeclp()\fR and \fBexecvp()\fR use the contents of that file as standard
169 169 input to the shell. In this case, the shell becomes the new process image. The
170 170 standard to which the caller conforms determines which shell is used. See
171 171 \fBstandards\fR(5).
172 172 .sp
173 173 .LP
174 174 The arguments represented by \fIarg0\fR\&.\|.\|. are pointers to
175 175 null-terminated character strings. These strings constitute the argument list
176 176 available to the new process image. The list is terminated by a null pointer.
177 177 The \fIarg0\fR argument should point to a filename that is associated with the
178 178 process being started by one of the \fBexec\fR functions.
179 179 .sp
180 180 .LP
181 181 The \fIargv\fR argument is an array of character pointers to null-terminated
182 182 strings. The last member of this array must be a null pointer. These strings
183 183 constitute the argument list available to the new process image. The value in
184 184 \fIargv\fR[0] should point to a filename that is associated with the process
185 185 being started by one of the \fBexec\fR functions.
186 186 .sp
187 187 .LP
188 188 The \fIenvp\fR argument is an array of character pointers to null-terminated
189 189 strings. These strings constitute the environment for the new process image.
190 190 The \fIenvp\fR array is terminated by a null pointer. For \fBexecl()\fR,
191 191 \fBexecv()\fR, \fBexecvp()\fR, and \fBexeclp()\fR, the C-language run-time
192 192 start-off routine places a pointer to the environment of the calling process in
193 193 the global object \fBextern char **environ\fR, and it is used to pass the
194 194 environment of the calling process to the new process image.
195 195 .sp
196 196 .LP
197 197 The number of bytes available for the new process's combined argument and
198 198 environment lists is \fBARG_MAX\fR. It is implementation-dependent whether null
199 199 terminators, pointers, and/or any alignment bytes are included in this total.
200 200 .sp
201 201 .LP
202 202 File descriptors open in the calling process image remain open in the new
203 203 process image, except for those whose close-on-exec flag \fBFD_CLOEXEC\fR is
204 204 set; see \fBfcntl\fR(2). For those file descriptors that remain open, all
205 205 attributes of the open file description, including file locks, remain
206 206 unchanged.
207 207 .sp
208 208 .LP
209 209 The preferred hardware address translation size (see \fBmemcntl\fR(2)) for the
210 210 stack and heap of the new process image are set to the default system page
211 211 size.
212 212 .sp
213 213 .LP
214 214 Directory streams open in the calling process image are closed in the new
215 215 process image.
216 216 .sp
217 217 .LP
218 218 The state of conversion descriptors and message catalogue descriptors in the
219 219 new process image is undefined. For the new process, the equivalent of:
220 220 .sp
221 221 .in +2
222 222 .nf
223 223 setlocale(LC_ALL, "C")
224 224 .fi
225 225 .in -2
226 226
227 227 .sp
228 228 .LP
229 229 is executed at startup.
230 230 .sp
231 231 .LP
232 232 Signals set to the default action (\fBSIG_DFL\fR) in the calling process image
233 233 are set to the default action in the new process image (see \fBsignal\fR(3C)).
234 234 Signals set to be ignored (\fBSIG_IGN\fR) by the calling process image are set
235 235 to be ignored by the new process image. Signals set to be caught by the calling
236 236 process image are set to the default action in the new process image (see
237 237 \fBsignal.h\fR(3HEAD)). After a successful call to any of the \fBexec\fR
238 238 functions, alternate signal stacks are not preserved and the \fBSA_ONSTACK\fR
239 239 flag is cleared for all signals.
240 240 .sp
241 241 .LP
242 242 After a successful call to any of the \fBexec\fR functions, any functions
243 243 previously registered by \fBatexit\fR(3C) are no longer registered.
244 244 .sp
245 245 .LP
246 246 The saved resource limits in the new process image are set to be a copy of the
247 247 process's corresponding hard and soft resource limits.
248 248 .sp
249 249 .LP
250 250 If the \fBST_NOSUID\fR bit is set for the file system containing the new
251 251 process image file, then the effective user \fBID\fR and effective group
252 252 \fBID\fR are unchanged in the new process image. If the set-user-\fBID\fR mode
253 253 bit of the new process image file is set (see \fBchmod\fR(2)), the effective
254 254 user \fBID\fR of the new process image is set to the owner \fBID\fR of the new
255 255 process image file. Similarly, if the set-group-\fBID\fR mode bit of the new
256 256 process image file is set, the effective group \fBID\fR of the new process
257 257 image is set to the group \fBID\fR of the new process image file. The real user
258 258 \fBID\fR and real group \fBID\fR of the new process image remain the same as
259 259 those of the calling process image. The effective user ID and effective group
260 260 ID of the new process image are saved (as the saved set-user-ID and the saved
261 261 set-group-ID for use by \fBsetuid\fR(2).
262 262 .sp
263 263 .LP
264 264 The privilege sets are changed according to the following rules:
265 265 .RS +4
266 266 .TP
267 267 1.
268 268 The inheritable set, I, is intersected with the limit set, L. This
269 269 mechanism enforces the limit set for processes.
270 270 .RE
271 271 .RS +4
272 272 .TP
273 273 2.
274 274 The effective set, E, and the permitted set, P, are made equal to the new
275 275 inheritable set.
276 276 .RE
277 277 .sp
278 278 .LP
279 279 The system attempts to set the privilege-aware state to non-PA both before
280 280 performing any modifications to the process IDs and privilege sets as well as
281 281 after completing the transition to new UIDs and privilege sets, following the
282 282 rules outlined in \fBprivileges\fR(5).
283 283 .sp
284 284 .LP
285 285 If the {\fBPRIV_PROC_OWNER\fR} privilege is asserted in the effective set, the
286 286 set-user-ID and set-group-ID bits will be honored when the process is being
287 287 controlled by \fBptrace\fR(3C). Additional restriction can apply when the
288 288 traced process has an effective UID of 0. See \fBprivileges\fR(5).
289 289 .sp
290 290 .LP
291 291 Any shared memory segments attached to the calling process image will not be
292 292 attached to the new process image (see \fBshmop\fR(2)). Any mappings
293 293 established through \fBmmap()\fR are not preserved across an \fBexec\fR. Memory
294 294 mappings created in the process are unmapped before the address space is
295 295 rebuilt for the new process image. See \fBmmap\fR(2).
296 296 .sp
297 297 .LP
298 298 Memory locks established by the calling process via calls to \fBmlockall\fR(3C)
299 299 or \fBmlock\fR(3C) are removed. If locked pages in the address space of the
300 300 calling process are also mapped into the address spaces the locks established
301 301 by the other processes will be unaffected by the call by this process to the
302 302 \fBexec\fR function. If the \fBexec\fR function fails, the effect on memory
303 303 locks is unspecified.
304 304 .sp
305 305 .LP
306 306 If \fB_XOPEN_REALTIME\fR is defined and has a value other than \(mi1, any named
307 307 semaphores open in the calling process are closed as if by appropriate calls to
308 308 \fBsem_close\fR(3C)
309 309 .sp
310 310 .LP
311 311 Profiling is disabled for the new process; see \fBprofil\fR(2).
312 312 .sp
313 313 .LP
314 314 Timers created by the calling process with \fBtimer_create\fR(3C) are deleted
315 315 before replacing the current process image with the new process image.
316 316 .sp
317 317 .LP
318 318 For the \fBSCHED_FIFO\fR and \fBSCHED_RR\fR scheduling policies, the policy and
319 319 priority settings are not changed by a call to an \fBexec\fR function.
320 320 .sp
321 321 .LP
322 322 All open message queue descriptors in the calling process are closed, as
323 323 described in \fBmq_close\fR(3C).
324 324 .sp
325 325 .LP
326 326 Any outstanding asynchronous I/O operations may be cancelled. Those
327 327 asynchronous I/O operations that are not canceled will complete as if the
328 328 \fBexec\fR function had not yet occurred, but any associated signal
329 329 notifications are suppressed. It is unspecified whether the \fBexec\fR function
330 330 itself blocks awaiting such I/O completion. In no event, however, will the new
331 331 process image created by the \fBexec\fR function be affected by the presence of
332 332 outstanding asynchronous I/O operations at the time the \fBexec\fR function is
333 333 called.
334 334 .sp
335 335 .LP
336 336 All active contract templates are cleared (see \fBcontract\fR(4)).
337 337 .sp
338 338 .LP
339 339 The new process also inherits the following attributes from the calling
340 340 process:
341 341 .RS +4
342 342 .TP
343 343 .ie t \(bu
344 344 .el o
345 345 controlling terminal
346 346 .RE
347 347 .RS +4
348 348 .TP
349 349 .ie t \(bu
350 350 .el o
351 351 current working directory
352 352 .RE
353 353 .RS +4
354 354 .TP
355 355 .ie t \(bu
356 356 .el o
357 357 file-locks (see \fBfcntl\fR(2) and \fBlockf\fR(3C))
358 358 .RE
359 359 .RS +4
360 360 .TP
361 361 .ie t \(bu
362 362 .el o
363 363 file mode creation mask (see \fBumask\fR(2))
364 364 .RE
365 365 .RS +4
366 366 .TP
367 367 .ie t \(bu
368 368 .el o
369 369 file size limit (see \fBulimit\fR(2))
370 370 .RE
371 371 .RS +4
372 372 .TP
373 373 .ie t \(bu
374 374 .el o
375 375 limit privilege set
376 376 .RE
377 377 .RS +4
378 378 .TP
379 379 .ie t \(bu
380 380 .el o
381 381 nice value (see \fBnice\fR(2))
382 382 .RE
383 383 .RS +4
384 384 .TP
385 385 .ie t \(bu
386 386 .el o
387 387 parent process \fBID\fR
388 388 .RE
389 389 .RS +4
390 390 .TP
391 391 .ie t \(bu
392 392 .el o
393 393 pending signals (see \fBsigpending\fR(2))
394 394 .RE
395 395 .RS +4
396 396 .TP
397 397 .ie t \(bu
398 398 .el o
399 399 privilege debugging flag (see \fBprivileges\fR(5) and \fBgetpflags\fR(2))
400 400 .RE
401 401 .RS +4
402 402 .TP
403 403 .ie t \(bu
404 404 .el o
405 405 process \fBID\fR
406 406 .RE
407 407 .RS +4
408 408 .TP
409 409 .ie t \(bu
410 410 .el o
411 411 process contract (see \fBcontract\fR(4) and \fBprocess\fR(4))
412 412 .RE
413 413 .RS +4
414 414 .TP
415 415 .ie t \(bu
416 416 .el o
417 417 process group \fBID\fR
418 418 .RE
419 419 .RS +4
420 420 .TP
421 421 .ie t \(bu
422 422 .el o
423 423 process signal mask (see \fBsigprocmask\fR(2))
424 424 .RE
425 425 .RS +4
426 426 .TP
427 427 .ie t \(bu
428 428 .el o
429 429 processor bindings (see \fBprocessor_bind\fR(2))
430 430 .RE
431 431 .RS +4
432 432 .TP
433 433 .ie t \(bu
434 434 .el o
435 435 processor set bindings (see \fBpset_bind\fR(2))
436 436 .RE
437 437 .RS +4
438 438 .TP
439 439 .ie t \(bu
440 440 .el o
441 441 project \fBID\fR
442 442 .RE
443 443 .RS +4
444 444 .TP
445 445 .ie t \(bu
446 446 .el o
447 447 real group \fBID\fR
448 448 .RE
449 449 .RS +4
450 450 .TP
451 451 .ie t \(bu
452 452 .el o
453 453 real user \fBID\fR
454 454 .RE
455 455 .RS +4
456 456 .TP
457 457 .ie t \(bu
458 458 .el o
459 459 resource limits (see \fBgetrlimit\fR(2))
460 460 .RE
461 461 .RS +4
462 462 .TP
463 463 .ie t \(bu
464 464 .el o
465 465 root directory
466 466 .RE
467 467 .RS +4
468 468 .TP
469 469 .ie t \(bu
470 470 .el o
471 471 scheduler class and priority (see \fBpriocntl\fR(2))
472 472 .RE
473 473 .RS +4
474 474 .TP
475 475 .ie t \(bu
476 476 .el o
477 477 \fBsemadj\fR values (see \fBsemop\fR(2))
478 478 .RE
479 479 .RS +4
480 480 .TP
481 481 .ie t \(bu
482 482 .el o
483 483 session membership (see \fBexit\fR(2) and \fBsignal\fR(3C))
484 484 .RE
485 485 .RS +4
486 486 .TP
487 487 .ie t \(bu
488 488 .el o
489 489 supplementary group \fBIDs\fR
490 490 .RE
491 491 .RS +4
492 492 .TP
493 493 .ie t \(bu
494 494 .el o
495 495 task \fBID\fR
496 496 .RE
497 497 .RS +4
498 498 .TP
499 499 .ie t \(bu
500 500 .el o
501 501 time left until an alarm clock signal (see \fBalarm\fR(2))
502 502 .RE
503 503 .RS +4
504 504 .TP
505 505 .ie t \(bu
506 506 .el o
507 507 \fBtms_utime\fR, \fBtms_stime\fR, \fBtms_cutime\fR, and \fBtms_cstime\fR (see
508 508 \fBtimes\fR(2))
509 509 .RE
510 510 .RS +4
511 511 .TP
512 512 .ie t \(bu
513 513 .el o
514 514 trace flag (see \fBptrace\fR(3C) request 0)
515 515 .RE
516 516 .sp
517 517 .LP
518 518 A call to any \fBexec\fR function from a process with more than one thread
519 519 results in all threads being terminated and the new executable image being
520 520 loaded and executed. No destructor functions will be called.
521 521 .sp
522 522 .LP
523 523 Upon successful completion, each of the functions in the \fBexec\fR family
524 524 marks for update the \fBst_atime\fR field of the file. If an \fBexec\fR
525 525 function failed but was able to locate the \fBprocess image file\fR, whether
526 526 the \fBst_atime\fR field is marked for update is unspecified. Should the
527 527 function succeed, the process image file is considered to have been opened with
528 528 \fBopen\fR(2). The corresponding \fBclose\fR(2) is considered to occur at a
529 529 time after this open, but before process termination or successful completion
530 530 of a subsequent call to one of the \fBexec\fR functions. The \fIargv\fR[\|] and
531 531 \fIenvp\fR[\|] arrays of pointers and the strings to which those arrays point
532 532 will not be modified by a call to one of the \fBexec\fR functions, except as a
533 533 consequence of replacing the process image.
534 534 .sp
535 535 .LP
536 536 The saved resource limits in the new process image are set to be a copy of the
537 537 process's corresponding hard and soft limits.
538 538 .SH RETURN VALUES
539 539 .LP
540 540 If a function in the \fBexec\fR family returns to the calling process image, an
541 541 error has occurred; the return value is \fB\(mi1\fR and \fBerrno\fR is set to
542 542 indicate the error.
543 543 .SH ERRORS
544 544 .LP
545 545 The \fBexec\fR functions will fail if:
546 546 .sp
547 547 .ne 2
548 548 .na
549 549 \fB\fBE2BIG\fR\fR
550 550 .ad
551 551 .RS 16n
552 552 The number of bytes in the new process's argument list is greater than the
553 553 system-imposed limit of {\fBARG_MAX\fR} bytes. The argument list limit is sum
554 554 of the size of the argument list plus the size of the environment's exported
555 555 shell variables.
556 556 .RE
557 557
558 558 .sp
559 559 .ne 2
560 560 .na
561 561 \fB\fBEACCES\fR\fR
562 562 .ad
563 563 .RS 16n
564 564 Search permission is denied for a directory listed in the new process file's
565 565 path prefix.
566 566 .sp
567 567 The new process file is not an ordinary file.
568 568 .sp
569 569 The new process file mode denies execute permission.
570 570 .sp
571 571 The {\fBFILE_DAC_SEARCH\fR} privilege overrides the restriction on directory
572 572 searches.
573 573 .sp
574 574 The {\fBFILE_DAC_EXECUTE\fR} privilege overrides the lack of execute
575 575 permission.
576 576 .RE
577 577
578 578 .sp
579 579 .ne 2
580 580 .na
581 581 \fB\fBEAGAIN\fR\fR
582 582 .ad
583 583 .RS 16n
584 584 Total amount of system memory available when reading using raw I/O is
585 585 temporarily insufficient.
586 586 .RE
587 587
588 588 .sp
589 589 .ne 2
590 590 .na
591 591 \fB\fBEFAULT\fR\fR
592 592 .ad
593 593 .RS 16n
594 594 An argument points to an illegal address.
595 595 .RE
596 596
597 597 .sp
598 598 .ne 2
599 599 .na
600 600 \fB\fBEINVAL\fR\fR
601 601 .ad
602 602 .RS 16n
603 603 The new process image file has the appropriate permission and has a recognized
604 604 executable binary format, but the system does not support execution of a file
605 605 with this format.
606 606 .RE
607 607
608 608 .sp
609 609 .ne 2
610 610 .na
611 611 \fB\fBEINTR\fR\fR
612 612 .ad
613 613 .RS 16n
614 614 A signal was caught during the execution of one of the functions in the
615 615 \fIexec\fR family.
616 616 .RE
617 617
618 618 .sp
619 619 .ne 2
620 620 .na
621 621 \fB\fBELOOP\fR\fR
622 622 .ad
623 623 .RS 16n
624 624 Too many symbolic links were encountered in translating \fIpath\fR or
625 625 \fIfile\fR, or too many nested interpreter files.
626 626 .RE
627 627
628 628 .sp
629 629 .ne 2
630 630 .na
631 631 \fB\fBENAMETOOLONG\fR\fR
632 632 .ad
633 633 .RS 16n
634 634 The length of the \fIfile\fR or \fIpath\fR argument exceeds {\fBPATH_MAX\fR},
635 635 or the length of a \fIfile\fR or \fIpath\fR component exceeds {\fBNAME_MAX\fR}
636 636 while {\fB_POSIX_NO_TRUNC\fR} is in effect.
637 637 .RE
638 638
639 639 .sp
640 640 .ne 2
641 641 .na
642 642 \fB\fBENOENT\fR\fR
643 643 .ad
644 644 .RS 16n
645 645 One or more components of the new process path name of the file do not exist or
646 646 is a null pathname.
647 647 .RE
648 648
649 649 .sp
650 650 .ne 2
651 651 .na
652 652 \fB\fBENOLINK\fR\fR
653 653 .ad
654 654 .RS 16n
655 655 The \fIpath\fR argument points to a remote machine and the link to that machine
656 656 is no longer active.
657 657 .RE
658 658
659 659 .sp
660 660 .ne 2
661 661 .na
662 662 \fB\fBENOTDIR\fR\fR
663 663 .ad
664 664 .RS 16n
665 665 A component of the new process path of the file prefix is not a directory.
666 666 .RE
667 667
668 668 .sp
669 669 .LP
670 670 The \fBexec\fR functions, except for \fBexeclp()\fR and \fBexecvp()\fR, will
671 671 fail if:
672 672 .sp
673 673 .ne 2
674 674 .na
675 675 \fB\fBENOEXEC\fR\fR
676 676 .ad
677 677 .RS 11n
678 678 The new process image file has the appropriate access permission but is not in
679 679 the proper format.
680 680 .RE
681 681
682 682 .sp
683 683 .LP
684 684 The \fBexec\fR functions may fail if:
685 685 .sp
686 686 .ne 2
687 687 .na
688 688 \fB\fBENAMETOOLONG\fR\fR
689 689 .ad
690 690 .RS 16n
691 691 Pathname resolution of a symbolic link produced an intermediate result whose
692 692 length exceeds {\fBPATH_MAX\fR}.
693 693 .RE
694 694
695 695 .sp
696 696 .ne 2
697 697 .na
698 698 \fB\fBENOMEM\fR\fR
699 699 .ad
700 700 .RS 16n
701 701 The new process image requires more memory than is allowed by the hardware or
702 702 system-imposed by memory management constraints. See \fBbrk\fR(2).
703 703 .RE
704 704
705 705 .sp
706 706 .ne 2
707 707 .na
708 708 \fB\fBETXTBSY\fR\fR
709 709 .ad
710 710 .RS 16n
711 711 The new process image file is a pure procedure (shared text) file that is
712 712 currently open for writing by some process.
713 713 .RE
714 714
715 715 .SH USAGE
716 716 .LP
717 717 As the state of conversion descriptors and message catalogue descriptors in the
718 718 new process image is undefined, portable applications should not rely on their
719 719 use and should close them prior to calling one of the \fBexec\fR functions.
720 720 .sp
721 721 .LP
722 722 Applications that require other than the default POSIX locale should call
723 723 \fBsetlocale\fR(3C) with the appropriate parameters to establish the locale of
724 724 thenew process.
725 725 .sp
726 726 .LP
727 727 The \fIenviron\fR array should not be accessed directly by the application.
728 728 .SH ATTRIBUTES
729 729 .LP
730 730 See \fBattributes\fR(5) for descriptions of the following attributes:
731 731 .sp
732 732
733 733 .sp
734 734 .TS
735 735 box;
736 736 c | c
737 737 l | l .
738 738 ATTRIBUTE TYPE ATTRIBUTE VALUE
↓ open down ↓ |
738 lines elided |
↑ open up ↑ |
739 739 _
740 740 Interface Stability Committed
741 741 _
742 742 MT-Level See below.
743 743 _
744 744 Standard See \fBstandards\fR(5).
745 745 .TE
746 746
747 747 .sp
748 748 .LP
749 -The \fBexecle()\fR and \fBexecve()\fR fucntions are Async-Signal-Safe.
749 +The \fBexecle()\fR and \fBexecve()\fR functions are Async-Signal-Safe.
750 750 .SH SEE ALSO
751 751 .LP
752 752 \fBksh\fR(1), \fBps\fR(1), \fBsh\fR(1), \fBalarm\fR(2), \fBbrk\fR(2),
753 753 \fBchmod\fR(2), \fBexit\fR(2), \fBfcntl\fR(2), \fBfork\fR(2),
754 754 \fBgetpflags\fR(2), \fBgetrlimit\fR(2), \fBmemcntl\fR(2), \fBmmap\fR(2),
755 755 \fBnice\fR(2), \fBpriocntl\fR(2), \fBprofil\fR(2), \fBsemop\fR(2),
756 756 \fBshmop\fR(2), \fBsigpending\fR(2), \fBsigprocmask\fR(2), \fBtimes\fR(2),
757 757 \fBumask\fR(2), \fBlockf\fR(3C), \fBptrace\fR(3C), \fBsetlocale\fR(3C),
758 758 \fBsignal\fR(3C), \fBsystem\fR(3C), \fBtimer_create\fR(3C), \fBa.out\fR(4),
759 759 \fBcontract\fR(4), \fBprocess\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
760 760 \fBprivileges\fR(5), \fBstandards\fR(5)
761 761 .SH WARNINGS
762 762 .LP
763 763 If a program is \fBsetuid\fR to a user \fBID\fR other than the superuser, and
764 764 the program is executed when the real user \fBID\fR is super-user, then the
765 765 program has some of the powers of a super-user as well.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX