[comp.unix.ultrix] Sun

bglenden@mandrill.cv.nrao.edu (Brian Glendenning) (11/24/90)

Suppose you have some ieee data loaded onto disk from an nfs mounted
sun (say). The bytes would be in the wrong order for the Decstation
(thank you DEC).

Does anyone have a working routine to unjumble them for the DEC (both
directions would be great). The source I have doesn't seem to work
properly...

Thanks!

Brian
--
       Brian Glendenning - National Radio Astronomy Observatory
bglenden@nrao.edu          bglenden@nrao.bitnet          (804) 296-0286

mf@ircam.fr (Michel Fingerhut) (11/25/90)

Use xdr - library routines for external data representation.
From the man page:

     These routines allow C  programmers  to  describe  arbitrary
     data  structures in a machine-independent fashion.  Data for
     remote procedure calls are transmitted using these routines.

grr@cbmvax.commodore.com (George Robbins) (11/26/90)

In article <1990Nov24.201244.7225@ircam.fr> mf@ircam.fr (Michel Fingerhut) writes:
> Use xdr - library routines for external data representation.

Except Ultrix floating point XDR is broken in Ultrix 3.X...
I think this is supposed to be fixed in 4.X, but I'm not
so sure.
-- 
George Robbins - now working for,     uucp:   {uunet|pyramid|rutgers}!cbmvax!grr
but no way officially representing:   domain: grr@cbmvax.commodore.com
Commodore, Engineering Department     phone:  215-431-9349 (only by moonlite)

bglenden@mandrill.cv.nrao.edu (Brian Glendenning) (11/26/90)

In article <1990Nov24.201244.7225@ircam.fr> mf@ircam.fr (Michel Fingerhut) writes:
   Use xdr - library routines for external data representation.
   From the man page:

	These routines allow C  programmers  to  describe  arbitrary
	data  structures in a machine-independent fashion.  Data for
	remote procedure calls are transmitted using these routines.

Alas, I actually need source. Any such would be greatly appreciated!

--
       Brian Glendenning - National Radio Astronomy Observatory
bglenden@nrao.edu          bglenden@nrao.bitnet          (804) 296-0286

p554mve@mpirbn.mpifr-bonn.mpg.de (Michael van Elst) (11/27/90)

In article <1990Nov24.201244.7225@ircam.fr> mf@ircam.fr (Michel Fingerhut) writes:
>Use xdr - library routines for external data representation.

Except for xdr_float/xdr_double is broken in Ultrix3.1

Regards,
-- 
Michael van Elst
UUCP:     universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
                                "A potential Snark may lurk in every tree."

hoyt@wreck.alf.dec.com (Kurt Hoyt) (11/27/90)

In article <1395@mpirbn.mpifr-bonn.mpg.de>, p554mve@mpirbn.mpifr-bonn.mpg.de
(Michael van Elst) writes:
|> In article <1990Nov24.201244.7225@ircam.fr> mf@ircam.fr (Michel Fingerhut)
writes:
|> >Use xdr - library routines for external data representation.
|> 
|> Except for xdr_float/xdr_double is broken in Ultrix3.1

This problem has been fixed in ULTRIX 4.0. The xdr_float.c file has ifdefs
to tell it whether you are using VAX or IEEE floating point. In xdr_float
and xdr_double, the floating point format was determined by this construct:

	#ifdef mc68000
		...IEEE code...
	#else
		...VAX code...
	#endif

If you weren't a Motorola 68000, the routine thought you were a VAX. Since the
MIPS chip is not a 68000, xdr_float incorrectly considered it a VAX.

--
Kurt in Atlanta         | Atlanta
hoyt@decatl.alf.dec.com | Site of the 1996 Olympics
hoyt@wreck.alf.dec.com  |