]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/bdflush.2
grfix
[thirdparty/man-pages.git] / man2 / bdflush.2
CommitLineData
fea681da
MK
1.\" Hey Emacs! This file is -*- nroff -*- source.
2.\"
3.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995.
4.\"
5.\" This is free documentation; you can redistribute it and/or
6.\" modify it under the terms of the GNU General Public License as
7.\" published by the Free Software Foundation; either version 2 of
8.\" the License, or (at your option) any later version.
9.\"
10.\" The GNU General Public License's references to "object code"
11.\" and "executables" are to be interpreted as the output of any
12.\" document formatting or typesetting system, including
13.\" intermediate and printed output.
14.\"
15.\" This manual is distributed in the hope that it will be useful,
16.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18.\" GNU General Public License for more details.
19.\"
20.\" You should have received a copy of the GNU General Public
21.\" License along with this manual; if not, write to the Free
22.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23.\" USA.
24.\"
25.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
c11b1abf 26.\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 27.\"
d9343c5c 28.TH BDFLUSH 2 2004-06-17 "Linux" "Linux Programmer's Manual"
fea681da
MK
29.SH NAME
30bdflush \- start, flush, or tune buffer-dirty-flush daemon
31.SH SYNOPSIS
32.nf
332f4bb9
MK
33.B #include <sys/kdaemon.h>
34
fea681da
MK
35.BI "int bdflush(int " func ", long *" address );
36.BI "int bdflush(int " func ", long " data );
37.fi
38.SH DESCRIPTION
e511ffb6 39.BR bdflush ()
fea681da
MK
40starts, flushes, or tunes the buffer-dirty-flush daemon.
41Only a privileged process (one with the
42.B CAP_SYS_ADMIN
43capability) may call
e511ffb6 44.BR bdflush ().
fea681da
MK
45.PP
46If
47.I func
48is negative or 0, and no daemon has been started, then
e511ffb6 49.BR bdflush ()
fea681da
MK
50enters the daemon code and never returns.
51.PP
52If
53.I func
54is 1,
55some dirty buffers are written to disk.
56.PP
57If
58.I func
59is 2 or more and is even (low bit is 0), then
60.I address
61is the address of a long word,
62and the tuning parameter numbered
63.RI "(" "func" "\-2)/2"
64is returned to the caller in that address.
65.PP
66If
67.I func
68is 3 or more and is odd (low bit is 1), then
69.I data
70is a long word,
71and the kernel sets tuning parameter numbered
72.RI "(" "func" "\-3)/2"
73to that value.
74.PP
75The set of parameters, their values, and their legal ranges
76are defined in the kernel source file
77.IR fs/buffer.c .
78.SH "RETURN VALUE"
79If
80.I func
81is negative or 0 and the daemon successfully starts,
e511ffb6 82.BR bdflush ()
fea681da
MK
83never returns.
84Otherwise, the return value is 0 on success and \-1 on failure, with
85.I errno
86set to indicate the error.
87.SH ERRORS
88.TP
89.B EBUSY
90An attempt was made to enter the daemon code after
91another process has already entered.
92.TP
93.B EFAULT
94.I address
95points outside your accessible address space.
96.TP
97.B EINVAL
98An attempt was made to read or write an invalid parameter number,
99or to write an invalid value to a parameter.
100.TP
101.B EPERM
102Caller does not have the
103.B CAP_SYS_ADMIN
104capability.
105.SH "CONFORMING TO"
0bfa087b 106.BR bdflush ()
8382f16d 107is Linux-specific and should not be used in programs
fea681da
MK
108intended to be portable.
109.SH "SEE ALSO"
110.BR fsync (2),
111.BR sync (2),
112.BR sync (8),
113.BR update (8)