1 /* Bind mount detection.
3 Copyright (C) 2005, 2007, 2008 Red Hat, Inc. All rights reserved.
4 This copyrighted material is made available to anyone wishing to use, modify,
5 copy, or redistribute it subject to the terms and conditions of the GNU General
8 This program is distributed in the hope that it will be useful, but WITHOUT ANY
9 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10 PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License along with
13 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
14 Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 Author: Miloslav Trmac <mitr@redhat.com>
18 plocate modifications: Copyright (C) 2020 Steinar H. Gunderson.
19 plocate parts and modifications are licensed under the GPLv2 or, at your option,
23 #ifndef BIND_MOUNT_H__
24 #define BIND_MOUNT_H__
26 /* System mount information file */
27 #define MOUNTINFO_PATH "/proc/self/mountinfo"
29 /* Return true if PATH is a destination of a bind mount.
30 (Bind mounts "to self" are ignored.) */
31 extern bool is_bind_mount(const char *path);
33 /* Initialize state for is_bind_mount(), to read data from MOUNTINFO_PATH. */
34 extern void bind_mount_init();