Commit Graph

9334 Commits

Author SHA1 Message Date
Michael Kerrisk 2b44301c2a Added futex(2) and set_tid_address(2) to SEE ALSO 2005-04-11 15:03:38 +00:00
Michael Kerrisk 2f36a80706 Jamie Lokier / mtk
Improved discussion of F_SETOWN and F_SETSIG with respect to
multi-threaded programs.

Generally cleaned up the discussion of F_SETOWN.
2005-04-08 13:42:00 +00:00
Michael Kerrisk 055fd5fae5 Noted kernel version numbers for semtimedop() 2005-04-08 06:19:20 +00:00
Michael Kerrisk fcad9022d3 Matthias Lang, mtk
Noted MAX_SEC_IN_JIFFIES ceiling.
Added note about treatment of out-of-range tv_usec values.
2005-04-06 15:29:32 +00:00
Michael Kerrisk 2a44706019 More clean-up of ERRORS after further communication with Gordon Jin. 2005-04-06 12:59:19 +00:00
Michael Kerrisk 6e01dc7e8d Fixed EINVAL description after mesage from
"Jin, Gordon" <gordon.jin@intel.com>
2005-04-05 17:01:47 +00:00
Michael Kerrisk e8de013ac1 More changes from Marko Kohtala <marko.kohtala@gmail.com> 2005-04-05 12:49:00 +00:00
Michael Kerrisk 490df3ae03 Noted discrepancy between Linux and POSIX.1 when oldpath is a symbolic
link.
2005-04-04 16:54:25 +00:00
Michael Kerrisk 3d9a2200a6 Improved various error descriptions after message from
Marko Kohtala <marko.kohtala@gmail.com>.
2005-04-04 16:33:48 +00:00
Michael Kerrisk 2d5d4b0dd0 Clarified description of EXDEV error with respect to
file system mounted at multiple points, as per rename.2
patch from Michael Haardt <michael@moria.de>.
2005-04-04 14:14:02 +00:00
Michael Kerrisk 1dba3c20aa Patch from AEB: improved DESCRIPTION; clarified distinction between
EACCES and ENOEXEC.
2005-04-04 13:10:49 +00:00
Michael Kerrisk 9fe9d301af mmap() improvements from Martin Pool 2005-03-31 14:42:09 +00:00
Michael Kerrisk 042d7c1b37 Added sigqueue(2) to SEE ALSO 2005-03-31 14:27:35 +00:00
Michael Kerrisk e17d909d2b Typo fix: s/joey@infodeom.org/joey@infodrom.org/ 2005-03-31 14:12:28 +00:00
Michael Kerrisk c1f2160361 Removed SVr2, AT&T, and BSD from CONFORMING TO, since
a pipe on those systems is actually bidirectional
(Pipes are implemented as STREAMS on the former, and
sockets on the latter.)
2005-03-31 14:08:14 +00:00
Michael Kerrisk c5a2d222f8 Added EINTR error 2005-03-31 13:41:40 +00:00
Michael Kerrisk b7d1c64591 Fixed typo as per msg from Michael Mühlebach <michael@anduin.ch> 2005-03-31 12:59:18 +00:00
Michael Kerrisk cca657e227 triggered by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=283179
The wording describing how errno is set was tidied up in a number of
pages.
2004-12-20 12:24:06 +00:00
Michael Kerrisk d3018c3c5e "from a socket" --> "on a socket" 2004-12-20 10:53:41 +00:00
Michael Kerrisk cf257cc501 Adjusted descriptors of argument file tyypes to be closer to
2.6 reality.
Wording and formatting changes
2004-12-17 15:27:42 +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 0ca68756a9 Changed CONFORMING TO 2004-12-15 17:30:03 +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 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 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 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 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 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 4bdd9f775b tweak RLIMIT_SIGPENDING details 2004-12-07 17:30:27 +00:00
Michael Kerrisk 1c287bbf01 fix typo 2004-12-06 13:39:28 +00:00
Michael Kerrisk e6c5832f19 Rewrote discussion on RLIMIT_MEMLOCK to incorporate kernel 2.6.9 changes.
Added note on RLIMIT_CPU error in older kernels.
Added RLIMIT_SIGPENDING
2004-12-03 16:06:22 +00:00
Michael Kerrisk 93e4c37f65 more fixes to synopsis 2004-12-02 09:25:55 +00:00
Michael Kerrisk b4c0e1cb44 Fixed headers listed in synopsis, after message from Vasya Pupkin 2004-12-01 15:19:22 +00:00
Michael Kerrisk 3aadaa6594 noted buggy mlock() half RAM check in 2.4.x; some rewording of discussion of MCL_FUTURE 2004-12-01 09:43:35 +00:00
Michael Kerrisk 7f3256956e Changed wording of sentence under NOTES describing when signals can be sent to init. 2004-11-30 17:47:32 +00:00
Michael Kerrisk 8ce20bf7ba These are now just links; their content has been consoldiated intomlock.2 2004-11-25 14:40:17 +00:00
Michael Kerrisk 8176b81ab6 Consolidated mlock.2, munlock.2, mlockall.2, and munlockall.2 material into single page to eliminate duplicated material; updated notes for 2.6.9 changes in permissions and limist on memory locking 2004-11-25 14:39:43 +00:00
Michael Kerrisk 583d5fd39a Notes on 2.6.9 RLIMIT_MEMLOCK changes 2004-11-25 13:38:17 +00:00
Michael Kerrisk 83cd3686ed Added cross-ref to setrlimit(2) concerning memory locking limits 2004-11-25 13:36:04 +00:00
Michael Kerrisk 102f39b88e 2.4 limits locks to half of physical mem; MCL_FUTURE bug note 2004-11-25 13:34:08 +00:00
Michael Kerrisk c1832fd1eb 2.4 limits locks to half of physical me 2004-11-25 13:33:38 +00:00
Michael Kerrisk 3b85198195 removed stray #endif; formatting fix 2004-11-25 07:50:05 +00:00
Michael Kerrisk 3d3886497f CAP_IPC_LOCK is not required for SHM_UNLOCK since kernel 2.6.9 2004-11-23 10:06:02 +00:00
Michael Kerrisk f8c31d602c CLD_CONTINUED is supported since Linux 2.6.9 2004-11-19 17:35:57 +00:00
Michael Kerrisk 197362df19 Removed text on ignoring SIGCHL; replaced with pointer to sigaction.2 2004-11-19 17:34:32 +00:00
Michael Kerrisk b7769f32c5 Updated discussion for POSIX.1-2001 and SIGCHLD and sa_flags; formatting fixes 2004-11-18 13:37:14 +00:00
Michael Kerrisk 5775745fa4 Added FIXME -- the return value of times() has changed in Linux 2.6 -- what is it? 2004-11-16 19:38:07 +00:00
Michael Kerrisk 4c926acf03 Minor formatting changes 2004-11-16 17:08:25 +00:00
Michael Kerrisk 81841f39af SIGCHLD non-conformance was fixed in 2.6.9 2004-11-16 16:59:09 +00:00
Michael Kerrisk e3a887db90 split out from getrlimit.2; noted that SIGCHLD non-conformance was fixed in 2.6.9 2004-11-16 16:58:54 +00:00
Michael Kerrisk 0fc46b5a65 split getrusage(2) into own page; other minor changes 2004-11-16 16:57:47 +00:00
Michael Kerrisk d3b2ef5de2 Added waitid(); added SA_NOCLDSTOP; updated SA_NOCLDWAIT; much other text rewritten 2004-11-11 14:40:35 +00:00
Michael Kerrisk fe4992a761 Major rewrite; removed duplicated text, replacing with pointers to wait.2 2004-11-11 14:39:29 +00:00
Michael Kerrisk f2351505cb Rewrote this page, removing much duplicated information
and replacing with pointers to wait.2
2004-11-11 14:17:30 +00:00
Michael Kerrisk 84b13f1e40 Minor changes to SEE ALSO 2004-11-11 14:13:28 +00:00
Michael Kerrisk 1cbdceb181 Added SIGCONT under SA_NOCLDSTOP; added SA_NOCLDWAID; other minor changes 2004-11-11 14:09:54 +00:00
Michael Kerrisk 5d4a590c7d new link to wait.2 2004-11-11 14:08:30 +00:00
Michael Kerrisk 2c8d1c7d5e changed spelling of "super-user" to "superuser" 2004-11-10 18:17:26 +00:00
Michael Kerrisk 9907019a39 Formatting & lang clean-ups; added data structure defns; added SHM_LOCKED & SHM_DEST test 2004-11-10 17:27:34 +00:00
Michael Kerrisk 70d0e5ef63 Formatting & lang clean-ups; added data structure defns 2004-11-10 17:27:07 +00:00
Michael Kerrisk f998edca67 Formatting & lag clean-ups; changed sentence regarding attachment of segments marked for destruction 2004-11-10 17:25:44 +00:00
Michael Kerrisk fe1c5199cc Formatting & lag clean-ups; added /proc file notes 2004-11-10 17:24:20 +00:00
Michael Kerrisk c952e22670 Formatting & lag clean-ups; added /proc file notes 2004-11-10 17:23:19 +00:00
Michael Kerrisk 6891999e31 Patches from Martin Schulze <joey@infodeom.org> 2004-11-03 15:32:55 +00:00
Michael Kerrisk 305a0578bf Global change of email address for MTK (now: mtk-manpages@gmx.net) 2004-11-03 14:43:40 +00:00
Michael Kerrisk fea681dafb Import of man-pages 1.70 2004-11-03 13:51:07 +00:00