Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Unified Diff: fusl/src/process/execle.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/process/execl.c ('k') | fusl/src/process/execlp.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/process/execle.c
diff --git a/fusl/src/process/execle.c b/fusl/src/process/execle.c
new file mode 100644
index 0000000000000000000000000000000000000000..37ca50349ac21db3d4789688046e31da0b16b57a
--- /dev/null
+++ b/fusl/src/process/execle.c
@@ -0,0 +1,23 @@
+#include <unistd.h>
+#include <stdarg.h>
+
+int execle(const char *path, const char *argv0, ...)
+{
+ int argc;
+ va_list ap;
+ va_start(ap, argv0);
+ for (argc=1; va_arg(ap, const char *); argc++);
+ va_end(ap);
+ {
+ int i;
+ char *argv[argc+1];
+ char **envp;
+ va_start(ap, argv0);
+ argv[0] = (char *)argv0;
+ for (i=1; i<=argc; i++)
+ argv[i] = va_arg(ap, char *);
+ envp = va_arg(ap, char **);
+ va_end(ap);
+ return execve(path, argv, envp);
+ }
+}
« no previous file with comments | « fusl/src/process/execl.c ('k') | fusl/src/process/execlp.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698