Open nwf-msr opened 1 year ago
I added the sys/types.h
include, but I think the time.h
include is already there?
Whoop, sorry, I dropped the ball here. Yes, the issue isn't that time.h
isn't being included, it's that it's sensitive to which version of POSIX is being requested, and on some old systems the default doesn't make CLOCK_REALTIME
available.
I'm sorry to have to report this, but POSIX gonna POSIX. On a Linux box calling itself an installation of "CentOS Linux 7 (Core)", apparently we need to adhere a little more strictly to POSIX. Specifically, the use of
ssize_t
in https://github.com/rems-project/sail/blob/f9db302f925418fc7aef5f97440ae89e4f43ff3d/lib/rts.c#L475 seems to require that we include<sys/types.h>
, and the use ofstruct timespec
in https://github.com/rems-project/sail/blob/f9db302f925418fc7aef5f97440ae89e4f43ff3d/lib/sail.c#L1790 requires that we include<time.h>
... and be targetingC11
or POSIX 1993.09 or later, and the use ofCLOCK_REALTIME
in https://github.com/rems-project/sail/blob/f9db302f925418fc7aef5f97440ae89e4f43ff3d/lib/sail.c#L1791 seems to specifically require POSIX 1993.09 or later.So, I think I would like it if
rts.c
grew a#include <sys/types.h>
andsail.c
grew a#include <time.h>
and had something liketacked on to the top? Failing that, maybe documenting the need to pass
-D_POSIX_C_SOURCE=200809L
to the compiler on sufficiently old systems would suffice? That said, I'm open to suggestions.