Debian Codegraph @

upstream/debian-unstable/man2/PR_FUTEX_HASH_SET_SLOTS.2const

raw
1 .\" Copyright, the authors of the Linux man-pages project
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH PR_FUTEX_HASH_SET_SLOTS 2const 2025-12-25 "Linux man-pages 6.18"
6 .SH NAME
7 PR_FUTEX_HASH_SET_SLOTS
8 \-
9 set the size of the private hash
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ,\~ \-lc )
13 .SH SYNOPSIS
14 .nf
15 .BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
16 .B #include <sys/prctl.h>
17 .P
18 .B int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS,
19 .BI " unsigned long " size ", unsigned long " flags );
20 .fi
21 .SH DESCRIPTION
22 Set the number of slots to use for the private hash.
23 .TP
24 .I size
25 Specify the size of private hash to allocate.
26 .RS
27 .TP
28 .I 0
29 Use the global hash.
30 This is the behavior used before Linux 6.17.
31 .TP
32 .I >0
33 Specify the number of slots to allocate.
34 The value must be power of two, and the lowest possible value is 2.
35 The upper limit depends on the available memory in the system.
36 Each slot requires 64 bytes of memory.
37 Kernels compiled with
38 .I CONFIG_PROVE_LOCKING
39 will consume more than that.
40 .RE
41 .TP
42 .I flags
43 .RS
44 The argument must be 0.
45 .SH RETURN VALUE
46 On success,
47 0 is returned.
48 On error, \-1 is returned, and
49 .I errno
50 is set to indicate the error.
51 .SH ERRORS
52 .TP
53 .B EINVAL
54 An argument is invalid.
55 .TP
56 .B ENOMEM
57 Failed to allocate memory.
58 .TP
59 .B EBUSY
60 The global hash is in use and can not be changed.
61 .SH STANDARDS
62 Linux.
63 .SH HISTORY
64 Linux 6.17.
65 .SH SEE ALSO
66 .BR prctl (2),
67 .BR PR_FUTEX_HASH (2const)