Edit

IABSD.fr/src/lib/libfuse/fuse_setup.3

Branch :

  • Show log

    Commit

  • Author : schwarze
    Date : 2025-09-23 09:28:28
    Hash : a61ae785
    Message : Minor cleanup in several of the FUSE manuals, including: * clarify that dying from a signal is not considered a failure of fuse_loop(3) * add many missing .Dv macros and a few missing .Pa and .Er macros * remove future tense in several cases where it's pointless * polish some capitalization and punctuation and fix a few typos OK helg@

  • lib/libfuse/fuse_setup.3
  • .\" $OpenBSD: fuse_setup.3,v 1.5 2025/09/23 09:28:28 schwarze Exp $
    .\"
    .\" Copyright (c) 2018 Helg Bredow <helg.bredow@openbsd.org>
    .\"
    .\" Permission to use, copy, modify, and distribute this software for any
    .\" purpose with or without fee is hereby granted, provided that the above
    .\" copyright notice and this permission notice appear in all copies.
    .\"
    .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    .\"
    .Dd $Mdocdate: September 23 2025 $
    .Dt FUSE_SETUP 3
    .Os
    .Sh NAME
    .Nm fuse_setup
    .Nd FUSE helper function
    .Sh SYNOPSIS
    .Lb libfuse
    .In fuse.h
    .Ft struct fuse *
    .Fn fuse_setup "int argc" "char **argv" \
        "const struct fuse_operations *ops" "size_t size" "char **mp" \
        "int *mt" "void *data"
    .Sh DESCRIPTION
    .Fn fuse_setup
    is a helper function that mounts a FUSE file system, creates a new FUSE
    session and installs signal handlers that will try to unmount the file
    system on
    .Dv SIGINT ,
    .Dv SIGTERM ,
    or
    .Dv SIGHUP .
    .Pp
    .Fn fuse_setup
    parses the arguments specified by
    .Fa argv ,
    and if neither the
    .Fl f ,
    .Fl d ,
    or
    .Fl odebug
    options were specified, detaches from the controlling terminal
    and runs in the background.
    On success,
    .Fa mt
    is set to 1 if the file system operations will be invoked in
    parallel (multi-threaded) or to 0 if file system operations are serialized.
    File systems that do not support multi-threaded operation must include the
    .Fl s
    argument in
    .Fa argv .
    .Ox
    does not currently support multi-threaded operation.
    .Pp
    The file system will be mounted on
    .Fa mp ,
    which is the directory specified by the first
    argument that does not match one of the options recognised by
    .Xr fuse_parse_cmdline 3 .
    .Pp
    .Fa fuse_operations
    is a struct of size
    .Fa size
    that contains pointers to FUSE file system operations.
    See
    .Xr fuse_new 3 .
    .Sh RETURN VALUES
    .Fn fuse_setup
    returns
    .Dv NULL
    on failure.
    .Sh SEE ALSO
    .Xr fuse_main 3 ,
    .Xr fuse_mount 3  ,
    .Xr fuse_new 3 ,
    .Xr fuse_parse_cmdline 3 ,
    .Xr fuse_set_signal_handlers 3 ,
    .Xr fuse_teardown 3 ,
    .Xr fuse 4
    .Sh STANDARDS
    The
    .Fn fuse_setup
    function conforms to FUSE 2.6.
    .Sh HISTORY
    The
    .Fn fuse_setup
    function first appeared in
    .Ox 5.4 .
    .Sh AUTHORS
    .An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
    .An Helg Bredow Aq Mt helg@openbsd.org