github.com/apptainer/singularity@v3.1.1+incompatible/cmd/starter/c/include/capability.h (about) 1 /* 2 * Copyright (c) 2017-2019, SyLabs, Inc. All rights reserved. 3 * Copyright (c) 2017, SingularityWare, LLC. All rights reserved. 4 * 5 * This software is licensed under a 3-clause BSD license. Please 6 * consult LICENSE.md file distributed with the sources of this project regarding 7 * your rights to use or distribute this software. 8 * 9 */ 10 11 12 #ifndef __SINGULARITY_CAPABILITY_H_ 13 #define __SINGULARITY_CAPABILITY_H_ 14 15 #include <linux/capability.h> 16 17 #define CAPSET_MAX 40 18 19 /* Support only 64 bits sets, since kernel 2.6.25 */ 20 #ifdef _LINUX_CAPABILITY_VERSION_3 21 # define LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 22 #elif defined(_LINUX_CAPABILITY_VERSION_2) 23 # define LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_2 24 #else 25 # error Linux 64 bits capability set not supported 26 #endif /* _LINUX_CAPABILITY_VERSION_3 */ 27 28 int capget(cap_user_header_t, cap_user_data_t); 29 int capset(cap_user_header_t, const cap_user_data_t); 30 31 #endif /* __SINGULARITY_CAPABILITY_H_ */