annotate lib/pagealign_alloc.h @ 10690:01f3623813da

Split winsock.c into many smaller files. * lib/close.c: Add _gl_close_fd_maybe_socket from winsock.c. * lib/accept.c: New file, based on winsock.c. * lib/bind.c: New file, based on winsock.c. * lib/connect.c: New file, based on winsock.c. * lib/getpeername.c: New file, based on winsock.c. * lib/getsockname.c: New file, based on winsock.c. * lib/getsockopt.c: New file, based on winsock.c. * lib/ioctl.c: New file, based on winsock.c. * lib/listen.c: New file, based on winsock.c. * lib/recv.c: New file, based on winsock.c. * lib/recvfrom.c: New file, based on winsock.c. * lib/send.c: New file, based on winsock.c. * lib/sendto.c: New file, based on winsock.c. * lib/setsockopt.c: New file, based on winsock.c. * lib/shutdown.c: New file, based on winsock.c. * lib/socket.c: New file, based on winsock.c. * lib/w32sock.h: New file, based on winsock.c. * lib/winsock.c: Remove file. * modules/accept: Likewise. * modules/bind: Likewise. * modules/connect: Likewise. * modules/getpeername: Likewise. * modules/getsockname: Likewise. * modules/getsockopt: Likewise. * modules/ioctl: Likewise. * modules/listen: Likewise. * modules/recv: Likewise. * modules/recvfrom: Likewise. * modules/send: Likewise. * modules/sendto: Likewise. * modules/setsockopt: Likewise. * modules/shutdown: Likewise. * modules/socket: Use socket.c instead of winsock.c. * modules/sys_socket: Remove (unneeded?) dependency on winsock.c. * doc/posix-functions/accept.texi: Doc fix. * doc/posix-functions/bind.texi: Doc fix. * doc/posix-functions/close.texi: Doc fix. * doc/posix-functions/connect.texi: Doc fix. * doc/posix-functions/getpeername.texi: Doc fix. * doc/posix-functions/getsockname.texi: Doc fix. * doc/posix-functions/getsockopt.texi: Doc fix. * doc/posix-functions/ioctl.texi: Doc fix. * doc/posix-functions/listen.texi: Doc fix. * doc/posix-functions/recv.texi: Doc fix. * doc/posix-functions/recvfrom.texi: Doc fix. * doc/posix-functions/send.texi: Doc fix. * doc/posix-functions/sendto.texi: Doc fix. * doc/posix-functions/setsockopt.texi: Doc fix. * doc/posix-functions/shutdown.texi: Doc fix. * doc/posix-functions/socket.texi: Doc fix.
author Simon Josefsson <simon@josefsson.org>
date Tue, 21 Oct 2008 12:17:19 +0200
parents cf0a8e173c39
children b5e42ef33b49
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Memory allocation aligned to system page boundaries.
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2
10074
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
3 Copyright (C) 2005, 2008 Free Software Foundation, Inc.
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
5 This program is free software: you can redistribute it and/or modify
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
6 it under the terms of the GNU General Public License as published by
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
8 (at your option) any later version.
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
13 GNU General Public License for more details.
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
15 You should have received a copy of the GNU General Public License
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 5848
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #ifndef _PAGEALIGN_ALLOC_H
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 # define _PAGEALIGN_ALLOC_H
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 # include <stddef.h>
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 /* Allocate a block of memory of SIZE bytes, aligned on a system page
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 boundary.
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 If SIZE is not a multiple of the system page size, it will be rounded up
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 to the next multiple.
5678
6868adf039ec Note pagealign_alloc() sets errno on failure.
Bruno Haible <bruno@clisp.org>
parents: 5675
diff changeset
27 Return a pointer to the start of the memory block. Upon allocation failure,
6868adf039ec Note pagealign_alloc() sets errno on failure.
Bruno Haible <bruno@clisp.org>
parents: 5675
diff changeset
28 return NULL and set errno. */
10074
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
29 extern void *pagealign_alloc (size_t size)
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
30 # if __GNUC__ >= 3
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
31 __attribute__ ((__malloc__))
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
32 # endif
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
33 ;
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34
5675
9fb0004d9fa6 Check or don't check for allocation failure? Provide both alternatives.
Bruno Haible <bruno@clisp.org>
parents: 5673
diff changeset
35 /* Like pagealign_alloc, except it exits the program if the allocation
9fb0004d9fa6 Check or don't check for allocation failure? Provide both alternatives.
Bruno Haible <bruno@clisp.org>
parents: 5673
diff changeset
36 fails. */
10074
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
37 extern void *pagealign_xalloc (size_t size)
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
38 # if __GNUC__ >= 3
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
39 __attribute__ ((__malloc__))
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
40 # endif
cf0a8e173c39 Help GCC to do better code generation.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
41 ;
5675
9fb0004d9fa6 Check or don't check for allocation failure? Provide both alternatives.
Bruno Haible <bruno@clisp.org>
parents: 5673
diff changeset
42
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 /* Free a memory block.
5675
9fb0004d9fa6 Check or don't check for allocation failure? Provide both alternatives.
Bruno Haible <bruno@clisp.org>
parents: 5673
diff changeset
44 PTR must be a non-NULL pointer returned by pagealign_alloc or
9fb0004d9fa6 Check or don't check for allocation failure? Provide both alternatives.
Bruno Haible <bruno@clisp.org>
parents: 5673
diff changeset
45 pagealign_xalloc. */
5673
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 extern void pagealign_free (void *ptr);
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
dbfd56933568 New module 'pagealign_alloc'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 #endif /* _PAGEALIGN_ALLOC_H */