diff --git a/runtime/basis/MLton/Process/spawne.c b/runtime/basis/MLton/Process/spawne.c index 51b2aa2877..bb32d86f2f 100644 --- a/runtime/basis/MLton/Process/spawne.c +++ b/runtime/basis/MLton/Process/spawne.c @@ -24,8 +24,8 @@ C_Errno_t(C_PId_t) MLton_Process_spawne (NullString8_t pNStr, eSaved = env[eLen - 1]; env[eLen - 1] = NULL; res = spawnve (SPAWN_MODE, path, - (const char * const *)args, - (const char * const *)env); + (char * const *)args, + (char * const *)env); /* spawnve failed */ args[aLen - 1] = aSaved; env[eLen - 1] = eSaved; diff --git a/runtime/basis/MLton/Process/spawnp.c b/runtime/basis/MLton/Process/spawnp.c index 91640c4457..d164366804 100644 --- a/runtime/basis/MLton/Process/spawnp.c +++ b/runtime/basis/MLton/Process/spawnp.c @@ -16,7 +16,7 @@ C_Errno_t(C_PId_t) MLton_Process_spawnp (NullString8_t pNStr, aSaved = args[aLen - 1]; args[aLen - 1] = NULL; res = spawnvp (SPAWN_MODE, path, - (const char * const *)args); + (char * const *)args); /* spawnvp failed */ args[aLen - 1] = aSaved; return (C_Errno_t(C_PId_t))res; diff --git a/runtime/basis/Net/Socket/Socket.c b/runtime/basis/Net/Socket/Socket.c index 2b3ebcfb8f..a96655e90e 100644 --- a/runtime/basis/Net/Socket/Socket.c +++ b/runtime/basis/Net/Socket/Socket.c @@ -151,7 +151,7 @@ Socket_Ctl_getSockOptC_Int (C_Sock_t s, C_Int_t level, C_Int_t optname, int out; MLton_initSockets (); - out = getsockopt (s, level, optname, optval, &optlen); + out = getsockopt (s, level, optname, (void*)optval, &optlen); assert (optlen == sizeof(int)); if (out == -1) MLton_fixSocketErrno (); @@ -165,7 +165,7 @@ Socket_Ctl_setSockOptC_Int (C_Sock_t s, C_Int_t level, C_Int_t optname, int out; MLton_initSockets (); - out = setsockopt (s, level, optname, &optval, optlen); + out = setsockopt (s, level, optname, (void*)&optval, optlen); if (out == -1) MLton_fixSocketErrno (); return out; @@ -179,7 +179,7 @@ Socket_Ctl_getSockOptC_Linger (C_Sock_t s, C_Int_t level, C_Int_t optname, int out; MLton_initSockets (); - out = getsockopt (s, level, optname, &optval, &optlen); + out = getsockopt (s, level, optname, (void*)&optval, &optlen); assert (optlen == sizeof(struct linger)); *((int*)optval_l_onoff) = optval.l_onoff; *((int*)optval_l_linger) = optval.l_linger; @@ -198,7 +198,7 @@ Socket_Ctl_setSockOptC_Linger (C_Sock_t s, C_Int_t level, C_Int_t optname, MLton_initSockets (); optval.l_onoff = optval_l_onoff; optval.l_linger = optval_l_linger; - out = setsockopt (s, level, optname, &optval, optlen); + out = setsockopt (s, level, optname, (void*)&optval, optlen); if (out == -1) MLton_fixSocketErrno (); return out; diff --git a/runtime/basis/Posix/Process/exece.c b/runtime/basis/Posix/Process/exece.c index b60590d5fc..e48d8862d4 100644 --- a/runtime/basis/Posix/Process/exece.c +++ b/runtime/basis/Posix/Process/exece.c @@ -21,8 +21,8 @@ C_Errno_t(C_Int_t) Posix_Process_exece (NullString8_t pNStr, eLen = GC_getSequenceLength((pointer)eStr); eSaved = env[eLen - 1]; env[eLen - 1] = NULL; - res = EXECVE (path, - (char * const *)args, + res = execve (path, + (char * const *)args, (char * const *)env); /* exece failed */ args[aLen - 1] = aSaved; diff --git a/runtime/basis/Posix/Process/execp.c b/runtime/basis/Posix/Process/execp.c index b9020303e9..d87288deb6 100644 --- a/runtime/basis/Posix/Process/execp.c +++ b/runtime/basis/Posix/Process/execp.c @@ -13,7 +13,7 @@ C_Errno_t(C_Int_t) Posix_Process_execp (NullString8_t fNStr, aLen = GC_getSequenceLength((pointer)aStr); aSaved = args[aLen - 1]; args[aLen - 1] = NULL; - res = EXECVP (file, + res = execvp (file, (char * const *)args); /* execp failed */ args[aLen - 1] = aSaved; diff --git a/runtime/platform.h b/runtime/platform.h index c88ea3b852..758ead7cbc 100644 --- a/runtime/platform.h +++ b/runtime/platform.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010,2012,2016,2019,2021 Matthew Fluet. +/* Copyright (C) 2010,2012,2016,2019,2021,2024 Matthew Fluet. * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh * Jagannathan, and Stephen Weeks. * Copyright (C) 1997-2000 NEC Research Institute. @@ -55,14 +55,6 @@ #error HAS_TIME_PROFILING not defined #endif -#ifndef EXECVP -#define EXECVP execvp -#endif - -#ifndef EXECVE -#define EXECVE execve -#endif - #define FE_NOSUPPORT -1 diff --git a/runtime/platform/mingw.h b/runtime/platform/mingw.h index 7441ee5e24..4f405c0e40 100644 --- a/runtime/platform/mingw.h +++ b/runtime/platform/mingw.h @@ -821,9 +821,6 @@ MLTON_WRAPPER int MLton_uname (struct utsname *buf); /* Posix.Process */ /* ------------------------------------------------- */ -#define EXECVE(path, args, env) \ - execve (path, (const char* const*)args, (const char* const*)env) -#define EXECVP(file, args) execvp (file, (const char* const*) args) #define SPAWN_MODE _P_NOWAIT /* Windows exit status comes from: