xref: /netbsd-src/lib/librefuse/refuse/session.h (revision 48491f9819751125d121614a85f27fc971ad5fe6)
1*48491f98Sandvar /* $NetBSD: session.h,v 1.2 2024/02/11 10:36:40 andvar Exp $ */
29f391507Spho 
39f391507Spho /*
49f391507Spho  * Copyright (c) 2021 The NetBSD Foundation, Inc.
59f391507Spho  * All rights reserved.
69f391507Spho  *
79f391507Spho  * Redistribution and use in source and binary forms, with or without
89f391507Spho  * modification, are permitted provided that the following conditions
99f391507Spho  * are met:
109f391507Spho  * 1. Redistributions of source code must retain the above copyright
119f391507Spho  *    notice, this list of conditions and the following disclaimer.
129f391507Spho  * 2. Redistributions in binary form must reproduce the above copyright
139f391507Spho  *    notice, this list of conditions and the following disclaimer in the
149f391507Spho  *    documentation and/or other materials provided with the distribution.
159f391507Spho  * 3. The name of the author may not be used to endorse or promote
169f391507Spho  *    products derived from this software without specific prior written
179f391507Spho  *    permission.
189f391507Spho  *
199f391507Spho  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
209f391507Spho  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
219f391507Spho  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
229f391507Spho  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
239f391507Spho  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
249f391507Spho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
259f391507Spho  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
269f391507Spho  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
279f391507Spho  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
289f391507Spho  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
299f391507Spho  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
309f391507Spho  */
319f391507Spho #if !defined(_FUSE_SESSION_H_)
329f391507Spho #define _FUSE_SESSION_H_
339f391507Spho 
349f391507Spho /* FUSE session API
359f391507Spho  */
369f391507Spho 
379f391507Spho #if !defined(FUSE_H_)
389f391507Spho #  error Do not include this header directly. Include <fuse.h> instead.
399f391507Spho #endif
409f391507Spho 
419f391507Spho #ifdef __cplusplus
429f391507Spho extern "C" {
439f391507Spho #endif
449f391507Spho 
459f391507Spho /* Forward declarations */
469f391507Spho struct fuse;
479f391507Spho 
489f391507Spho /* A private structure appeared on FUSE 2.4. */
499f391507Spho struct fuse_session;
509f391507Spho 
519f391507Spho /* Get a session from a fuse object. Appeared on FUSE 2.6. */
529f391507Spho struct fuse_session *fuse_get_session(struct fuse *f);
539f391507Spho 
54*48491f98Sandvar /* Get the file descriptor for communication with kernel. Appeared on
559f391507Spho  * FUSE 3.0. */
569f391507Spho int fuse_session_fd(struct fuse_session *se);
579f391507Spho 
589f391507Spho /* Exit a session on SIGHUP, SIGTERM, and SIGINT and ignore
599f391507Spho  * SIGPIPE. Appeared on FUSE 2.5. */
609f391507Spho int fuse_set_signal_handlers(struct fuse_session *se);
619f391507Spho 
629f391507Spho /* Restore default signal handlers. Appeared on FUSE 2.5. */
639f391507Spho void fuse_remove_signal_handlers(struct fuse_session *se);
649f391507Spho 
659f391507Spho #ifdef __cplusplus
669f391507Spho }
679f391507Spho #endif
689f391507Spho 
699f391507Spho #endif
70