source: project/wiki/eggref/4/pledge @ 33385

Last change on this file since 33385 was 33385, checked in by evhan, 3 years ago

egg-locations: Migrate my eggs from bitbucket.org to foldling.org

File size: 957 bytes
Line 
1[[tags: egg]]
2
3== pledge
4
5[[toc:]]
6
7== Description
8
9This extension provides bindings to OpenBSD's
10[[http://man.openbsd.org/OpenBSD-current/man2/pledge.2|{{pledge(2)}}]]
11system call.
12
13The source for this egg is available
14[[http://git.foldling.org/chicken-pledge.git|here]].
15
16== Usage
17
18A single procedure is provided, which has the same interface as the
19system call.
20
21<enscript highlight="scheme">
22(use pledge)
23(pledge "rpath")
24</enscript>
25
26=== API
27
28<procedure>(pledge promises) => fixnum</procedure>
29
30Restricts the current process to the capabilities specified by
31{{promises}}, which should be a string.
32
33On success, {{0}} is returned. On error, {{-1}} is returned and
34{{errno}} should be consulted.
35
36Refer to {{pledge(2)}} for more information.
37
38== Limitations
39
40Path whitelisting is not available (since, at the time of writing,
41{{pledge(2)}}'s whitelisting feature is itself unavailable).
42
43== License
44
45Copyright © 2016, Evan Hanson, 3-clause BSD license.
Note: See TracBrowser for help on using the repository browser.