summaryrefslogtreecommitdiff
path: root/libc/include
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2022-10-06 05:24:18 +0000
committerSiva Chandra Reddy <sivachandra@google.com>2022-10-06 19:50:23 +0000
commit3f965818b6a98f4dedba1a5c3517f661c018e62e (patch)
tree3938548b567d9e4547f28ff61d406f1e6fb6cada /libc/include
parenteaa583c330a280698b227ecc80e3f5a7ebfa0244 (diff)
downloadllvm-3f965818b6a98f4dedba1a5c3517f661c018e62e.tar.gz
[libc] Add POSIX execv and execve functions.
The POSIX global variable environ has also been added. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D135351
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/CMakeLists.txt2
-rw-r--r--libc/include/llvm-libc-types/CMakeLists.txt2
-rw-r--r--libc/include/llvm-libc-types/__exec_argv_t.h14
-rw-r--r--libc/include/llvm-libc-types/__exec_envp_t.h14
4 files changed, 32 insertions, 0 deletions
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 63f9dfe0b547..35336d38de8d 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -175,6 +175,8 @@ add_gen_header(
.llvm_libc_common_h
.llvm-libc-macros.file_seek_macros
.llvm-libc-macros.unistd_macros
+ .llvm-libc-types.__exec_argv_t
+ .llvm-libc-types.__exec_envp_t
.llvm-libc-types.off_t
.llvm-libc-types.pid_t
.llvm-libc-types.size_t
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index b9e87eb88899..ffce26d798b5 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -2,6 +2,8 @@ add_header(off64_t HDR off64_t.h)
add_header(size_t HDR size_t.h)
add_header(__bsearchcompare_t HDR __bsearchcompare_t.h)
add_header(__call_once_func_t HDR __call_once_func_t.h)
+add_header(__exec_argv_t HDR __exec_argv_t.h)
+add_header(__exec_envp_t HDR __exec_envp_t.h)
add_header(__futex_word HDR __futex_word.h)
add_header(__mutex_type HDR __mutex_type.h DEPENDS .__futex_word)
add_header(__pthread_once_func_t HDR __pthread_once_func_t.h)
diff --git a/libc/include/llvm-libc-types/__exec_argv_t.h b/libc/include/llvm-libc-types/__exec_argv_t.h
new file mode 100644
index 000000000000..35b687d9685d
--- /dev/null
+++ b/libc/include/llvm-libc-types/__exec_argv_t.h
@@ -0,0 +1,14 @@
+//===-- Definition of type __exec_argv_t ----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __LLVM_LIBC_TYPES_EXEC_ARGV_T_H__
+#define __LLVM_LIBC_TYPES_EXEC_ARGV_T_H__
+
+typedef char *const __exec_argv_t[];
+
+#endif // __LLVM_LIBC_TYPES_EXEC_ARGV_T_H__
diff --git a/libc/include/llvm-libc-types/__exec_envp_t.h b/libc/include/llvm-libc-types/__exec_envp_t.h
new file mode 100644
index 000000000000..06eb2ddcb1fb
--- /dev/null
+++ b/libc/include/llvm-libc-types/__exec_envp_t.h
@@ -0,0 +1,14 @@
+//===-- Definition of type __exec_envp_t ----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __LLVM_LIBC_TYPES_EXEC_ENVP_T_H__
+#define __LLVM_LIBC_TYPES_EXEC_ENVP_T_H__
+
+typedef char *const __exec_envp_t[];
+
+#endif // __LLVM_LIBC_TYPES_EXEC_ENVP_T_H__