Commit Graph

7832 Commits

Author SHA1 Message Date
Michael Kerrisk 42bd5b3db0 socket.7: Correct description of SO_BROADCAST
As reported by Alexey:

socket(7) says:

SO_BROADCAST
  Set  or  get  the broadcast flag. When enabled, datagram sockets
  receive packets sent to a broadcast address and they are allowed
  to  send  packets  to  a  broadcast address.  This option has no
  effect on stream-oriented sockets.

I believe the second sentence is half wrong: when I try it, it
only affects the ability to send broadcast datagrams. You can only
receive broadcast datagrams if you bind to INADDR_ANY and don't
connect. The POSIX standard agrees with my tests and disagrees
with the manpage:

http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_10.html

Reported-by: Alexey Toptygin <alexeyt@freeshell.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 21:02:31 +12:00
Michael Kerrisk f6dc36110c getpwnam.3: Fix discussion of _SC_GETPW_R_SIZE_MAX
The value is not meant to be a maximum (as was specified in
SUSv3) but an initial guess at the required size
(as specified in SUSv4).

Reported-by: Ulrich Drepper <drepper@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 20:21:23 +12:00
Michael Kerrisk f7bae7f86b getgrnam.3: Fix discussion of _SC_GETGR_R_SIZE_MAX
The value is not meant to be a maximum (as was specified in
SUSv3) but an initial guess at the required size
(as specified in SUSv4).

Reported-by: Ulrich Drepper <drepper@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 20:13:16 +12:00
Michael Kerrisk 61474e1b58 gsignal.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 18:59:15 +12:00
Michael Kerrisk ed987e2ee4 rexec.3: grfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 12:18:53 +12:00
Michael Kerrisk 6760cb0176 rexec_af.3: New link to rexec.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 12:18:22 +12:00
Michael Kerrisk 4cd4a6f890 rexec.3: Document rexec_af()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 12:17:44 +12:00
Michael Kerrisk 5b80f0073c iruserok_af.3, rcmd_af.3, rresvport_af.3, ruserok_af.3: New links to rcmd.3
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 12:03:33 +12:00
Michael Kerrisk 023a57dc59 rcmd.3: Document "_af" variants of these functions
Document rcmd_af(), rresvport_af(), iruserok_af(), ruserok_af().
Also some restructuring and other clarifications.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 12:01:47 +12:00
Michael Kerrisk aa104c88b7 rcmd.3: Add some details of the rresvport() 'port' argument
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 11:15:45 +12:00
Michael Kerrisk 7cb4d005c6 fallocate.2: Fix description of ENOSYS and EOPNOTSUP errors
As reported in https://bugzilla.redhat.com/show_bug.cgi?id=680214
the descriptions of ENOSYS and EOPNOTSUP are not corrected

Reported-by: John Sullivan <jsrhbz@kanargh.force9.co.uk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 10:07:47 +12:00
Michael Kerrisk 61d71e01e2 strerror.3: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 09:25:56 +12:00
Michael Kerrisk 6fb29ca02e strerror.3: Add an example of the kind of string returned by setrerror()
Reported-by: Jon Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 09:24:28 +12:00
Brian F. G. Bidulock c643e947f7 netdevice.7: Document some SIOC configuration ioctls
This patch adds common but missing SIOC configuration ioctls to
the netdevice.7 manual pages that are not documented anywhere
else. SIOCSIFPFLAGS and SIOCGIFPFLAGS are linux-specific. Flag
values come from Linux 2.6.25 kernel headers for sockios. The
others are standard BSD ioctls that have alwasy been implemented
by Linux and were verified from inspecting netdevice.c kernel
code.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 08:29:44 +12:00
Stefan Puiu 4c49bf908c send.2: Document EACCES error case for UDP
It seems sendto() can return EACCES for UDP as well; the current
man page in git only says it can return EACCES for Unix sockets.

I was able to make sendto() return EACCES if I try to send from
192.168.1.1/24 to 192.168.1.0. I think the relevant code (in
kernel 2.6.38, but also present in 2.6.7 and 2.6.32, the 2 kernels
we use) is this (net/ipv4/udp.c, udp_sendmsg()):

 910                err = -EACCES;
 911                if ((rt->rt_flags & RTCF_BROADCAST) &&
 912                    !sock_flag(sk, SOCK_BROADCAST))
 913                        goto out;

So I guess if the kernel finds a route to the destination and
it's a broadcast route (and the socket doesn't have the broadcast
flag), then it returns EACCES.

