Question

I'm trying to port some code from FreeBSD to OS X. The code is fairly low-level and it creates a number of special device files using make_dev() and controls functionality using functions like ioctl().

Ideally I'd like to keep my code as close to the original as possible so I can more easily merge upstream changes in the future: my question is, is there a way to create such device files on OS X? According to wikipedia the idiom is supported on the platform. Can someone point me in the right direction?

Was it helpful?

Solution

I think I've answered my own question: it seems the function to do this is devfs_make_node(). I can't find a man page but it is shown in some example code here.

OTHER TIPS

Per the docs, mknod does work on OS X. What problems are you having with it?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top