bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ENODATA required


From: Bruno Haible
Subject: Re: ENODATA required
Date: Thu, 8 Oct 2009 23:50:38 +0200
User-agent: KMail/1.9.9

Jim Meyering wrote:
> I have written wrappers for getfilecon, lgetfilecon,
> and fgetfilecon each of which uses ENODATA to distinguish
> a particular failure mode from ENOTSUP:
> ...
> if it's easy to add support for ENODATA in the errno module,
> I'd prefer that, since the API for the getfilecon functions does
> mention ENODATA, and returning ENOTSUP here would be misleading.

It seems strange to me to use ENODATA here, because when you look at
POSIX <http://www.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html>
you see
  1) The ENODATA errno value is part of the "XSI Streams" extension of POSIX
     (which is supported only on few systems) and is marked "obsolescent".
  2) The description of the ENODATA errno is "No message is available on the
     STREAM head read queue."

ENODATA is present on glibc, NetBSD, AIX, HP-UX, IRIX, Solaris, OSF/1, Cygwin,
Haiku, Interix, and absent on MacOS X, FreeBSD, OpenBSD, mingw, BeOS.
MacOS X and FreeBSD so far don't need a gnulib override of <errno.h>.

But it's probably too late to change the specification of getfilecon by now
(since, as I understand it, SELinux is already in wide use for a couple of
years and getfilecon is a pretty central function in it).

So it sounds reasonable to me add ENODATA to gnulib's <errno.h> replacement
if explicitly requested. Like for the other GNU or random extensions, I'd
opt for a 'errno-gnu' module that would be like 'errno' except that it also
guarantees to define values like ENODATA.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]