]>
Commit | Line | Data |
---|---|---|
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 |
30 | bdflush \- 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 |
40 | starts, flushes, or tunes the buffer-dirty-flush daemon. |
41 | Only a privileged process (one with the | |
42 | .B CAP_SYS_ADMIN | |
43 | capability) may call | |
e511ffb6 | 44 | .BR bdflush (). |
fea681da MK |
45 | .PP |
46 | If | |
47 | .I func | |
48 | is negative or 0, and no daemon has been started, then | |
e511ffb6 | 49 | .BR bdflush () |
fea681da MK |
50 | enters the daemon code and never returns. |
51 | .PP | |
52 | If | |
53 | .I func | |
54 | is 1, | |
55 | some dirty buffers are written to disk. | |
56 | .PP | |
57 | If | |
58 | .I func | |
59 | is 2 or more and is even (low bit is 0), then | |
60 | .I address | |
61 | is the address of a long word, | |
62 | and the tuning parameter numbered | |
63 | .RI "(" "func" "\-2)/2" | |
64 | is returned to the caller in that address. | |
65 | .PP | |
66 | If | |
67 | .I func | |
68 | is 3 or more and is odd (low bit is 1), then | |
69 | .I data | |
70 | is a long word, | |
71 | and the kernel sets tuning parameter numbered | |
72 | .RI "(" "func" "\-3)/2" | |
73 | to that value. | |
74 | .PP | |
75 | The set of parameters, their values, and their legal ranges | |
76 | are defined in the kernel source file | |
77 | .IR fs/buffer.c . | |
78 | .SH "RETURN VALUE" | |
79 | If | |
80 | .I func | |
81 | is negative or 0 and the daemon successfully starts, | |
e511ffb6 | 82 | .BR bdflush () |
fea681da MK |
83 | never returns. |
84 | Otherwise, the return value is 0 on success and \-1 on failure, with | |
85 | .I errno | |
86 | set to indicate the error. | |
87 | .SH ERRORS | |
88 | .TP | |
89 | .B EBUSY | |
90 | An attempt was made to enter the daemon code after | |
91 | another process has already entered. | |
92 | .TP | |
93 | .B EFAULT | |
94 | .I address | |
95 | points outside your accessible address space. | |
96 | .TP | |
97 | .B EINVAL | |
98 | An attempt was made to read or write an invalid parameter number, | |
99 | or to write an invalid value to a parameter. | |
100 | .TP | |
101 | .B EPERM | |
102 | Caller does not have the | |
103 | .B CAP_SYS_ADMIN | |
104 | capability. | |
105 | .SH "CONFORMING TO" | |
0bfa087b | 106 | .BR bdflush () |
8382f16d | 107 | is Linux-specific and should not be used in programs |
fea681da MK |
108 | intended to be portable. |
109 | .SH "SEE ALSO" | |
110 | .BR fsync (2), | |
111 | .BR sync (2), | |
112 | .BR sync (8), | |
113 | .BR update (8) |