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

Unified Diff: fusl/src/process/execlp.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/execle.c ('k') | fusl/src/process/execv.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/process/execlp.c
diff --git a/fusl/src/process/execlp.c b/fusl/src/process/execlp.c
new file mode 100644
index 0000000000000000000000000000000000000000..5eed886e716fa9721bf953b877df19a89bd5718f
--- /dev/null
+++ b/fusl/src/process/execlp.c
@@ -0,0 +1,22 @@
+#include <unistd.h>
+#include <stdarg.h>
+
+int execlp(const char *file, 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];
+ va_start(ap, argv0);
+ argv[0] = (char *)argv0;
+ for (i=1; i<argc; i++)
+ argv[i] = va_arg(ap, char *);
+ argv[i] = NULL;
+ va_end(ap);
+ return execvp(file, argv);
+ }
+}
« no previous file with comments | « fusl/src/process/execle.c ('k') | fusl/src/process/execv.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698