Subject: Re: SunOS compatibility question
To: None <port-sparc@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: port-sparc
Date: 03/01/1996 07:10:25
>> well I'd tried to use a static library targeted for SunOS system
>> under NetBSD1.1/Sparc. And it appears that I can't use it: some .o
>> files in this pecular lib use the syscall vhangup() and some other
>> use the array _iob[].
> _iob[] is where objects of type FILE are stored [in SunOS stdio].
> The structure of a FILE should not be available to the application.
> This abstraction is respected by most software out there.
The presence of _iob references does not in itself mean that the
application code is not properly respecting data structure hiding for
FILEs. Sun stdio defines
#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
so any code that uses stdin, stdout, or stderr will inevitably contain
a reference to _iob. The getc and putc macros also expand to code that
knows about the internals of a FILE, so the generated binary code will
depend on how a FILE is laid out even when the source code doesn't.
der Mouse
mouse@collatz.mcrcim.mcgill.edu