diff --git a/include/bits/unistd.h b/include/bits/unistd.h new file mode 100644 index 0000000000..a7167d047a --- /dev/null +++ b/include/bits/unistd.h @@ -0,0 +1,7 @@ +#ifndef _BITS_UNISTD_H +#define _BITS_UNISTD_H + +int execl(const char *path, const char* argv0, ...); +int execle(const char *path, const char* argv0, ...); + +#endif diff --git a/include/bits/exec.h b/src/c/unistd.c similarity index 82% rename from include/bits/exec.h rename to src/c/unistd.c index 242f02781f..a2a78ce727 100644 --- a/include/bits/exec.h +++ b/src/c/unistd.c @@ -1,7 +1,7 @@ -#ifndef _BITS_EXEC_H -#define _BITS_EXEC_H +#include +#include -extern int execv(const char *path, char *const *argv); +int execv(const char *path, char *const *argv); int execl(const char *path, const char* argv0, ...) { @@ -24,7 +24,7 @@ int execl(const char *path, const char* argv0, ...) } } -extern int execve(const char *path, char *const *argv, char *const *envp); +int execve(const char *path, char *const *argv, char *const *envp); int execle(const char *path, const char* argv0, ...) { diff --git a/src/unistd/cbindgen.toml b/src/unistd/cbindgen.toml index ef4ad8123a..a10250c6dd 100644 --- a/src/unistd/cbindgen.toml +++ b/src/unistd/cbindgen.toml @@ -1,6 +1,6 @@ -sys_includes = ["stddef.h", "stdint.h", "sys/types.h", "stdarg.h", "bits/exec.h"] +sys_includes = ["stddef.h", "stdint.h", "sys/types.h"] include_guard = "_UNISTD_H" -trailer = "#include " +trailer = "#include \n#include " language = "C" [enum]