-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Euan Torano <[email protected]>
- Loading branch information
1 parent
f083b59
commit b2fc2c3
Showing
9 changed files
with
1,411 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
nimcache/ | ||
*.html | ||
tests/main | ||
nimcache | ||
tests/* | ||
!tests/*.nim | ||
!tests/nim.cfg | ||
src/* | ||
!src/*.nim | ||
nimsuggest.log | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
# pledge.nim | ||
# pledge.nim [![Travis CI Status](https://travis-ci.org/euantorano/pledge.nim.svg?branch=master)](https://travis-ci.org/euantorano/pledge.nim) | ||
|
||
A wrapper around OpenBSD's pledge(2) systemcall for Nim. | ||
|
||
## Installation | ||
|
||
This package can be installed using `nimble`: | ||
`pledge` can be installed using Nimble: | ||
|
||
``` | ||
nimble install pledge | ||
``` | ||
|
||
Or add the following to your `.nimble` file: | ||
|
||
``` | ||
# Dependencies | ||
requires "pledge >= 1.1.0" | ||
``` | ||
|
||
## Usage | ||
|
||
```nim | ||
import pledge | ||
if not pledge(Promises.Stdio): | ||
# Pledge failed, cannot use stdio | ||
quit(QuitFailure) | ||
pledge(Promises.Stdio) | ||
# As we haven't used pledge to ask to access files, the below will cause the program to be temrinated. | ||
# As we haven't used pledge to ask to access files, the below will cause the program to be temrinated with a SIGABRT. | ||
let f = open("/etc/rc.conf") | ||
``` |
Oops, something went wrong.