in reply to Using ioctl()
struct { byte a; long b; }
may take up 6 bytes on a system with 4-byte integers and a 2-byte alignment requirement for integers. OTOH on a system with 4-byte aligned 4-byte integers, it might take up 8 bytes.
Ofcourse, there are modules to deal with all of this, a CPAN search gave me this (probably incomplete) list:
note - I've not tested any of these and if none of them work, I know Inline::C does, but it's probably overkill for this application. Also, if you only need it to work on a specific system, you can hardcode the pack() template anyway (you might have to experiment to get the right one).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using ioctl()
by tye (Sage) on Oct 08, 2004 at 21:48 UTC |