Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!rutgers!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Michael Meissner) Newsgroups: comp.unix.wizards Subject: Re: changing "stat" (was Re: Why Partition a Hard Disk) Message-ID: <1068@xyzzy.UUCP> Date: 5 Sep 88 14:32:31 GMT References: <4360004@wdl1.UUCP> <1988Aug31.174144.1694@utzoo.uucp> <8424@smoke.ARPA> <2381@pixar.UUCP> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 22 In article <2381@pixar.UUCP> rta@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@dg-rtp.DG.COM (or) meissner%dg-rtp.DG.COM@relay.cs.net