Commit Graph

117 Commits

Author SHA1 Message Date
Michael Kerrisk 105a35bc69 Changed size 2004-12-16 16:34:39 +00:00
Michael Kerrisk db81675e71 2004-12-16 15:39:14 +00:00
Michael Kerrisk 2180930213 2004-12-16 15:38:14 +00:00
Michael Kerrisk dde6ab6cd5 Changed size 2004-12-16 15:08:45 +00:00
Michael Kerrisk 063ef8c3a7 2.00 release files 2004-12-16 14:54:51 +00:00
Michael Kerrisk 9fe6a80667 2004-12-16 14:51:54 +00:00
Michael Kerrisk 168df94099 Enrico Zini
Added text to clarify that S_IS*() macros should be applied
to st_mode field.
as per: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=249698
2004-12-16 14:45:45 +00:00
Michael Kerrisk 8deb0f0d5b After bug report from John V. Belmonte
Updated init and quit scripts to reflect kernel 2.4/2.6 reality
     (Scripts taken from drivers/char/random.c)
     as per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247779
2004-12-16 14:24:00 +00:00
Michael Kerrisk d4e39a3e0a Renamed for 2.00 release 2004-12-15 17:33:21 +00:00
Michael Kerrisk 0ca68756a9 Changed CONFORMING TO 2004-12-15 17:30:03 +00:00
Michael Kerrisk 5c7ed5050a 2004-12-15 17:29:38 +00:00
Michael Kerrisk 3f800aa873 This is the change log of the current release! 2004-12-15 17:04:46 +00:00
Michael Kerrisk 2ff9c803a9 Added SEE ALSO cross refs 2004-12-15 16:42:57 +00:00
Michael Kerrisk 9c59ace465 Removed unused variable in EXAMPLE
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=262567

[[
In va_arg(3), the example function foo (section EXAMPLES, not
COMPARISON) has an unused variable: char *p.
]]
2004-12-15 16:23:30 +00:00
Michael Kerrisk 3d4d911624 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=229618
getnameinfo() does not set errno, it returns a non-zero
value indicating the error.

added EAI_OVERFLOW error
2004-12-15 16:10:55 +00:00
Michael Kerrisk 631f43ca2d Added 'const' to declaration of 'my_addr' in prototype.
as per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=239762
2004-12-15 15:35:02 +00:00
Michael Kerrisk 51c0e854fb Fix typo 2004-12-15 15:21:11 +00:00
Michael Kerrisk 7841ad4741 Added discussion of resolved_path == NULL 2004-12-15 15:18:55 +00:00
Michael Kerrisk 5d6d14a0c4 updated statm, and fixed error in order of list 2004-12-15 14:12:30 +00:00
Michael Kerrisk a7001bac67 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=210704
[[.TP  
 .B IP_TTL
 -Set or retrieve the current time to live field that is send in every
 packet
 -send from this socket.
 +Set or retrieve the current time to live field that is used in every
 packet
 +sent from this socket.
  
 .TP
 .B IP_HDRINCL
]]
2004-12-15 13:41:16 +00:00
Michael Kerrisk 526f4e1ffe Formatting fixes plus additional material in ERRORS 2004-12-15 13:37:09 +00:00
Michael Kerrisk e28334cee7 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=204292
[[
swapon(2) indicates that EINVAL wil lbe returned only if the path
specified does not exist or is not a block device.

The kernel will also return EINVAL is a swap signature is not detected
on the indicated path as well.
]]
2004-12-15 13:24:42 +00:00
Michael Kerrisk c6c4abc835 Fix typo 2004-12-14 18:39:17 +00:00
Michael Kerrisk 898e9a87df Hello Joey,
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=205736

[[
This example contains the following line:

    if ((p = realloc (p, size)) == NULL)
       return NULL;

This is a very ill written code, since realloc returning
NULL do not deallocate the original memory block. Such a 
statement has a potential to become significant memory
hole. I suggest to correct this example since:

1. It may trick naive programmers to write bad code
2. It may lead skeptic observers to the believe 
   the whole Linux is written in a similar style.
   

Regards Jan Kuznik 
]]

This guy is right on the money!

I've changed that example, so that the above code has been replaced by:

    char *np;

    ...


    if ((np = realloc (p, size)) == NULL) {
        free(p);
        return NULL;
    } else {
        p = np;
    }

Cheers,

