[Openmcl-devel] Accessing foreign #define'd constants

Denis Bueno dbueno at stygian.net
Sat Dec 18 10:29:20 PST 2004


I'm trying to write a littl FFI to ioctl(2). As one of its arguments, 
it requires some sort of control constant, e.g. BIOCSETIF, which is 
#define'd in <net/bpf.h>. Is there I way I can access constants like 
these directly, or do I have to figure what number is the value of 
BIOCSETIF, and use that number? Clearly the former is more portable, 
since the number used might be different under different library 
implementations (which probably isn't much of a worry in fact, though 
in principle it is).

If this sort of thing is covered in the documentation, I apologize in 
advance for the trouble.

If there is not a way to do this currently, is there a possibility of 
adding such capability? I would be interesting in adding it, if it's 
not supporte. I'm new to openmcl-ffi, though, so, the learning curve 
might initially delay the result.

--
Denis Bueno
PGP: http://pgp.mit.edu:11371/pks/lookup?search=0xA1B51B4B&op=index
"Clothes make the man. Naked people have little or no influence on 
society." - Mark Twain




More information about the Openmcl-devel mailing list