aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/_p9dir.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-08 20:17:02 +0000
committerrsc <devnull@localhost>2005-02-08 20:17:02 +0000
commit2acd6fa6ff4948a90a2a7338afd9a96f94637f33 (patch)
treeee1faaa6855c5677e992f5d0061368c048b78f47 /src/lib9/_p9dir.c
parent0a2290523265287829036cbbc71e4cbbc80207d8 (diff)
downloadplan9port-2acd6fa6ff4948a90a2a7338afd9a96f94637f33.tar.gz
plan9port-2acd6fa6ff4948a90a2a7338afd9a96f94637f33.tar.bz2
plan9port-2acd6fa6ff4948a90a2a7338afd9a96f94637f33.zip
expose unix mode bits
Diffstat (limited to 'src/lib9/_p9dir.c')
-rw-r--r--src/lib9/_p9dir.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c
index 4f95932e..8a748b9d 100644
--- a/src/lib9/_p9dir.c
+++ b/src/lib9/_p9dir.c
@@ -181,6 +181,20 @@ _p9dir(struct stat *lst, struct stat *st, char *name, Dir *d, char **str, char *
d->qid.type = QTDIR;
}
+ if(S_ISLNK(st->st_mode))
+ d->mode |= DMSYMLINK;
+ if(S_ISFIFO(st->st_mode))
+ d->mode |= DMNAMEDPIPE;
+ if(S_ISSOCK(st->st_mode))
+ d->mode |= DMSOCKET;
+ if(S_ISBLK(st->st_mode)){
+ d->mode |= DMDEVICE;
+ d->qid.path = ('b'<<16)|st->st_rdev;
+ }
+ if(S_ISCHR(st->st_mode)){
+ d->mode |= DMDEVICE;
+ d->qid.path = ('c'<<16)|st->st_rdev;
+ }
/* fetch real size for disks */
#ifdef _HAVEDISKSIZE
if(S_ISBLK(st->st_mode) && (fd = open(name, O_RDONLY)) >= 0){