use

use std :: os :: raw :: c_char ;

use

use std :: os :: raw :: c_int ;

"c"

# [ link ( name = "c" ) ]

use

use std :: ffi :: CString ;

new

let

if

if let Ok ( c_str ) = CString :: new ( promises ) {

let

let result = pledge_ffi :: pledge ( c_str.as_ptr ( ) , std :: ptr :: null ( ) ) ;

use

use pledge :: pledge ;

use

use std :: process :: exit ;

use

use std :: fs :: File ;

use

use std :: io :: Write ;

let

let mut stderr = std :: io :: stderr ( ) ;

// example will crash

// example will crash

// change to "stdio rpath"

// change to "stdio rpath"

if

if ! pledge ( "stdio" ) {

"Now pledged."

println ! ( "Now pledged." ) ;

if

if ! pledge ( "stdio rpath" ) {

// .. promises were equal or reduced

// .. promises were equal or reduced