Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chris-huxtable/pledge.cr
Adds pledge(2) to crystal.
https://github.com/chris-huxtable/pledge.cr
crystal crystal-lang crystal-language openbsd pledge shards
Last synced: about 2 months ago
JSON representation
Adds pledge(2) to crystal.
- Host: GitHub
- URL: https://github.com/chris-huxtable/pledge.cr
- Owner: chris-huxtable
- License: isc
- Created: 2018-01-19T05:22:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T02:30:39.000Z (over 3 years ago)
- Last Synced: 2024-06-21T18:09:51.230Z (3 months ago)
- Topics: crystal, crystal-lang, crystal-language, openbsd, pledge, shards
- Language: Crystal
- Homepage:
- Size: 27.3 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - pledge.cr - Bindings for OpenBSD's `pledge(2)` (C bindings)
- awesome-crystal - pledge.cr - Bindings for OpenBSD's `pledge(2)` (C bindings)
- awesome-pledge - pledge.cr - *Adds pledge(2) to crystal* (Libraries)
- awesome-crystal - pledge.cr - Bindings for OpenBSD's `pledge(2)` (C bindings)
README
# pledge.cr
[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://chris-huxtable.github.io/pledge.cr/)
[![GitHub release](https://img.shields.io/github/release/chris-huxtable/pledge.cr.svg)](https://github.com/chris-huxtable/pledge.cr/releases)Adds `pledge(2)` to crystal.
## Installation
Add this to your application's `shard.yml`:
``` yaml
dependencies:
pledge:
github: chris-huxtable/pledge.cr
```## Usage
``` crystal
require "pledge"
```Partial `syscall` restrictions:
``` crystal
Process.pledge(:stdio, :rpath, :wpath, :flock)
Process.pledge("stdio", "rpath")
```Full restrictions:
``` crystal
Process.pledge()
```More information and a list of 'promises' is available in the OpenBSD [man pages](http://man.openbsd.org/pledge).
## Contributing
1. Fork it ( https://github.com/chris-huxtable/pledge.cr/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [Chris Huxtable](https://github.com/chris-huxtable) - creator, maintainer