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)
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 @@
14 14
15#include "evil_private.h" 15#include "evil_private.h"
16 16
17#ifdef _MSC_VER
18EVIL_API int
19execvp(const char *file, char *const argv[])
20{
21 return _execvp(file, (const char *const *)argv);
22}
23#endif
17 24
18LONGLONG _evil_time_freq; 25LONGLONG _evil_time_freq;
19LONGLONG _evil_time_count; 26LONGLONG _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 @@
18 18
19#include <io.h> // for read, write, access, close 19#include <io.h> // for read, write, access, close
20 20
21#define execvp _ucrt_execvp // overriding execvp below
22#include <process.h> // for _execvp (but not execvp), getpid
23#undef execvp
24EVIL_API int execvp(const char *file, char *const argv[]);
25
26/* Values for the second argument to access. These may be OR'd together. */
27#define R_OK 4 /* Test for read permission. */
28#define W_OK 2 /* Test for write permission. */
29#define X_OK 0 /* execute permission, originally '1', just a bypass here*/
30#define F_OK 0 /* Test for existence. */
31
21#endif // _MSC_VER 32#endif // _MSC_VER
22 33
23/* 34/*