tools/testing/selftests/filesystems/empty_mntns/empty_mntns.h

Source file repositories/reference/linux-study-clean/tools/testing/selftests/filesystems/empty_mntns/empty_mntns.h

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/filesystems/empty_mntns/empty_mntns.h
Extension
.h
Size
491 bytes
Lines
26
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#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 */

Annotation

Implementation Notes