Michael
2004-12-14 18:25:46 +00:00
Michael Kerrisk 2d5e8aeb73 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=271239
[[
shm_open(3) refers to O_RWDR during discussion of the possible values of
oflags, and later refers to O_RDWR.  The reference to O_RWDR is
incorrect (likely a typo) and should be changed to O_RDWR.
]]
2004-12-14 18:09:58 +00:00
Michael Kerrisk dae9ac9139 bugs.debian.org/cgi-bin/bugreport.cgi?bug=237305
[[
*** cmsg.3.patch
151c151
<      cmsg = CMSG_NXTHDR(&msgh,cmsg) {
---
>      cmsg = CMSG_NXTHDR(&msgh,cmsg)) {

]]
2004-12-14 18:04:59 +00:00
Michael Kerrisk 48dd5a6767 Changed
.TH UNIMPLEMENTED
to:
    .TH UNDOCUMENTED
as per
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=220741
2004-12-14 18:00:43 +00:00
Michael Kerrisk 4c39c55c47 The assert failure messages goes to stderr not stdout.
As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=284814
2004-12-14 17:46:41 +00:00
Michael Kerrisk 4b62ba5094 Fixed as per: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=222145 2004-12-14 17:14:19 +00:00
Michael Kerrisk 3ba7aed4ab Minor wording changes 2004-12-13 15:39:11 +00:00
Michael Kerrisk 1043e25b6f New page from Andries Brouwer 2004-12-13 12:42:20 +00:00
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
Michael Kerrisk d3c8b3e9b7 minor wording chnages 2004-12-13 08:58:09 +00:00
Michael Kerrisk 99d2b7a267 minor wording changes 2004-12-13 08:40:20 +00:00
Michael Kerrisk ba17901d0c minor wording/formatting fixes 2004-12-13 08:39:46 +00:00
Michael Kerrisk 540036b2fd minor wording/formatting fixes 2004-12-13 08:39:28 +00:00
Michael Kerrisk 30ca894053 minor wording fixes 2004-12-13 07:23:31 +00:00
Michael Kerrisk 9a8a1136fa typo fix 2004-12-13 06:58:38 +00:00
Michael Kerrisk 599be3eef2 updated header comments to reflect recent changes 2004-12-10 16:44:25 +00:00
Michael Kerrisk 0ff184704f [Further notes on that F_GETOWN bug]
Hi Andries,

[Just for my own  reference, I reinclude the pointer to Philippe 
Troin's patch
http://marc.theaimsgroup.com/?l=linux-kernel&m=108380640603164&w=2
]

> > > Except of course for fcntl(fd, F_GETOWN) where the owner is a
> > > (negative) process group... If the owning process group has a "low
> > > enough" PGID, it collides with errors and glibc reports an error and
> > > sets errno to -PGID. One might argue that in this instance, that the
> > > BSD's overloading of the pid field with pgids is at fault, but the 
> > > bug
> > > still remains :-)
> > 
> > I believe that practically speaking this is a non-issue.  The 
> > lowest PID / PGID that can be allocated to a process other than 
> > init or a kernel thread is 300.  (RESERVED_PID in kernel/pid.c 
> > in 2.6, details differ, but same limit in <= 2.4.)
> 
> Hmm. RESERVED_PIDS is used as starting value after overflow,
> not as a starting value at the beginning. I think you are mistaken.

Hmm -- yes.  And I was in any case assuming the notion
of a process that might do an F_SETOWN assigning
its own PGID to the socket -- but that might not be so.

And I was overlooking a comment in the fs/fcntl.c 
sources that reiterates the point:

        case F_GETOWN:
                /*
                 * XXX If f_owner is a process group, the
                 * negative return value will get converted
                 * into an error.  Oops.  If we keep the
                 * current syscall conventions, the only way
                 * to fix this will be in libc.
                 */
                err = filp->f_owner.pid;
                force_successful_syscall_return();
                break;

And now I've actually created the error in userland code.
It seems that whenever the -PGID retrieved by F_GETOWN is 
smaller than 4096, then it is interpreted as an error.

Now I see the relevant code in 
sysdeps/unix/sysv/linux/i386/sysdep.h:

==
/* Linux uses a negative return value to indicate syscall errors,
   unlike most Unices, which use the condition codes' carry flag.

   Since version 2.1 the return value of a system call might be
   negative even if the call succeeded.  E.g., the `lseek' system call
   might return a large offset.  Therefore we must not anymore test
   for < 0, but test for a real error by making sure the value in %eax
   is a real error number.  Linus said he will make sure the no syscall
   returns a value in -1 .. -4095 as a valid result so we can savely
   test with -4095.  */

[...]
    DO_CALL (syscall_name, args);
    cmpl $-4095, %eax;          
    jae SYSCALL_ERROR_LABEL;    

==

Ugh.
2004-12-10 16:28:25 +00:00
Michael Kerrisk 7c3b0e957d noted F_GETOWN bug after suggestion from aeb. 2004-12-10 16:26:28 +00:00
Michael Kerrisk 527d993350 After a note from Vasya Pupkin, I added <errno.h> to the SYNOPSIS
of several Section 2 pages using the _syscallN() macros.  

    In addition:
        -- erroneous semicolons at the end of _syscallN() were removed
           on various pages.

	-- types such as "uint" in syscalN() declarations were changed
	   to "unsigined int", etc.

	-- various other minor breakages in the synopses were fixed.
2004-12-10 09:03:08 +00:00
Michael Kerrisk 25743dd704 Removed erroneous semicolons at the end of _syscall() instances in
SYNOPSIS of several section 2 man pages.
2004-12-10 07:49:56 +00:00
Michael Kerrisk e1c77b3901 added SI_TKILL + other minor changes 2004-12-09 10:26:18 +00:00
Michael Kerrisk 1c1e15ed85 Martin Pool (and mtk) -- added O_NOATIME 2004-12-08 16:41:10 +00:00
Michael Kerrisk 67b715573a Richard.Kreckel@ginac.de
Change "NULL" to "empty" when talking about the value of TZ.
http://sources.redhat.com/bugzilla/show_bug.cgi?id=601
2004-12-08 14:54:16 +00:00
Michael Kerrisk 1a956089b0 Eric Estievenart <eric.estievenart@free.fr>
Note that MAP_FIXED replaces existing mappings
2004-12-08 13:47:41 +00:00
Michael Kerrisk e263839c06 In Linux 2.6, the return value of times() changed 2004-12-08 09:26:32 +00:00
Michael Kerrisk 8b6aacb004 tweak RLIMIT_SIGPENDING details 2004-12-07 17:57:48 +00:00
Michael Kerrisk c0722da013 tweak RLIMIT_SIGPENDING details 2004-12-07 17:46:30 +00:00