glibc/manual/examples
Collin Funk e465aeed59 manual: Fix compiler errors in filesrv example.
Previously this file failed to compile with the following errors:

    $ gcc manual/examples/filesrv.c
    manual/examples/filesrv.c: In function ‘main’:
    manual/examples/filesrv.c:37:3: error: implicit declaration of function ‘unlink’ [-Wimplicit-function-declaration]
       37 |   unlink (SERVER);
          |   ^~~~~~
    manual/examples/filesrv.c:40:10: error: implicit declaration of function ‘make_named_socket’ [-Wimplicit-function-declaration]
       40 |   sock = make_named_socket (SERVER);
          |          ^~~~~~~~~~~~~~~~~
    manual/examples/filesrv.c:46:54: error: passing argument 6 of ‘recvfrom’ from incompatible pointer type [-Wincompatible-pointer-types]
       46 |                          (struct sockaddr *) & name, &size);
          |                                                      ^~~~~
          |                                                      |
          |                                                      size_t * {aka long unsigned int *}
    In file included from manual/examples/filesrv.c:21:
    /usr/include/sys/socket.h:165:48: note: expected ‘socklen_t * restrict’ {aka ‘unsigned int * restrict’} but argument is of type ‘size_t *’ {aka ‘long unsigned int *’}
      165 |                          socklen_t *__restrict __addr_len);
          |                          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

This patch fixes the missing declaration for unlink and uses
'socklen_t *' for the fourth argument of recv from. The
make_named_socket function is defined in the manual.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-09-29 17:01:54 -07:00
..
README
add.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
argp-ex1.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
argp-ex2.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
argp-ex3.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
argp-ex4.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
atexit.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
db.c manual: Fix missing include in group and user database example. 2025-09-29 17:01:54 -07:00
dir.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dir2.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
execinfo.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
filecli.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
filesrv.c manual: Fix compiler errors in filesrv example. 2025-09-29 17:01:54 -07:00
fmtmsgexpl.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inetcli.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inetsrv.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
isockad.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
longopt.c manual: tidy the longopt.c example 2025-03-31 10:34:51 -03:00
mbstouwcs.c manual: Fix missing includes in the mbstouwcs example. 2025-09-29 17:01:54 -07:00
memopen.c manual: Fix missing include in memopen example. 2025-09-29 17:01:54 -07:00
memstrm.c manual: Add missing free to open_memstream example [BZ #27866] 2025-06-25 14:26:32 +02:00
mkdirent.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
mkfsock.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
mkisock.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
mygetpass.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ofdlocks.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
pipe.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
popen.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
rprintf.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
search.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
select.c manual: Fix missing declaration in select example. 2025-09-29 17:01:54 -07:00
setjmp.c manual: Fix missing declaration in setjmp example. 2025-09-29 17:01:54 -07:00
sigh1.c manual: fix missing include in sigh1 example. 2025-09-29 17:01:54 -07:00
sigusr.c manual: Fix missing include in sigusr example. 2025-09-29 17:01:54 -07:00
stpcpy.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
strdupa.c manual: Fix missing declaration in strdupa example. 2025-09-29 17:01:54 -07:00
strftim.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
subopt.c manual: Allow getsubopt example to compile with GCC 15. 2025-09-29 17:01:54 -07:00
swapcontext.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
termios.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
testopt.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
timespec_subtract.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
twalk.c manual: Fix missing declaration in twalk example. 2025-09-29 17:01:54 -07:00

README

These are source files for example code that appears in The GNU C
Library Reference Manual.

While the manual itself is licensed under the terms of the GNU Free
Documentation License, you can use these source files on their own
under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License, or (at your
option) any later version.