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