Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | --- exec.3.orig 2009-12-15 13:07:38.000000000 -0800 +++ exec.3 2009-12-15 13:09:07.000000000 -0800 @@ -33,9 +33,8 @@ .Os .Sh NAME .Nm execl , -.Nm execlp , .Nm execle , -.Nm exect , +.Nm execlp , .Nm execv , .Nm execvp , .Nm execvP @@ -46,25 +45,43 @@ .In unistd.h .Vt extern char **environ ; .Ft int -.Fn execl "const char *path" "const char *arg" ... /* "(char *)0" */ -.Ft int -.Fn execlp "const char *file" "const char *arg" ... /* "(char *)0" */ +.Fo execl +.Fa "const char *path" +.Fa "const char *arg0" +.Fa ... /* "(char *)0" */ +.Fc .Ft int .Fo execle -.Fa "const char *path" "const char *arg" ... +.Fa "const char *path" +.Fa "const char *arg0" +.Fa ... .Fa /* .Bk -words .Fa "(char *)0" "char *const envp[]" */ .Ek .Fc .Ft int -.Fn exect "const char *path" "char *const argv[]" "char *const envp[]" +.Fo execlp +.Fa "const char *file" +.Fa "const char *arg0" +.Fa ... /* "(char *)0" */ +.Fc .Ft int -.Fn execv "const char *path" "char *const argv[]" +.Fo execv +.Fa "const char *path" +.Fa "char *const argv[]" +.Fc .Ft int -.Fn execvp "const char *file" "char *const argv[]" +.Fo execvp +.Fa "const char *file" +.Fa "char *const argv[]" +.Fc .Ft int -.Fn execvP "const char *file" "const char *search_path" "char *const argv[]" +.Fo execvP +.Fa "const char *file" +.Fa "const char *search_path" +.Fa "char *const argv[]" +.Fc .Sh DESCRIPTION The .Nm exec @@ -80,7 +97,7 @@ The initial argument for these functions is to be executed. .Pp The -.Fa "const char *arg" +.Fa "const char *arg0" and subsequent ellipses in the .Fn execl , .Fn execlp , @@ -102,7 +119,6 @@ be terminated by a pointer. .Pp The -.Fn exect , .Fn execv , .Fn execvp , and @@ -119,10 +135,8 @@ pointer. .Pp The .Fn execle -and -.Fn exect -functions also specify the environment of the executed process by following -the +function also specifies the environment of the executed process +by following the .Dv NULL pointer that terminates the list of arguments in the argument list or the pointer to the argv array with an additional argument. @@ -199,11 +213,6 @@ returned these functions will execute the shell with the path of the file as its first argument. (If this attempt fails, no further searching is done.) -.Pp -The function -.Fn exect -executes a file with the program tracing facilities enabled (see -.Xr ptrace 2 ) . .Sh RETURN VALUES If any of the .Fn exec @@ -277,7 +286,7 @@ The .Fn execl , .Fn execle , .Fn execlp , -.Fn execvp +.Fn execvp , and .Fn execvP functions @@ -289,11 +298,8 @@ and .Xr malloc 3 . .Pp The -.Fn exect -and .Fn execv -functions -may fail and set +function may fail and set .Va errno for any of the errors specified for the library function .Xr execve 2 . @@ -301,7 +307,6 @@ for any of the errors specified for the .Xr sh 1 , .Xr execve 2 , .Xr fork 2 , -.Xr ktrace 2 , .Xr ptrace 2 , .Xr environ 7 .Sh STANDARDS @@ -309,7 +314,7 @@ The .Fn execl , .Fn execv , .Fn execle , -.Fn execlp +.Fn execlp , and .Fn execvp functions |