pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/53581: devel/lua-posix build problems: CLOCK_{PROCESS,THREAD}_CPUTIME_ID undefined
>Number: 53581
>Category: pkg
>Synopsis: devel/lua-posix build problems: CLOCK_{PROCESS,THREAD}_CPUTIME_ID undefined
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 06 15:30:00 +0000 2018
>Originator: Edgar FuÃ?
>Release: pkgsrc-2018Q2
>Organization:
Mathematisches Institur der Universität Bonn
>Description:
If _POSIX_TIMERS is defined and not -1, lua-posix tries to use CLOCK_{PROCESS,THREAD}_CPUTIME_ID. On NetBSD 6/7, these are not defined.
>How-To-Repeat:
Build devel/lua-posix on NetBSD<8
>Fix:
I don't know whether the fault is with luaposix to infer CLOCK_{PROCESS,THREAD}_CPUTIME_ID being defined when _POSIX_TIMERS is or with NetBSD to define the latter, but not the former, so I haven't (yet) reported this upstream.
However, the following patch seems to work:
$NetBSD: patch-ext_posix_time.c$
Only use CLOCK_{PROCESS,THREAD}_CPUTIME_ID if defined
--- ext/posix/time.c.orig 2018-02-21 03:29:31.000000000 +0100
+++ ext/posix/time.c 2018-08-31 19:43:01.000000000 +0200
@@ -350,10 +350,14 @@ luaopen_posix_time(lua_State *L)
#if defined _POSIX_TIMERS && _POSIX_TIMERS != -1
LPOSIX_CONST( CLOCK_MONOTONIC );
+#if defined CLOCK_PROCESS_CPUTIME_ID
LPOSIX_CONST( CLOCK_PROCESS_CPUTIME_ID );
+#endif
LPOSIX_CONST( CLOCK_REALTIME );
+#if defined CLOCK_THREAD_CPUTIME_ID
LPOSIX_CONST( CLOCK_THREAD_CPUTIME_ID );
#endif
+#endif
return 1;
}
Home |
Main Index |
Thread Index |
Old Index