From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,e5197d2b151fd857 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-11-06 14:29:32 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: Bob Harris Newsgroups: comp.unix.tru64 Subject: Re: Tru64 st_flags? References: <3DC61ADA.9040702@ev.co.yu> Posted-And-Mailed: yes User-Agent: MT-NewsWatcher/3.1 (PPC) Message-ID: Date: Wed, 06 Nov 2002 22:29:56 GMT NNTP-Posting-Host: 16.140.32.31 X-Complaints-To: abuse@Compaq.com X-Trace: news.cpqcorp.net 1036621796 16.140.32.31 (Wed, 06 Nov 2002 14:29:56 PST) NNTP-Posting-Date: Wed, 06 Nov 2002 14:29:56 PST Organization: Hewlett-Packard Company Xref: archiver1.google.com comp.unix.tru64:9077 In article , vjv0vjv@yahoo.com (Vince Jameson) wrote: X Nikola Milutinovic 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