Skip to content

Commit 2bd5f0d

Browse files
committed
Added missing _fexecl function needed by BASIC chain
1 parent cbe5f1a commit 2bd5f0d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

include/libc/unix/execl.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,25 @@ int _execl(const char *path, const char *arg0, ...)
2626
va_end(args);
2727
return r;
2828
}
29+
30+
static int _fexeclv(int fd, const char *arg0, va_list args)
31+
{
32+
static const char *argv[MAX_ARGC];
33+
int argc = 0;
34+
35+
do {
36+
argv[argc++] = arg0;
37+
arg0 = va_arg(args, const char *);
38+
} while (arg0 && argc < MAX_ARGC);
39+
return _fexecve(fd, argv, NULL);
40+
}
41+
42+
int _fexecl(int fd, const char *arg0, ...)
43+
{
44+
int r;
45+
va_list args;
46+
va_start(args, arg0);
47+
r = _fexeclv(fd, arg0, args);
48+
va_end(args);
49+
return r;
50+
}

include/sys/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ extern "C" {
6565

6666
int _execve(const char *path, char **args, char **env) _COMPLEXIO _IMPL("libc/unix/exec.c");
6767
int _execl(const char *path, const char *arg0, ...) _COMPLEXIO _IMPL("libc/unix/execl.c");
68+
int _fexecve(int fd, char **args, char **env) _COMPLEXIO _IMPL("libc/unix/exec.c");
69+
int _fexecl(int fd, const char *arg0, ...) _COMPLEXIO _IMPL("libc/unix/execl.c");
6870

6971
#if defined(__cplusplus)
7072
}

0 commit comments

Comments
 (0)