xref: /aosp_15_r20/external/ltp/include/lapi/setns.h (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Worker /*
3*49cdfc7eSAndroid Build Coastguard Worker   Copyright (c) 2020 Cyril Hrubis <[email protected]>
4*49cdfc7eSAndroid Build Coastguard Worker  */
5*49cdfc7eSAndroid Build Coastguard Worker 
6*49cdfc7eSAndroid Build Coastguard Worker #ifndef LAPI_SETNS_H__
7*49cdfc7eSAndroid Build Coastguard Worker #define LAPI_SETNS_H__
8*49cdfc7eSAndroid Build Coastguard Worker 
9*49cdfc7eSAndroid Build Coastguard Worker #include "config.h"
10*49cdfc7eSAndroid Build Coastguard Worker #include "lapi/syscalls.h"
11*49cdfc7eSAndroid Build Coastguard Worker #include <sched.h>
12*49cdfc7eSAndroid Build Coastguard Worker 
13*49cdfc7eSAndroid Build Coastguard Worker #ifndef HAVE_SETNS
setns(int fd,int nstype)14*49cdfc7eSAndroid Build Coastguard Worker static inline int setns(int fd, int nstype)
15*49cdfc7eSAndroid Build Coastguard Worker {
16*49cdfc7eSAndroid Build Coastguard Worker 	return tst_syscall(__NR_setns, fd, nstype);
17*49cdfc7eSAndroid Build Coastguard Worker }
18*49cdfc7eSAndroid Build Coastguard Worker #endif
19*49cdfc7eSAndroid Build Coastguard Worker 
20*49cdfc7eSAndroid Build Coastguard Worker #endif /* LAPI_SETNS_H__ */
21