[Yaffs] yaffs/direct: R_OK and friends, S_IREAD and friends

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Rutger Hofman
Date:  
To: yaffs@lists.aleph1.co.uk
Subject: [Yaffs] yaffs/direct: R_OK and friends, S_IREAD and friends
Good evening list,

1. R_OK and friends

in yaffs/direct/yaffsfs.[ch], there is a usage and optional define of
R_OK, W_OK, X_OK, F_OK. If I read the man pages correctly (on Linux,
Solaris and eCos), these macros must be defined in unistd.h. Is there a
reason that that file is not included in e.g. direct/yaffsfs.h, in
tandem with the (optional) includes of errno.h, sys/stat.h, and fcntl.h?

2. S_IREAD and friends

It seems that S_IREAD is deprecated by S_IRUSR, S_IWRITE by S_IWUSR, and
S_IEXEC by S_IXUSR. (Google tells me so.) Is it a good idea to replace
the obsoleted macros with the official ones? It is easy to work around
this, by invoking make CFLAGS='-DIREAD=S_IRUSR' etc etc. Are there
reasons that S_IREAD and friends are used?

3. loff_t

loff_t is a Linux extension. It is a bit all over the place, imported
from mtd I'd guess. It is easy to do -Dloff_t=off_t of course; but my
system isn't Linux, so this feels a bit away-from-home.

Thanks for comments,

Rutger Hofman
VU Amsterdam