1 .\" Copyright (c) 2014 Google, Inc.
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH EXECVEAT 2 2014-04-02 "Linux" "Linux Programmer's Manual"
27 execveat \- execute program relative to a directory file descriptor
29 .B #include <unistd.h>
31 .BI "int execveat(int " fd ", const char *" pathname ","
33 .BI " char *const " argv "[], char *const " envp "[],"
39 system call executes the program pointed to by the combination of \fIfd\fP and \fIpathname\fP.
42 system call operates in exactly the same way as
44 except for the differences described in this manual page.
46 If the pathname given in
48 is relative, then it is interpreted relative to the directory
49 referred to by the file descriptor
51 (rather than relative to the current working directory of
52 the calling process, as is done by
54 for a relative pathname).
64 is interpreted relative to the current working
65 directory of the calling process (like
76 is an empty string and the
78 flag is specified, then the file descriptor
80 specifies the file to be executed.
83 can either be 0, or include the following flags:
88 is an empty string, operate on the file referred to by
90 (which may have been obtained using the
95 .B AT_SYMLINK_NOFOLLOW
96 If the file identified by
100 is a symbolic link, then the call fails with the error
105 does not return. On error \-1 is returned, and
107 is set appropriately.
109 The same errors that occur for
113 The following additional errors can occur for
118 is not a valid file descriptor.
121 The program identified by \fIfd\fP and \fIpathname\fP requires the
122 use of an interpreter program (such as a script starting with
123 "#!") but the file descriptor
127 flag and so the program file is inaccessible to the launched interpreter.
130 Invalid flag specified in
137 is a file descriptor referring to a file other than a directory.
140 was added to Linux in kernel 3.???.
142 In addition to the reasons explained in
146 system call is also needed to allow
148 to be implemented on systems that do not have the