blob: ab4bcefefda7eb715e9fe1f17e2a60416f6b3ee2 [file] [log] [blame]
Andrew G. Morgan876ac712020-07-02 21:36:16 -07001package cap
2
Andrew G. Morgan90192cd2020-12-11 23:27:50 -08003import (
4 "syscall"
5
6 "kernel.org/pub/linux/libs/security/libcap/psx"
7)
Andrew G. Morgan876ac712020-07-02 21:36:16 -07008
9// multisc provides syscalls overridable for testing purposes that
10// support a single kernel security state for all OS threads.
Andrew G. Morgan90192cd2020-12-11 23:27:50 -080011// We use this version when we are cgo compiling because
12// we need to manage the native C pthreads too.
Andrew G. Morgan876ac712020-07-02 21:36:16 -070013var multisc = &syscaller{
Andrew G. Morgan90192cd2020-12-11 23:27:50 -080014 w3: psx.Syscall3,
15 w6: psx.Syscall6,
Andrew G. Morgan876ac712020-07-02 21:36:16 -070016 r3: syscall.RawSyscall,
17 r6: syscall.RawSyscall6,
18}
19
20// singlesc provides a single threaded implementation. Users should
21// take care to ensure the thread is locked and marked nogc.
22var singlesc = &syscaller{
23 w3: syscall.RawSyscall,
24 w6: syscall.RawSyscall6,
25 r3: syscall.RawSyscall,
26 r6: syscall.RawSyscall6,
27}