Debian Codegraph @

upstream/debian-unstable/man3/valloc.3

raw
1 '\" t
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH valloc 3 2025-12-13 "Linux man-pages 6.18"
7 .SH NAME
8 valloc
9 \-
10 page-aligned memory allocation
11 .SH LIBRARY
12 Standard C library
13 .RI ( libc ,\~ \-lc )
14 .SH SYNOPSIS
15 .nf
16 .B #include <stdlib.h>
17 .P
18 .BI "[[deprecated]] void *valloc(size_t " size );
19 .fi
20 .P
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .P
26 .BR valloc ():
27 .nf
28 Since glibc 2.12:
29 (_XOPEN_SOURCE >= 500) && !(_POSIX_C_SOURCE >= 200112L)
30 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
31 || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
32 Before glibc 2.12:
33 _BSD_SOURCE || _XOPEN_SOURCE >= 500
34 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
35 .fi
36 .SH DESCRIPTION
37 .BR valloc ()
38 allocates
39 .I size
40 bytes and returns a pointer to the allocated memory.
41 The memory address will be a multiple of the page size.
42 .P
43 It is equivalent to
44 .IR "memalign(sysconf(_SC_PAGESIZE),size)" .
45 .SH ATTRIBUTES
46 For an explanation of the terms used in this section, see
47 .BR attributes (7).
48 .TS
49 allbox;
50 lbx lb lb
51 l l l.
52 Interface Attribute Value
53 T{
54 .na
55 .nh
56 .BR valloc ()
57 T} Thread safety MT-Unsafe init
58 .TE
59 .SH VERSIONS
60 According to SUSv2,
61 .BR valloc ()
62 is declared in
63 .IR <stdlib.h> .
64 .\" Libc4,5 and
65 glibc declares it in
66 .IR <malloc.h> ,
67 and also in
68 .I <stdlib.h>
69 if suitable feature test macros are defined (see above).
70 .SH STANDARDS
71 BSD, GNU.
72 .SH HISTORY
73 glibc 2.0.
74 3.0BSD.
75 Documented as obsolete in 4.3BSD,
76 and as legacy in SUSv2.
77 .\"
78 .SH CAVEATS
79 See
80 .BR memalign (3).
81 .\" Other systems allow passing the result of
82 .\" .IR valloc ()
83 .\" to
84 .\" .IR free (3),
85 .\" but not to
86 .\" .IR realloc (3).
87 .SH SEE ALSO
88 .BR memalign (3)