changing "stat" (was Re: Why Partition a Hard Disk)

Michael Meissner meissner at xyzzy.UUCP
Tue Sep 6 00:32:31 AEST 1988


In article <2381 at pixar.UUCP> rta at pixar.UUCP (Rick Ace) writes:
	/* stuff about changing stat and old programs continue to work */
| If you try this, be sure to BLOW AWAY AND RECOMPILE all old .o files,
| because they expect to get the old stat structure back, and if you link
| them up with the new stat() in libc.a, they will get something other
| than what they are expecting; if the new struct stat is larger than
| the old one, memory following the structure will be mysteriously
| trashed, most likely leading to lots of head-scratching.

Actually it doesn't.  Since calling stat requires you to include
sys/stat.h, you can make both old programs and old .o files work.
Basically, there would be a macro "stat" which gets mapped to say
"_stat2" in the new stat.h that references a new name.  The library
would have both entry points.  Old .o's would go to the old name
"stat", and new ones would go to "_stat2".  Ie:

	#define	stat	_stat2

-- 
Michael Meissner, Data General.

Uucp:	...!mcnc!rti!xyzzy!meissner
Arpa:	meissner at dg-rtp.DG.COM   (or) meissner%dg-rtp.DG.COM at relay.cs.net



More information about the Comp.unix.wizards mailing list