views:

65

answers:

2

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?

A: 

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

Alex Martelli
Sorry, that was a hasty edit: I'm not sure mknod does the same thing as make_dev...
jkp
A: 

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.

jkp