Subject: Re: fstat derivations?
To: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
From: David Maxwell <david@fundy.ca>
List: tech-kern
Date: 11/29/1999 12:30:23
> What is the problem ? Why can't you just include <sys/stat.h> ?

We're 'teaching' the m3 compiler how to code NetBSD-fstat, and
the code is in m3, and m3 toolchain.

(pm3base)/libs/m3core/src/unix/netbsd-1/Ustat.i3

<*EXTERNAL "__fstat13"*> PROCEDURE fstat (fd: int;  buf: struct_stat_star): int;

> if you are in assembly or other non-C parts of the toolchain,
> one must use the real name, ie, __fstat13.

Ok. I had thought that was 'bad' because it looked like a
compat call, which would require people to have COMPAT_13.
I want to make sure this is fully release/current native.

We've tried with fstat, and __fstat13, and had trouble with
both, but different troubles. :-)

I'll see if there's a way to tell it all this....

On Mon, Nov 29, 1999 at 09:35:33AM -0500, Bill Sommerfeld wrote:
> <sys/stat.h> contains the following:
> int	stat __P((const char *, struct stat *))	__RENAME(__stat13);
> int	fstat __P((int, struct stat *))		__RENAME(__fstat13);
> ...
> int	stat (const char *, struct stat *) __asm__("__stat13");
> 
> The m3 translation of <sys/stat.h> will have to arrange for the symbol
> used in external linkage to differ from the language-visible name...
> or you'll need a M3 stub which calls a C language routine in the M3
> run time library which calls the C "stat" routine..

Ok, that tells me what the question is, now I can go work on an answer.
Thanks.

-- 
David Maxwell, david@vex.net|david@maxwell.net -->
All this stuff in twice the space would only look half as bad!
					      - me