diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-28 01:36:29 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-28 01:36:29 +0100 |
commit | b530ccc899a8cc8c63bad29abe1e479eb999b167 (patch) | |
tree | 07062947dfda3ac4356b0ce26de1cbe4e4c87ebd /src/bindings | |
parent | 52c415762fda7b9369ed4cf88783a6639574e3ea (diff) | |
download | chawan-b530ccc899a8cc8c63bad29abe1e479eb999b167.tar.gz |
Add capsicum support
It's the sandboxing system of FreeBSD. Quite pleasant to work with. (Just trying to figure out the basics with this one before tackling the abomination that is seccomp.) Indeed, the only non-trivial part was getting newSelector to work with Capsicum. Long story short it doesn't, so we use an ugly pointer cast + assignment. But even that is stdlib's "fault", not Capsicum's. This also gets rid of that ugly SocketPath global.
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/capsicum.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bindings/capsicum.nim b/src/bindings/capsicum.nim new file mode 100644 index 00000000..e01c3efb --- /dev/null +++ b/src/bindings/capsicum.nim @@ -0,0 +1,6 @@ +{.push header: "sys/capsicum.h", importc.} + +proc cap_enter*(): cint +proc cap_getmode*(modep: ptr cuint): cint + +{.pop.} |