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

Rick Ace rta at pixar.UUCP
Sun Sep 4 05:19:06 AEST 1988


In article <8424 at smoke.ARPA>, gwyn at smoke.ARPA (Doug Gwyn ) writes:
# In article <66800 at sun.uucp> guy at gorodish.Sun.COM (Guy Harris) writes:
# >Yes, changing the "stat" structure may be painful.  Not changing it may be
# >painful as well....
# 
# A reasonable way to make the change is to introduce a new system call,
# which acts the way one wants (e.g. long st_ino), change the C library
# stat() interface to use the new system call (and change the stat.h
# header at the same time!), then recompile and test all the system
# software at one's leisure.  Old binaries keep working until one is
# finished checking everything out and removes the old system call (if
# ever; usually it is left enabled so customers don't have to recompile
# anything).  Old binaries can fail on long inode numbers, but this is
# no worse than not making the change, and at least the official system
# software has been upgraded to work right.

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.

Rick Ace
Pixar
3240 Kerner Blvd, San Rafael CA 94901
...!{sun,ucbvax}!pixar!rta



More information about the Comp.unix.wizards mailing list