Fix QNX build.

Note: this is not an officially supported target.
Contributed by Wen Yang.
This commit is contained in:
Mike Pall 2022-09-12 11:16:20 +02:00
parent 03080b795a
commit e19db60512
3 changed files with 8 additions and 1 deletions

View File

@ -93,6 +93,9 @@
#elif defined(__CYGWIN__)
#define LJ_TARGET_CYGWIN 1
#define LUAJIT_OS LUAJIT_OS_POSIX
#elif defined(__QNX__)
#define LJ_TARGET_QNX 1
#define LUAJIT_OS LUAJIT_OS_POSIX
#else
#define LUAJIT_OS LUAJIT_OS_OTHER
#endif

View File

@ -125,7 +125,7 @@ static PRGR libfunc_rgr;
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
#define LJ_TARGET_HAS_GETENTROPY 1
#endif
#elif (LJ_TARGET_BSD && !defined(__NetBSD__)) || LJ_TARGET_SOLARIS || LJ_TARGET_CYGWIN
#elif (LJ_TARGET_BSD && !defined(__NetBSD__)) || LJ_TARGET_SOLARIS || LJ_TARGET_CYGWIN || LJ_TARGET_QNX
#define LJ_TARGET_HAS_GETENTROPY 1
#endif

View File

@ -185,7 +185,11 @@ static void profile_timer_start(ProfileState *ps)
tm.it_value.tv_sec = tm.it_interval.tv_sec = interval / 1000;
tm.it_value.tv_usec = tm.it_interval.tv_usec = (interval % 1000) * 1000;
setitimer(ITIMER_PROF, &tm, NULL);
#if LJ_TARGET_QNX
sa.sa_flags = 0;
#else
sa.sa_flags = SA_RESTART;
#endif
sa.sa_handler = profile_signal;
sigemptyset(&sa.sa_mask);
sigaction(SIGPROF, &sa, &ps->oldsa);