Subject: __LIBC12_SOURCE__
To: None <current-users@NetBSD.ORG>
From: Bill Studenmund <skippy@macro.stanford.edu>
List: current-users
Date: 10/27/1997 20:37:23
What is the purpose of this define?

I think it's so that <sys/stat.h> can be used to compile programs which
will link w/ libc's from before the libc.13 adventure. But it doesn't
quite work.

In the userland export of stat.h (#ifndef KERNEL) shouldn't the second
argument to stat ALWAYS be a struct stat? I mean don't most programs use
struct stat as whatever gets sent to/from the stat system call?

Right now __LIBC12_SOURCE__ will generate code which will link right with
an old libc, but the source code needs to be changed to declare structures
of struct stat12, not struct stat.

I'm suggesting something like replacing line 88 "struct stat {" with

struct
#if defined(__LIBC12_SOURCE__) && !defined(KERNEL)
stat13
#else
stat
#endif
{

somehow making struct stat equivelant to struct stat12 (would
struct stat struct stat12; work?)

changing the defines to make ___stat13 take a struct stat13 * as its
second parameter.

It's gross, but I thought the point was to make the libc.13 stuff
invisable as much as possable.

Should I send-pr this?

Take care,

Bill