Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 13 Jun 2011 07:06:47 +0400
From: Solar Designer <solar@...nwall.com>
To: musl@...ts.openwall.com
Subject: setitimer(2) _XOPEN_SOURCE

Rich,

Here's an observation:

In glibc and on Solaris, setitimer(2) is defined by default.

In musl, it is not defined by default, but is defined with "#define
_XOPEN_SOURCE" or "#define _XOPEN_SOURCE 500" (as well as with some
other settings).

However, plain #define _XOPEN_SOURCE" (without the "500") results in
setitimer() no longer being defined on Solaris.  I guess Solaris
interprets plain _XOPEN_SOURCE as requesting an older version of the
standard specification than Solaris assumes by default.

Apparently, setitimer() was "First released in Issue 4, Version 2" and
"Moved from X/OPEN UNIX extension to BASE" in "Issue 5":

So maybe musl should only define setitimer() when _XOPEN_SOURCE is set
to 500 or higher, or when both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED
are set, or when _XPG4_2 is set?  You could want to check if Solaris
defines setitimer() with these (I did not).

Right now, if someone makes a program portable to musl by adding
"#define _XOPEN_SOURCE", they inadvertently break portability to Solaris
(this happened to me).  If you require 500+, that won't be the case (the
person will add "#define _XOPEN_SOURCE 500" right away).

Perhaps similar issues exist for other interfaces as well.

This is JFYI.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.