Blame man2/bdflush.2

Packit 7cfc04
.\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995.
Packit 7cfc04
.\"
Packit 7cfc04
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
Packit 7cfc04
.\" This is free documentation; you can redistribute it and/or
Packit 7cfc04
.\" modify it under the terms of the GNU General Public License as
Packit 7cfc04
.\" published by the Free Software Foundation; either version 2 of
Packit 7cfc04
.\" the License, or (at your option) any later version.
Packit 7cfc04
.\"
Packit 7cfc04
.\" The GNU General Public License's references to "object code"
Packit 7cfc04
.\" and "executables" are to be interpreted as the output of any
Packit 7cfc04
.\" document formatting or typesetting system, including
Packit 7cfc04
.\" intermediate and printed output.
Packit 7cfc04
.\"
Packit 7cfc04
.\" This manual is distributed in the hope that it will be useful,
Packit 7cfc04
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 7cfc04
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 7cfc04
.\" GNU General Public License for more details.
Packit 7cfc04
.\"
Packit 7cfc04
.\" You should have received a copy of the GNU General Public
Packit 7cfc04
.\" License along with this manual; if not, see
Packit 7cfc04
.\" <http://www.gnu.org/licenses/>.
Packit 7cfc04
.\" %%%LICENSE_END
Packit 7cfc04
.\"
Packit 7cfc04
.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
Packit 7cfc04
.\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
Packit 7cfc04
.\"
Packit 7cfc04
.TH BDFLUSH 2 2016-10-08 "Linux" "Linux Programmer's Manual"
Packit 7cfc04
.SH NAME
Packit 7cfc04
bdflush \- start, flush, or tune buffer-dirty-flush daemon
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.nf
Packit 7cfc04
.B #include <sys/kdaemon.h>
Packit 7cfc04
.PP
Packit 7cfc04
.BI "int bdflush(int "  func ", long *" address );
Packit 7cfc04
.BI "int bdflush(int "  func ", long " data );
Packit 7cfc04
.fi
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
.IR Note :
Packit 7cfc04
Since Linux 2.6,
Packit 7cfc04
.\" As noted in a changes in the 2.5.12 source
Packit 7cfc04
this system call is deprecated and does nothing.
Packit 7cfc04
It is likely to disappear altogether in a future kernel release.
Packit 7cfc04
Nowadays, the task performed by
Packit 7cfc04
.BR bdflush ()
Packit 7cfc04
is handled by the kernel
Packit 7cfc04
.I pdflush
Packit 7cfc04
thread.
Packit 7cfc04
.PP
Packit 7cfc04
.BR bdflush ()
Packit 7cfc04
starts, flushes, or tunes the buffer-dirty-flush daemon.
Packit 7cfc04
Only a privileged process (one with the
Packit 7cfc04
.B CAP_SYS_ADMIN
Packit 7cfc04
capability) may call
Packit 7cfc04
.BR bdflush ().
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I func
Packit 7cfc04
is negative or 0, and no daemon has been started, then
Packit 7cfc04
.BR bdflush ()
Packit 7cfc04
enters the daemon code and never returns.
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I func
Packit 7cfc04
is 1,
Packit 7cfc04
some dirty buffers are written to disk.
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I func
Packit 7cfc04
is 2 or more and is even (low bit is 0), then
Packit 7cfc04
.I address
Packit 7cfc04
is the address of a long word,
Packit 7cfc04
and the tuning parameter numbered
Packit 7cfc04
.RI "(" "func" "\-2)/2"
Packit 7cfc04
is returned to the caller in that address.
Packit 7cfc04
.PP
Packit 7cfc04
If
Packit 7cfc04
.I func
Packit 7cfc04
is 3 or more and is odd (low bit is 1), then
Packit 7cfc04
.I data
Packit 7cfc04
is a long word,
Packit 7cfc04
and the kernel sets tuning parameter numbered
Packit 7cfc04
.RI "(" "func" "\-3)/2"
Packit 7cfc04
to that value.
Packit 7cfc04
.PP
Packit 7cfc04
The set of parameters, their values, and their valid ranges
Packit 7cfc04
are defined in the Linux kernel source file
Packit 7cfc04
.IR fs/buffer.c .
Packit 7cfc04
.SH RETURN VALUE
Packit 7cfc04
If
Packit 7cfc04
.I func
Packit 7cfc04
is negative or 0 and the daemon successfully starts,
Packit 7cfc04
.BR bdflush ()
Packit 7cfc04
never returns.
Packit 7cfc04
Otherwise, the return value is 0 on success and \-1 on failure, with
Packit 7cfc04
.I errno
Packit 7cfc04
set to indicate the error.
Packit 7cfc04
.SH ERRORS
Packit 7cfc04
.TP
Packit 7cfc04
.B EBUSY
Packit 7cfc04
An attempt was made to enter the daemon code after
Packit 7cfc04
another process has already entered.
Packit 7cfc04
.TP
Packit 7cfc04
.B EFAULT
Packit 7cfc04
.I address
Packit 7cfc04
points outside your accessible address space.
Packit 7cfc04
.TP
Packit 7cfc04
.B EINVAL
Packit 7cfc04
An attempt was made to read or write an invalid parameter number,
Packit 7cfc04
or to write an invalid value to a parameter.
Packit 7cfc04
.TP
Packit 7cfc04
.B EPERM
Packit 7cfc04
Caller does not have the
Packit 7cfc04
.B CAP_SYS_ADMIN
Packit 7cfc04
capability.
Packit 7cfc04
.SH VERSIONS
Packit 7cfc04
Since version 2.23, glibc no longer supports this obsolete system call.
Packit 7cfc04
.SH CONFORMING TO
Packit 7cfc04
.BR bdflush ()
Packit 7cfc04
is Linux-specific and should not be used in programs
Packit 7cfc04
intended to be portable.
Packit 7cfc04
.SH SEE ALSO
Packit 7cfc04
.BR sync (1),
Packit 7cfc04
.BR fsync (2),
Packit 7cfc04
.BR sync (2)
Packit 7cfc04
.SH COLOPHON
Packit 7cfc04
This page is part of release 4.15 of the Linux
Packit 7cfc04
.I man-pages
Packit 7cfc04
project.
Packit 7cfc04
A description of the project,
Packit 7cfc04
information about reporting bugs,
Packit 7cfc04
and the latest version of this page,
Packit 7cfc04
can be found at
Packit 7cfc04
\%https://www.kernel.org/doc/man\-pages/.