1 diff --git a/src/loslib.c b/src/loslib.c
2 index e65e188..3595601 100644
6 ** Standard Operating System library
7 ** See Copyright Notice in lua.h
10 +#if defined(__APPLE__)
11 +#include <TargetConditionals.h>
16 @@ -143,7 +145,12 @@ static int os_execute (lua_State *L) {
17 const char *cmd = luaL_optstring(L, 1, NULL);
21 +#if defined(__APPLE__) && !TARGET_OS_OSX
22 + // system() is __IOS_PROHIBITED, __WATCHOS_PROHIBITED, and __TVOS_PROHIBITED.
23 + stat = 127; // error: shell execution failed
28 return luaL_execresult(L, stat);