Debian Codegraph @

upstream/debian-trixie/man2/bdflush.2

raw
1 .\" Copyright (c) 1995 Michael Chastain ([email protected]), 15 April 1995.
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .\" Modified 1997-01-31 by Eric S. Raymond <[email protected]>
6 .\" Modified 2004-06-17 by Michael Kerrisk <[email protected]>
7 .\"
8 .TH bdflush 2 2024-05-02 "Linux man-pages 6.9.1"
9 .SH NAME
10 bdflush \- start, flush, or tune buffer-dirty-flush daemon
11 .SH SYNOPSIS
12 .nf
13 .B #include <sys/kdaemon.h>
14 .P
15 .BI "[[deprecated]] int bdflush(int " func ", long *" address );
16 .BI "[[deprecated]] int bdflush(int " func ", long " data );
17 .fi
18 .SH DESCRIPTION
19 .IR Note :
20 Since Linux 2.6,
21 .\" As noted in changes in the 2.5.12 source
22 this system call is deprecated and does nothing.
23 It is likely to disappear altogether in a future kernel release.
24 Nowadays, the task performed by
25 .BR bdflush ()
26 is handled by the kernel
27 .I pdflush
28 thread.
29 .P
30 .BR bdflush ()
31 starts, flushes, or tunes the buffer-dirty-flush daemon.
32 Only a privileged process (one with the
33 .B CAP_SYS_ADMIN
34 capability) may call
35 .BR bdflush ().
36 .P
37 If
38 .I func
39 is negative or 0, and no daemon has been started, then
40 .BR bdflush ()
41 enters the daemon code and never returns.
42 .P
43 If
44 .I func
45 is 1,
46 some dirty buffers are written to disk.
47 .P
48 If
49 .I func
50 is 2 or more and is even (low bit is 0), then
51 .I address
52 is the address of a long word,
53 and the tuning parameter numbered
54 .RI "(" "func" "\-2)/2"
55 is returned to the caller in that address.
56 .P
57 If
58 .I func
59 is 3 or more and is odd (low bit is 1), then
60 .I data
61 is a long word,
62 and the kernel sets tuning parameter numbered
63 .RI "(" "func" "\-3)/2"
64 to that value.
65 .P
66 The set of parameters, their values, and their valid ranges
67 are defined in the Linux kernel source file
68 .IR fs/buffer.c .
69 .SH RETURN VALUE
70 If
71 .I func
72 is negative or 0 and the daemon successfully starts,
73 .BR bdflush ()
74 never returns.
75 Otherwise, the return value is 0 on success and \-1 on failure, with
76 .I errno
77 set to indicate the error.
78 .SH ERRORS
79 .TP
80 .B EBUSY
81 An attempt was made to enter the daemon code after
82 another process has already entered.
83 .TP
84 .B EFAULT
85 .I address
86 points outside your accessible address space.
87 .TP
88 .B EINVAL
89 An attempt was made to read or write an invalid parameter number,
90 or to write an invalid value to a parameter.
91 .TP
92 .B EPERM
93 Caller does not have the
94 .B CAP_SYS_ADMIN
95 capability.
96 .SH STANDARDS
97 Linux.
98 .SH HISTORY
99 Since glibc 2.23, glibc no longer supports this obsolete system call.
100 .SH SEE ALSO
101 .BR sync (1),
102 .BR fsync (2),
103 .BR sync (2)