summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 15:43:55 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 16:10:26 -0300
commit81a1b4eac326da03bd92c9c04944faf822e43a3a (patch)
treeb47717f3155539333ba0da49019548c93f6af78c
parent04a25307c51480f75078dba621f1b5cdbe1daeb6 (diff)
downloadefl-81a1b4eac326da03bd92c9c04944faf822e43a3a.tar.gz
evil: Add execvp based on UCRT's _execvp
-rw-r--r--src/lib/evil/evil_unistd.c7
-rw-r--r--src/lib/evil/evil_unistd.h11
2 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/evil/evil_unistd.c b/src/lib/evil/evil_unistd.c
index 5c02c69e91..5c065bee9a 100644
--- a/src/lib/evil/evil_unistd.c
+++ b/src/lib/evil/evil_unistd.c
@@ -14,6 +14,13 @@
#include "evil_private.h"
+#ifdef _MSC_VER
+EVIL_API int
+execvp(const char *file, char *const argv[])
+{
+ return _execvp(file, (const char *const *)argv);
+}
+#endif
LONGLONG _evil_time_freq;
LONGLONG _evil_time_count;
diff --git a/src/lib/evil/evil_unistd.h b/src/lib/evil/evil_unistd.h
index 9d3e0de048..9f7b324af9 100644
--- a/src/lib/evil/evil_unistd.h
+++ b/src/lib/evil/evil_unistd.h
@@ -18,6 +18,17 @@
#include <io.h> // for read, write, access, close
+#define execvp _ucrt_execvp // overriding execvp below
+#include <process.h> // for _execvp (but not execvp), getpid
+#undef execvp
+EVIL_API int execvp(const char *file, char *const argv[]);
+
+/* Values for the second argument to access. These may be OR'd together. */
+#define R_OK 4 /* Test for read permission. */
+#define W_OK 2 /* Test for write permission. */
+#define X_OK 0 /* execute permission, originally '1', just a bypass here*/
+#define F_OK 0 /* Test for existence. */
+
#endif // _MSC_VER
/*