xref: /openbsd/lib/libfuse/fuse_daemonize.3 (revision 3cab2bb3)
1.\" $OpenBSD: fuse_daemonize.3,v 1.3 2018/11/28 21:19:11 mpi Exp $
2.\"
3.\" Copyright (c) 2018 Helg Bredow <helg@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 28 2018 $
18.Dt FUSE_DAEMONIZE 3
19.Os
20.Sh NAME
21.Nm fuse_daemonize
22.Nd run in the background
23.Sh SYNOPSIS
24.In fuse.h
25.Ft int
26.Fn fuse_daemonize "int foreground"
27.Sh DESCRIPTION
28If
29.Fa foreground
30is 1,
31.Fn fuse_daemonize
32will detach from the controlling terminal and run in the background as a
33system daemon.
34Otherwise, the process will continue to run in the foreground.
35.Pp
36The current working directory is changed to the root (/) and standard input;
37standard output and standard error are redirected to /dev/null.
38.Sh RETURN VALUES
39Upon success,
40.Fn fuse_daemonize
41returns 0; otherwise -1 is returned.
42.Sh ERRORS
43.Fn fuse_daemonize
44can fail for the same reasons as
45.Xr daemon 3 .
46.Sh SEE ALSO
47.Xr daemon 3 ,
48.Xr fuse_parse_cmdline 3
49.Sh STANDARDS
50The
51.Fn fuse_daemonize
52function conforms to FUSE 2.6.
53.Sh HISTORY
54The
55.Fn fuse_daemonize
56function first appeared in
57.Ox 5.4 .
58.Sh AUTHORS
59.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
60