OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / bdflush.2
1 .\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995.
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
25 .\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
26 .\"
27 .TH BDFLUSH 2 2014-08-19 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 bdflush \- start, flush, or tune buffer-dirty-flush daemon
30 .SH SYNOPSIS
31 .nf
32 .B #include <sys/kdaemon.h>
33
34 .BI "int bdflush(int "  func ", long *" address );
35 .BI "int bdflush(int "  func ", long " data );
36 .fi
37 .SH DESCRIPTION
38 .IR Note :
39 Since Linux 2.6,
40 .\" As noted in a changes in the 2.5.12 source
41 this system call is deprecated and does nothing.
42 It is likely to disappear altogether in a future kernel release.
43 Nowadays, the task performed by
44 .BR bdflush ()
45 is handled by the kernel
46 .I pdflush
47 thread.
48
49 .BR bdflush ()
50 starts, flushes, or tunes the buffer-dirty-flush daemon.
51 Only a privileged process (one with the
52 .B CAP_SYS_ADMIN
53 capability) may call
54 .BR bdflush ().
55 .PP
56 If
57 .I func
58 is negative or 0, and no daemon has been started, then
59 .BR bdflush ()
60 enters the daemon code and never returns.
61 .PP
62 If
63 .I func
64 is 1,
65 some dirty buffers are written to disk.
66 .PP
67 If
68 .I func
69 is 2 or more and is even (low bit is 0), then
70 .I address
71 is the address of a long word,
72 and the tuning parameter numbered
73 .RI "(" "func" "\-2)/2"
74 is returned to the caller in that address.
75 .PP
76 If
77 .I func
78 is 3 or more and is odd (low bit is 1), then
79 .I data
80 is a long word,
81 and the kernel sets tuning parameter numbered
82 .RI "(" "func" "\-3)/2"
83 to that value.
84 .PP
85 The set of parameters, their values, and their valid ranges
86 are defined in the Linux kernel source file
87 .IR fs/buffer.c .
88 .SH RETURN VALUE
89 If
90 .I func
91 is negative or 0 and the daemon successfully starts,
92 .BR bdflush ()
93 never returns.
94 Otherwise, the return value is 0 on success and \-1 on failure, with
95 .I errno
96 set to indicate the error.
97 .SH ERRORS
98 .TP
99 .B EBUSY
100 An attempt was made to enter the daemon code after
101 another process has already entered.
102 .TP
103 .B EFAULT
104 .I address
105 points outside your accessible address space.
106 .TP
107 .B EINVAL
108 An attempt was made to read or write an invalid parameter number,
109 or to write an invalid value to a parameter.
110 .TP
111 .B EPERM
112 Caller does not have the
113 .B CAP_SYS_ADMIN
114 capability.
115 .SH CONFORMING TO
116 .BR bdflush ()
117 is Linux-specific and should not be used in programs
118 intended to be portable.
119 .SH SEE ALSO
120 .BR fsync (2),
121 .BR sync (2),
122 .BR sync (1)
123 .SH COLOPHON
124 This page is part of release 3.79 of the Linux
125 .I man-pages
126 project.
127 A description of the project,
128 information about reporting bugs,
129 and the latest version of this page,
130 can be found at
131 \%http://www.kernel.org/doc/man\-pages/.