| 1 |
# PSX |
| 2 |
|
| 3 |
The Linux specific Go package, |
| 4 |
`"kernel.org/pub/linux/libs/security/libcap/psx"`, provides an API for |
| 5 |
invoking system calls in a way that each system call is mirrored on |
| 6 |
all OS threads of the combined Go/CGo runtime. Since the Go runtime |
| 7 |
treats OS threads as interchangeable, a feature like this is needed to |
| 8 |
meaningfully change process privilege (including dropping privilege) |
| 9 |
in a Go program running on Linux. This package is required by: |
| 10 |
|
| 11 |
- `"kernel.org/pub/linux/libs/security/libcap/cap"` |
| 12 |
|
| 13 |
When compiled `CGO_ENABLED=0`, the functionality requires go1.16+ to |
| 14 |
build. That release of Go introduced `syscall.AllThreadsSyscall*()` |
| 15 |
APIs. When compiled this way, the PSX package functions |
| 16 |
`psx.Syscall3()` and `psx.Syscall6()` are aliased to |
| 17 |
`syscall.AllThreadsSyscall()` and `syscall.AllThreadsSyscall6()` |
| 18 |
respectively. |
| 19 |
|
| 20 |
When compiled `CGO_ENABLED=1`, the functionality is implemented by C |
| 21 |
code, `[lib]psx`, which is distributed with `libcap`. |
| 22 |
|
| 23 |
The official release announcements for libcap and libpsx are on the |
| 24 |
[Fully Capable site](https://sites.google.com/site/fullycapable/). |
| 25 |
|
| 26 |
Like `libcap/libpsx`, the "psx" package is distributed with a "you |
| 27 |
choose" License. Specifically: BSD 3-clause, or GPL2. See the License |
| 28 |
file. |
| 29 |
|
| 30 |
Andrew G. Morgan <[email protected]> |