>>> On 2017/6/23 23:59, Ted Unangst wrote: >>> >>> Jia-Ju Bai wrote: >>>> >>>> Hi, >>>> >>>> I am a freshman in developing OpenBSD drivers, and I have a question in >>>> lock usage in OpenBSD kernel code.
Hi, I have a more basic question regarding OpenBSD development (not kernel). I would like to target OpenBSD with some networking code I am writing in C++ (again, in user land, not kernel networking code). I'd like to follow the OpenBSD way and make use of the safer family of C functions and best practices that OpenBSD makes use of. I was thinking the best way to get started would be to spend two to three months reading code for portions of OpenBSD utilities that have been written from scratch for OpenBSD (like Ted's doas), and then read the man pages for specific function calls (pledge, etc.), but I seem to recall (I may be wrong), there might be a man page that codifies best practices for OpenBSD development - not the coding style but more of an overview of best practices - such as, "Prefer OpenBSD specific functionXYZ() as opposed to strncpy()" (a contrived example but something in that respect). From there I'll be able to then read the man page for the specific functions in as much detail as needed. Separate from the possible man page, are there any relatively up-to-date examples that developers have been using to learn best practices for writing software for OpenBSD ? I note that Undeadly had an interesting link [1] where the code is read over IRC and the logs are available (I plan to start going over these as well). Thanks, - J Sources: [1] https://blog.tintagel.pl/2017/06/09/openbsd-daily.html