I can verify the behavior with a very simple program (attached).
I've run it on my Ubuntu 10.10 (2.6.35 kernel) and got this:

stefan@spuiu-vml2:~/src/test/broadcast$ ./broadcast_test 10.205.20.94
10.205.20.1
sendto() returned 4
stefan@spuiu-vml2:~/src/test/broadcast$ ./broadcast_test 10.205.20.94
10.205.20.0
sendto() returned negative, errno: 13/Permission denied

(10.205.20.94 is my local IP, of course).

=====
    #include <stdio.h>

    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <errno.h>
    #include <stdlib.h>

    int main(int argc, char **argv)
    {
        int sock;

        if (argc < 2) {
            printf("Usage: %s local_address destination_address\n", argv[0]);
            exit(1);
        }

        sock = socket(AF_INET, SOCK_DGRAM, 0);
        if (sock < 0) {
            perror("socket");
            return -1;
        }

        struct sockaddr_in local_addr;
        local_addr.sin_family = AF_INET;
        local_addr.sin_port = htons(1234);
        local_addr.sin_addr.s_addr = inet_addr(argv[1]);
        int ret = bind(sock, (struct sockaddr *) &local_addr, sizeof(local_addr));
        if (ret < 0) {
            perror("bind");
            return -1;
        }

        struct sockaddr_in remote_addr;
        remote_addr.sin_family = AF_INET;
        remote_addr.sin_port = htons(1234);
        remote_addr.sin_addr.s_addr = inet_addr(argv[2]);
        ret = sendto(sock, "blah", 4, 0, (struct sockaddr *)&remote_addr, sizeof(remote_addr));
        if (ret < 0) {
            printf("sendto() returned negative, errno: %d/%m\n", errno);
        }
        else {
            printf("sendto() returned %d\n", ret);
        }

        return 0;
    }
=====

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 08:15:01 +12:00
Michael Kerrisk df21098dee btree.3, dbopen.3, hash.3, mpool.3, recno.3: Note that glibc no longer provides these interfaces
glibc stopped providing these interfaces with v2.2.
Nowadays, the user that finds these pages probably wants
the libdb API, so note this in the page.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=337581

Reported-by: Brian M. Carlson <sandals@crustytoothpaste.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-23 07:47:35 +12:00
Eugen Dedu 1463d77202 iso_8859-1.7: Add "-" for SOFT HYPHEN
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=156154

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 19:12:38 +12:00
Michael Kerrisk afd6f6c5ea fopen.3: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:29 +12:00
Michael Kerrisk 4d9edb6e7e fopen.3: BUGS: Note limitation on number of flag characters parsed in 'mode' 2012-04-22 14:48:29 +12:00
Michael Kerrisk d33e84666f fopen.3: Document ",ccs=string" feature of 'mode' for fopen()/freopen()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:28 +12:00
Michael Kerrisk 78a9ad2522 fopen.3: Note that 'c' and 'e' flags are ignored for fdopen()
Determined from reading libio/iofdopen.c.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:28 +12:00
Michael Kerrisk 20e41f3f02 fopen.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:28 +12:00
Michael Kerrisk 96285a93ed fopen.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:28 +12:00
Michael Kerrisk 24a690f714 locale.7: srcfix: Add FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:28 +12:00
Michael Kerrisk f26825206d strerror.3: Note how to use 'errno' to detect errors when calling strerror()
Reviewd-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 14:48:08 +12:00
Eric Blake 8ca6ceb0cf strerror.3: Improve strerror_r() description
POSIX requires that perror() not modify the static storage
returned by strerror().  POSIX 2008 and C99 both require that
strerror() never return NULL (a strerror() that always
returns "" for all inputs is valid for C99, but not for POSIX).

http://sourceware.org/bugzilla/show_bug.cgi?id=12204
documents glibc's change to come into compliance with POSIX
regarding strerror_r() return value.  The GNU strerror_r() use
of 'buf' was confusing - I ended up writing a test program that
proves that 'buf' is unused for valid 'errnum', but contains
truncated "unknown message" for out-of-range 'errnum'.

See also http://austingroupbugs.net/view.php?id=382

Reviewed-by: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 12:13:31 +12:00
Bernhard Walle a5fa6dfd19 strerror.3: Correct description of error return for XSI strerror_r()
The XSI-compliant version of strerror_r() doesn't return -1 on
error and set errno. Instead, a positive error number is returned.
That's what POSIX says:

    Upon successful completion, strerror_r() shall return 0.
    Otherwise, an error number shall be returned to indicate
    the error.

