sizes of objects in large model

Troy Saville evh at vax1.acs.udel.EDU
Wed Mar 15 12:12:08 AEST 1989


Mail bounced, so.....

In article <462 at lakesys.UUCP> chad at lakesys.UUCP (Chad Gibbons) writes:
>
>	I was having problems getting a program to work correctly under
>SCO XENIX/286 V2.2.3.  The program works as expected on the 386 version
>of the same OS.  It won't work because of same changes in pointer sizes
>in the large model program.  The program, by the way, is Spacewar, if
>that provides anyone any insight on how to get around this size problem.
>
>	The progam relies on two different structures being the same
>size.  Here are the definitions for the two structures:
>
>struct uio {
>	struct login far *uio_lgn;	/* user i/o pointer to login struct */
>	char	uio_chrs[16];	/* user i/o characters */
>};
>
>struct uio2 {
>	int	uio2sig;	/* signal, 0 for logon */
>	short	uio2pid;	/* process-id of playsw */
>	char	uio2tty[14];	/* ttyname for logon (signal 0 only) */
>};
>
...deleted...
>
>	In a small model program, sizeof() reports 20 for both uio
>structures.  In a large model (which the program must be to compile) the
>first uio struct is 20, and the second, uio2, is 18.
>
>	Any ideas on how to perhaps fix this?  In general, some
>information on generting portable programs across memory models would be
>helpful, not to mention any hints on how to get this monster program to
>compiled.
>
>D. Chadwick Gibbons, chad at lakesys.lakesys.com, ...!uunet!marque!lakesys!chad


I don't know if this will effect the program, but I would pad the end of
the uio2 structure with 2 chars, or change the length of uio2tty from 14
to 16. This size difference is a problem with the compiler.
I've used said xenix compiler and my opinion is that its poorly
written. I've had so many problems with it, but the list is long
so I won't bother printing it.



More information about the Comp.unix.xenix mailing list