repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
netinet/tcp.h: add TCP_NLA_* values up to linux v5.12
[musl.git]
/
src
/
process
/
execl.c
blob
5ee5c81e357c0756cb30bb4bb43c9adb6d35ae20
1
#include <unistd.h>
2
#include <stdarg.h>
3
4
int
execl
(
const char
*
path
,
const char
*
argv0
, ...)
5
{
6
int
argc
;
7
va_list
ap
;
8
va_start
(
ap
,
argv0
);
9
for
(
argc
=
1
;
va_arg
(
ap
,
const char
*);
argc
++);
10
va_end
(
ap
);
11
{
12
int
i
;
13
char
*
argv
[
argc
+
1
];
14
va_start
(
ap
,
argv0
);
15
argv
[
0
] = (
char
*)
argv0
;
16
for
(
i
=
1
;
i
<
argc
;
i
++)
17
argv
[
i
] =
va_arg
(
ap
,
char
*);
18
argv
[
i
] =
NULL
;
19
va_end
(
ap
);
20
return
execv
(
path
,
argv
);
21
}
22
}