/* Header file for mounting/unmount Linux filesystems.
Copyright (C) 1996-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
. */
/* This is taken from /usr/include/linux/fs.h. */
#ifndef _SYS_MOUNT_H
#define _SYS_MOUNT_H 1
#include
#include
#include
#include
#ifdef __has_include
# if __has_include ("linux/mount.h")
# include "linux/mount.h"
# endif
#endif
#define BLOCK_SIZE_BITS 10
#define BLOCK_SIZE (1<
# define O_CLOEXEC __O_CLOEXEC
#endif
#ifndef OPEN_TREE_CLOEXEC
# define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
#endif
__BEGIN_DECLS
/* Mount a filesystem. */
extern int mount (const char *__special_file, const char *__dir,
const char *__fstype, unsigned long int __rwflag,
const void *__data) __THROW;
/* Unmount a filesystem. */
extern int umount (const char *__special_file) __THROW;
/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */
extern int umount2 (const char *__special_file, int __flags) __THROW;
/* Open the filesystem referenced by FS_NAME so it can be configured for
mouting. */
extern int fsopen (const char *__fs_name, unsigned int __flags) __THROW;
/* Create a mount representation for the FD created by fsopen using
FLAGS with ATTR_FLAGS describing how the mount is to be performed. */
extern int fsmount (int __fd, unsigned int __flags,
unsigned int __ms_flags) __THROW;
/* Add the mounted FROM_DFD referenced by FROM_PATHNAME filesystem returned
by fsmount in the hierarchy in the place TO_DFD reference by TO_PATHNAME
using FLAGS. */
extern int move_mount (int __from_dfd, const char *__from_pathname,
int __to_dfd, const char *__to_pathname,
unsigned int flags) __THROW;
/* Set parameters and trigger CMD action on the FD context. KEY, VALUE,
and AUX are used depending ng of the CMD. */
extern int fsconfig (int __fd, unsigned int __cmd, const char *__key,
const void *__value, int __aux) __THROW;
/* Equivalent of fopen for an existing mount point. */
extern int fspick (int __dfd, const char *__path, unsigned int __flags)
__THROW;
/* Open the mount point FILENAME in directory DFD using FLAGS. */
extern int open_tree (int __dfd, const char *__filename, unsigned int __flags)
__THROW;
/* Change the mount properties of the mount or an entire mount tree. If
PATH is a relative pathname, then it is interpreted relative to the
directory referred to by the file descriptor dirfd. Otherwise if DFD is
the special value AT_FDCWD then PATH is interpreted relative to the current
working directory of the calling process. */
extern int mount_setattr (int __dfd, const char *__path, unsigned int __flags,
struct mount_attr *__uattr, size_t __usize)
__THROW;
__END_DECLS
#endif /* _SYS_MOUNT_H */