jcs's openbsd hax
openbsd
at jcs 62 lines 1.9 kB view raw
1.\" $OpenBSD: fuse_daemonize.3,v 1.6 2025/09/23 09:28:28 schwarze 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: September 23 2025 $ 18.Dt FUSE_DAEMONIZE 3 19.Os 20.Sh NAME 21.Nm fuse_daemonize 22.Nd run in the background 23.Sh SYNOPSIS 24.Lb libfuse 25.In fuse.h 26.Ft int 27.Fn fuse_daemonize "int foreground" 28.Sh DESCRIPTION 29If 30.Fa foreground 31is 0, 32.Fn fuse_daemonize 33detaches from the controlling terminal and runs in the background as a 34system daemon. 35Otherwise, the process continues to run in the foreground. 36.Pp 37The current working directory is changed to the root directory 38.Pq Pa / . 39Standard input, standard output, and standard error are redirected to 40.Pa /dev/null . 41.Sh RETURN VALUES 42Upon success, 43.Fn fuse_daemonize 44returns 0; otherwise -1 is returned. 45.Sh ERRORS 46.Fn fuse_daemonize 47can fail for the same reasons as 48.Xr daemon 3 . 49.Sh SEE ALSO 50.Xr daemon 3 , 51.Xr fuse_parse_cmdline 3 52.Sh STANDARDS 53The 54.Fn fuse_daemonize 55function conforms to FUSE 2.6. 56.Sh HISTORY 57The 58.Fn fuse_daemonize 59function first appeared in 60.Ox 5.4 . 61.Sh AUTHORS 62.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com