summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/filesystems/empty_mntns/empty_mntns.h
blob: 3d9c6b14bbef92346ecb5d6b1f7d2e58cfd7f154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef EMPTY_MNTNS_H
#define EMPTY_MNTNS_H

#include <errno.h>
#include <stdlib.h>

#include "../statmount/statmount.h"

#ifndef UNSHARE_EMPTY_MNTNS
#define UNSHARE_EMPTY_MNTNS	0x00100000
#endif

#ifndef CLONE_EMPTY_MNTNS
#define CLONE_EMPTY_MNTNS	(1ULL << 37)
#endif

static inline ssize_t count_mounts(void)
{
	uint64_t list[4096];

	return listmount(LSMT_ROOT, 0, 0, list, sizeof(list) / sizeof(list[0]), 0);
}

#endif /* EMPTY_MNTNS_H */