Microport Unix -- Large Model Problems
David Herron, NPR Lover
david at ukma.uky.csnet
Sat Nov 8 03:40:51 AEST 1986
In article <840 at ur-valhalla.UUCP> dave at valhalla.UUCP (Dave Carlson) writes:
>A potential problem I smacked into yesterday when porting BSD to SV/AT
>is ioctl(2) expects as the third argument:
>union { int iarg;
> char *cparg;}
>Problem is that the union will pull 4 bytes off the stack (in large model)
>but the program calling with an integer will only push 2 bytes. Oh S*$&!
>I cast my integer args long and everything seems ok but what a pain...
Argh! And you're doing a port of an operating system???
UNIONS are the SAME size regardless of WHICH part of them you use!
A user which passes an int to a routine expecting a union is ASKING
for trouble!
Argh!
--
David Herron, cbosgd!ukma!david, david at UKMA.BITNET, david at ms.uky.csnet
(I'm also "postmaster", "news", "netnews", "uucp", "mmdf", and ...)
(And also the ACM chapter chairperson.)
(And even an all-around nice guy. Aren't you lucky to get something from me?)
More information about the Comp.unix.wizards
mailing list