From: Bob Harris <harris@zk3.dec.com>
Subject: Re: Tru64 st_flags?
Date: Wed, 06 Nov 2002 22:29:56 GMT [thread overview]
Message-ID: <harris-5A72B8.17293206112002@juggl7.zk3.dec.com> (raw)
In-Reply-To: def432e7.0211061037.6f45689@posting.google.com
In article <def432e7.0211061037.6f45689@posting.google.com>,
vjv0vjv@yahoo.com (Vince Jameson) wrote:
X Nikola Milutinovic <Nikola.Milutinovic@ev.co.yu> wrote in message
X news:<3DC61ADA.9040702@ev.co.yu>...
X > Vince Jameson wrote:
X > > I'm working on an app that needs to periodically call lstat(2) on a
X > > given file and save off a copy of certain relevant fields ( st_mode,
X > > the time fields, and so on ). Right now I'm stuck trying to figure
X > > out what to do with Tru64's st_flags field. I understand the presence
X > > of this field derives from the BSD side of things, and on the BSD
X > > variants I've dealt with I've been able to find documentation on what
X > > the various bits in st_flags represent.
X > >
X > > Some of these flags are fairly important ( immutable, append only,
X > > etc. ), so recently I've been searching for information on how to
X > > interpret the same field on Tru64 / OSF1, so far without success. I'm
X > > curious if anyone knows where to find this information, or failing
X > > that, whether st_flags is even documented or not.
X >
X > If all esle fails, try /usr/include/*.h files - they are usually well
X > commented.
X >
X > Nixie.
X
X
X I tried that already, before asking here. The comment in
X /usr/include/sys/stat.h regarding st_flags just says "user defined
X flags for file". That provides no useful info, and I can't even make
X the assumption that the contents of the field really are "user
X defined"; FreeBSD's stat.h says the exact same thing regarding its
X st_flags field, and then goes on to define a bunch of constants for
X the various bits in the field. I put together a quick test app that
X outputs the hex value of st_flags for a given file, and it's clear
X there's a pattern of some sort, as opposed to the zero or garbage data
X one would expect from an unused field.
X
X Vince
Each file system treats the flags differently. I only found evidence of
autofs and ufs using the flags (and since mfs is based on ufs, I would
expect it to use the ufs flags). AdvFS most definitly does not use
them. It just stores them if a layered file system ask it to, and
returns them (CFS, NFS, etc... layer on top of a physical file system,
but I don't see either of them generating their own flags, so it looks
like a mute point). It does not appear that CFS, CDFS, DVDFS, NFS, ...
uses the flags, but I did not have time for an exhaustive search. I
also do not know what they really mean since I'm not a ufs or autofs
developer, nor to I care to learn :-) Chances are the ufs meanings came
from BSD, so I would suspect looking at one of the BSD distribution
source code ufs implementations might show more information about some
of these flags.
ufs (from /usr/include/ufs/inode.h)
IRENAME 0x0004 /* inode is being renamed */
IUPD 0x0010 /* file has been modified */
IACC 0x0020 /* inode access time to be updated */
ICHG 0x0040 /* inode has been changed */
IMOD 0x0080 /* inode has been modified */
ISHLOCK 0x0100 /* file has shared lock */
IEXLOCK 0x0200 /* file has exclusive lock */
ILWAIT 0x0400 /* someone waiting on file lock */
INACTIVATING 0x0800 /* inode is being inactivated */
INACTWAIT 0x1000 /* waiting for inode inactivation */
IREADERROR 0x2000 /* disk read for inode failed */
IQUOTA 0x4000 /* inode has quotas attached */
IQUOTING 0x8000 /* quota attach in progress */
IQUOTWAIT 0x10000 /* waiting while attach progresses */
ICHGMETA 0x20000 /* Meta data changed and not on disk */
IOLDDEVT 0x40000 /* TEMPORARY: this is an old devt */
ICHGCTIME 0x80000 /* inode C-time is to be modified */
IFSYNCING 0x1000000 /* fsync taking place on this inode. */
IWAITFSYNC 0x2000000 /* Wait for inode's fsync to finish. */
ufs SysV environment (from /usr/include/s5fs/s5inode.h)
S5IUPD 02 /* file has been modified */
S5IACC 04 /* inode access time to be updated */
S5IMOUNT 010 /* inode is mounted on */
S5IWANT 020 /* some process waiting on lock */
S5ITEXT 040 /* inode is pure text prototype */
S5ICHG 0100 /* inode has been changed */
S5ISYN 0200 /* do synchronous write for iupdate */
S5IRENAME 0400 /* inode is being renamed */
autofs
AUTOFS_INTERCEPT 0x10000000 /* intercept point */
AUTOFS_OBJECT 0x20000000 /* in the AutoFS name space */
Bob Harris
next prev parent reply other threads:[~2002-11-06 22:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 1:50 Tru64 st_flags? Vince Jameson
2002-11-04 6:59 ` Nikola Milutinovic
2002-11-06 18:37 ` Vince Jameson
2002-11-06 22:29 ` Bob Harris [this message]
2002-11-07 22:13 ` Vince Jameson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox