[lsb-discuss] Inconsistency between glibc and POSIX fixed

Nick Stoughton nick at msbit.com
Wed Jun 21 15:39:02 PDT 2006

On Wed, 2006-06-21 at 16:37 -0400, Theodore Tso wrote:
> On Wed, Jun 21, 2006 at 12:15:19PM -0700, Nick Stoughton wrote:
> > Actually, in 3.1 we require the POSIX behavior. But glibc doesn't
> > provide it. So, we should be issuing waivers for 3.1, but refusing to do
> > so for 3.2.
> Ah, I didn't realize this; that puts a different complexion on things.
> The question though of how many applications that previously worked on
> pre-bugfix systems that may now break on post-bugfix systems is still
> an important one to consider.  

The answer to that question is a definitive NONE! This change makes the
specification more permissive, and does not change valid behavior in any

On pre-bugfix systems, programs that used a feature documented in the
LSB would core dump. On post-bugfix systems, such applications should
behave as advertised!

The issue is this:

The insque() function takes two arguments:
void insque(void *elem, void *prev);

The Linux man page for insque says "insque() inserts the element pointed
to by elem immediately after the element pointed to by prev, which must
not be NULL."

The LSB, however, says insque() behaves as described in POSIX, and POSIX
says "If the queue is to be used as a linear list, invoking
insque(&element, NULL), where element is the initial element of the
queue, shall initialize the forward and backward pointers of element to
null pointers."

Ulrich has updated glibc to implement the POSIX behavior. This behavior
was previously illegal, though the LSB said it was OK. No application is
known to have suffered from this problem (presumably, if they used
insque, they read the man page and handled it in an alternative way).

In fact, since insque() has been in the LSB since the beginning of time,
always as defined in POSIX, I'm not even convinced we should permit
waivers today. Especially now that there is a bug fix.

More information about the lsb-discuss mailing list