From 4374aaf2b8c59544f9c39ededfdfe659eae9c9c0 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 12 Aug 2010 12:27:33 +1000 Subject: Improvements to jim configure Create and use config.h Check for backtrace, fork, vfork, syslog, regcomp and others Disable extensions which require missing functions/features Check for one arg vs. two arg mkdir() Distinguish between mingw and native windows The aio extension has reduced functionality for ANSI C only Signed-off-by: Steve Bennett --- jim-posix.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'jim-posix.c') diff --git a/jim-posix.c b/jim-posix.c index df8ed48..7aa266e 100644 --- a/jim-posix.c +++ b/jim-posix.c @@ -20,29 +20,26 @@ #include #include #include -#ifdef HAVE_SYSINFO -#include -#endif #include #include #include #include -#define JIM_EXTENSION #include "jim.h" +#ifdef HAVE_SYSINFO +#include +#endif + static void Jim_PosixSetError(Jim_Interp *interp) { Jim_SetResultString(interp, strerror(errno), -1); } +#ifdef HAVE_FORK static int Jim_PosixForkCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { -#ifdef JIM_NOFORK - Jim_SetResultString(interp, "Not supported", -1); - return JIM_ERR; -#else pid_t pid; JIM_NOTUSED(argv); @@ -56,8 +53,8 @@ static int Jim_PosixForkCommand(Jim_Interp *interp, int argc, } Jim_SetResultInt(interp, (jim_wide)pid); return JIM_OK; -#endif } +#endif /* * os.wait ?-nohang? pid @@ -217,7 +214,9 @@ int Jim_posixInit(Jim_Interp *interp) { if (Jim_PackageProvide(interp, "posix", "1.0", JIM_ERRMSG) != JIM_OK) return JIM_ERR; +#ifdef HAVE_FORK Jim_CreateCommand(interp, "os.fork", Jim_PosixForkCommand, NULL, NULL); +#endif Jim_CreateCommand(interp, "os.wait", Jim_PosixWaitCommand, NULL, NULL); Jim_CreateCommand(interp, "os.getids", Jim_PosixGetidsCommand, NULL, NULL); Jim_CreateCommand(interp, "os.gethostname", Jim_PosixGethostnameCommand, NULL, NULL); -- cgit v1.1