Can I force a Sun 4 *NOT* to align elements on 16 bit boundaries

Mark Stein marks at sun.com
Fri Dec 23 05:38:47 AEST 1988


> I think the best way out is to write a routine to do the I/O on your file,
> treating it as a byte stream, and fill in or read out of the struct
> aligned how the host machine wants it. Now that should port .... ;-)!

Hmmm.  This sounds suspiciously like XDR.  Designed for precisely this
purpose.  Portable, too.

Hint1:  Look at xdrstdio_create().  This attaches an XDR data stream to
	a stdio file pointer.

Hint2:  rpcgen can be used to generate XDR routines for your data types
	independent of whether they will be used in RPC requests.

	--Mark Stein <marks at sun.com>
	Sun Microsystems, Distributed System Software



More information about the Comp.sys.sun mailing list