mirror of git://sourceware.org/git/glibc.git
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>
|
||
|---|---|---|
| .. | ||
| README | ||
| add.c | ||
| argp-ex1.c | ||
| argp-ex2.c | ||
| argp-ex3.c | ||
| argp-ex4.c | ||
| atexit.c | ||
| db.c | ||
| dir.c | ||
| dir2.c | ||
| execinfo.c | ||
| filecli.c | ||
| filesrv.c | ||
| fmtmsgexpl.c | ||
| inetcli.c | ||
| inetsrv.c | ||
| isockad.c | ||
| longopt.c | ||
| mbstouwcs.c | ||
| memopen.c | ||
| memstrm.c | ||
| mkdirent.c | ||
| mkfsock.c | ||
| mkisock.c | ||
| mygetpass.c | ||
| ofdlocks.c | ||
| pipe.c | ||
| popen.c | ||
| rprintf.c | ||
| search.c | ||
| select.c | ||
| setjmp.c | ||
| sigh1.c | ||
| sigusr.c | ||
| stpcpy.c | ||
| strdupa.c | ||
| strftim.c | ||
| subopt.c | ||
| swapcontext.c | ||
| termios.c | ||
| testopt.c | ||
| timespec_subtract.c | ||
| twalk.c | ||
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.