mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibC: Implement execle()
This commit is contained in:
parent
0e990a4be8
commit
7f4a1bc11e
2 changed files with 21 additions and 0 deletions
|
@ -160,6 +160,26 @@ int execl(const char* filename, const char* arg0, ...)
|
||||||
return execve(filename, const_cast<char* const*>(args.data()), environ);
|
return execve(filename, const_cast<char* const*>(args.data()), environ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int execle(char const* filename, char const* arg0, ...)
|
||||||
|
{
|
||||||
|
Vector<char const*> args;
|
||||||
|
args.append(arg0);
|
||||||
|
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, arg0);
|
||||||
|
char const* arg;
|
||||||
|
do {
|
||||||
|
arg = va_arg(ap, char const*);
|
||||||
|
args.append(arg);
|
||||||
|
} while (arg);
|
||||||
|
|
||||||
|
auto argv = const_cast<char* const*>(args.data());
|
||||||
|
auto envp = const_cast<char* const*>(va_arg(ap, char* const*));
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
return execve(filename, argv, envp);
|
||||||
|
}
|
||||||
|
|
||||||
int execlp(const char* filename, const char* arg0, ...)
|
int execlp(const char* filename, const char* arg0, ...)
|
||||||
{
|
{
|
||||||
Vector<const char*, 16> args;
|
Vector<const char*, 16> args;
|
||||||
|
|
|
@ -49,6 +49,7 @@ int execve(const char* filename, char* const argv[], char* const envp[]);
|
||||||
int execvpe(const char* filename, char* const argv[], char* const envp[]);
|
int execvpe(const char* filename, char* const argv[], char* const envp[]);
|
||||||
int execvp(const char* filename, char* const argv[]);
|
int execvp(const char* filename, char* const argv[]);
|
||||||
int execl(const char* filename, const char* arg, ...);
|
int execl(const char* filename, const char* arg, ...);
|
||||||
|
int execle(const char* filename, const char* arg, ...);
|
||||||
int execlp(const char* filename, const char* arg, ...);
|
int execlp(const char* filename, const char* arg, ...);
|
||||||
int chroot(const char* path);
|
int chroot(const char* path);
|
||||||
int chroot_with_mount_flags(const char* path, int mount_flags);
|
int chroot_with_mount_flags(const char* path, int mount_flags);
|
||||||
|
|
Loading…
Add table
Reference in a new issue