I tested with an invalid error number. While some implementations
seem to write "Unknown error xxx" into the supplied buffer, some
others don't and only return EINVAL. The latest glibc 2.14.1 from
Arch Linux belongs to the first category while eglibc 2.13 from
current Debian testing belongs to the second category.

However, both implementation are correct according to POSIX. So I
think the manpage was wrong and POSIX and the implementations are
correct.

Signed-off-by: Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 11:09:37 +12:00
Michael Kerrisk a146d9cccd fchmodat.2: Improve discussion of difference between wrapper and underlying syscall
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 07:09:18 +12:00
Michael Kerrisk 0364dd73e4 fchmodat.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-22 06:55:30 +12:00
Michael Kerrisk 3c8d6131e8 mkstemp.3: Add "mkstemps" and "mkostemps" to NAME line
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-21 11:54:11 +12:00
Michael Kerrisk 66dd9100d8 posix_openpt.3: Add some details on use of the slave pathname
An explicit pointer to ptsname(3) is useful, as is a note
of the fact that the slave device pathname exists only as
long as the master device is held open.

Reported-by: Vadim Mikhailov <vadim.mikhailov@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-20 15:56:02 +12:00
Michael Kerrisk cbf94ac122 sigaction.2: Remove mention of raise(3) for SI_USER
For a long time now, glibc's raise(3) didn't yield SI_USER
for the signal receiver, so remove mention of raise(3)
here. The user can deduce the details, if needed, by looking
at the recently updated raise(3) page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-20 13:14:31 +12:00
Michael Kerrisk f24766e312 raise.3: Add some notes on underlying system call that is used
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-20 13:12:40 +12:00
Simon Paillard 6315c1b68f mallopt.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-19 11:09:10 +12:00
Simon Paillard ebca85d8a1 posix_memalign.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-19 11:08:35 +12:00
Michael Kerrisk b546a5284b bind.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-18 09:47:59 +12:00
Michael Kerrisk 361c3c7f7a malloc.3, mallopt.3, mtrace.3: Links to new mcheck.3 page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-18 08:33:39 +12:00
Michael Kerrisk fd2981935b mcheck.3: New man page for mcheck(3) and related functions
Also describes mcheck_check_all(3) mcheck_pedantic(3),
and mprobe(3)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-18 08:32:35 +12:00
Michael Kerrisk fb07934b18 aio_cancel.3: Rewrite RETURN VALUE section to be clearer
Reported-by: Jon Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-18 08:15:11 +12:00
Michael Kerrisk 53fdc589c6 aio_init.3: Remove extraneous "POSIX" from NAME section
Reported-by: Jon Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-18 07:49:26 +12:00
Michael Kerrisk ad9345ddd8 Start of man-pages-3.40: updating Changes and Changes.old 2012-04-17 23:42:12 +12:00
Michael Kerrisk 92372a7563 Start of man-pages-3.40: updating .Announce and .lsm files 2012-04-17 23:42:12 +12:00
Michael Kerrisk 5f6398186b Start of man-pages-3.40: renaming .Announce and .lsm files 2012-04-17 23:42:12 +12:00
Michael Kerrisk d2f920ab46 Ready for 3.39 2012-04-17 23:25:43 +12:00
Michael Kerrisk 437e08fc95 fchmodat.2: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-17 23:25:14 +12:00
Michael Kerrisk ffbe890768 div.3, mallopt.3, perror.3, epoll.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-17 23:23:57 +12:00
Michael Kerrisk cd8ce77d78 Changes: Ready for 3.39
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-17 23:21:14 +12:00
Jonathan Nieder de1f0d4764 ld.so.8: Document effect of hwcaps on search path
Wording by Aurelien Jarno from Debian glibc's r4701 (2011-06-04).

Addresses http://bugs.debian.org/622385

Reported-by: Reuben Thomas <rrt@sc3d.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-17 23:09:15 +12:00
Michael Kerrisk 6f92d1d707 Makefile: use "mkdir -p" instead of "-make"
For some casual readers of the Makefile, "mkdir -p" is
probably a little easier to read than the equivalent "-make".

Reported-by: Reuben Thomas <rrt@sc3d.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-04-17 23:09:08 +12:00
Michael Kerrisk 50b5741877 Removed trailing white space at end of lines 2012-04-17 23:09:04 +12:00