A mirror of Man pages
Go to file
Michael Kerrisk 8505c1f1d6 Date: Mon, 13 Dec 2004 12:09:43 +0100 (MET)
From: "Michael Kerrisk" <mtk-manpages@gmx.net>
To: Andries Brouwer <Andries.Brouwer@cwi.nl>
Subject: Re: errno

Hi Andries,

> On Fri, Dec 10, 2004 at 05:07:36PM +0100, Michael Kerrisk wrote:
> 
> > I added this text to fcntl.2:
> > 
> >     BUGS
> >        A  limitation of the Linux system call conventions means that
> >        if a (negative) process group ID to be returned  by  F_GETOWN
> >        falls  in  the  range  -1  to -4095, then the return value is
> >        wrongly interpreted by glibc as an error in the system  call;
> >        that  is,  the  return value of fcntl() will be -1, and errno
> >        will contain the (positive) process group ID.
> 
> Yes.
> 
> (Maybe glibc always did this, early libc considered any negative
> return value an error. On the other hand, not all the world is an i386 -
> IBM has just decided that we don't need any i386's anymore
> and sold their stuff to the Chinese - we must use PPC, as Linus
> does already - and on other architectures we do not have this
> ugliness, I think.)
> 
> You might consider adding "i386" somewhere:
>  A limitation of the Linux i386 system call conventions ...

Some testing on ia64 (RedHat EL 3.0, 2.4.21) and 
alpha (2.4.18, Debian 3.0) showed that any negative PGID value
causes F_GETOWN to fail.

My limited reading of the ia64 source:

sysdeps/unix/sysv/linux/ia64/sysdep.h

shows that there is a comment about the -4095 value there, 
but that doesn't seem to reflect the reality of the code.

Reading the source, the -4095 limit seems to hold on some 
other architectures, e.g.:

sysdeps/unix/sysv/linux/m68k/sysdep.h
sysdeps/unix/sysv/linux/hppa/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
sysdeps/unix/sysv/linux/x86_64/sysdep.h

Unfortunately, I have no non-x86 systems other than the above 
alpha and ia64 (HP-testdrive) on which I can test.

I modified the text a little:

   BUGS
       A  limitation  of the Linux system call conventions on some
       architectures (notably x86) means that if a (negative) pro&#8208;
       cess group ID to be returned by F_GETOWN falls in the range
       -1 to -4095, then the return value is  wrongly  interpreted
       by  glibc  as  an  error  in  the system call; that is, the
       return value of fcntl() will be -1, and errno will  contain
       the (positive) process group ID.

I've left a FIXME in the man page source noting that details have
yet to be sorted out for ia64, alpha, etc.
2004-12-13 11:32:37 +00:00
man0p Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man1 changed spelling of "super-user" to "superuser" 2004-11-10 18:17:26 +00:00
man1p Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man2 Date: Mon, 13 Dec 2004 12:09:43 +0100 (MET) 2004-12-13 11:32:37 +00:00
man3 Richard.Kreckel@ginac.de 2004-12-08 14:54:16 +00:00
man3p Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man4 Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man5 rtsig-max and rtsig-nr went away in 2.6.8 2004-12-01 15:25:42 +00:00
man6 Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man7 Martin Pool (and mtk) -- added O_NOATIME 2004-12-08 16:41:10 +00:00
man8 changed spelling of "super-user" to "superuser" 2004-11-10 18:17:26 +00:00
man9 Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
Makefile Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
POSIX-COPYRIGHT Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
README Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man-pages-1.70.Announce Import of man-pages 1.70 2004-11-03 13:51:07 +00:00
man-pages-1.70.lsm Import of man-pages 1.70 2004-11-03 13:51:07 +00:00

README

This package contains the Linux man pages for all chapters
except 1, 6 and 8. Some more information is given in the
`Announce' file.

Install by copying to your favourite location.
"make install" will just copy them to /usr/share/man/man[1-8].
"make" will move the pages from this package that are older than
the already installed ones to a subdirectory `not_installed',
then remove old versions (compressed or not),
compress the pages, and copy them to /usr/share/man/man[1-8].


Note that you may have to remove preformatted pages.

Note that sometimes these pages are duplicates of pages
also distributed in other packages. This has been reported
about dlclose.3, dlerror.3, dlopen.3, dlsym.3 (found in ld.so),
about resolver.3, resolv.conf.5 (found in bind-utils),
and about passwd.5, and mailaddr.7. Be careful not to
overwrite more up-to-date versions.
Reports on further duplicates are welcome.
Formerly present and now removed duplicates:
 *_module.2, get_kernel_syms.2 (found in modutils-2.1.*),
 exports.5 (found in nfs-server-2.2*),
 fstab.5, nfs.5 (found in util-linux-2.12*),
 lilo.8, lilo.conf.5 (found in lilo-21.6*).

Note that the pages that come with GNU fileutils are really
help texts (indeed, are generated automatically from help texts),
and worse than worthless. Without them people would have good
detailed man pages, such as those found here in man1.
As it is, many distributions install these "man pages",
to the detriment of their users.

Copyrights: These man pages come under various copyrights.
For the POSIX pages, see the file POSIX-COPYRIGHT.
All other pages are freely distributable when the nroff source is included.

Send corrections and additions to mtk-manpages@gmx.net
(man.7 has some info on the macros to use).