Re: pledge(2) API ideas for libraries

2016-06-13 Thread Ray Lai
pledge should be used to restrict a program to whatever it is necessary to do, rather than everything the library can do. So if I use libimaginarydb to parse a csv file I've already read into a memory buffer (nearly pledge("", NULL)), but the library can read/write/create files, do remote db

pledge(2) API ideas for libraries

2016-06-13 Thread bytevolcano
I have thought of a way pledge(2) can be made a little more library-friendly. This is not a patch, but just a thought. There are 2 setups I have thought of: === 1. Variable arguments === int pledge(const char *promises, const char *paths[]) { return vpledge(1,