Mercurial > hg > octave-kai > gnulib-hg
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 |
rev | line source |
---|---|
5673 | 1 /* Memory allocation aligned to system page boundaries. |
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 | 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 | 9 |
10 This program is distributed in the hope that it will be useful, | |
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 | 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 | 17 |
18 #ifndef _PAGEALIGN_ALLOC_H | |
19 # define _PAGEALIGN_ALLOC_H | |
20 | |
21 # include <stddef.h> | |
22 | |
23 /* Allocate a block of memory of SIZE bytes, aligned on a system page | |
24 boundary. | |
25 If SIZE is not a multiple of the system page size, it will be rounded up | |
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 | 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 | 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 | 46 extern void pagealign_free (void *ptr); |
47 | |
48 #endif /* _PAGEALIGN_ALLOC_H */ |