From ae635e83d31faa0e99788278c4b11bdc7eb8bb21 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 19 Nov 1996 22:38:17 +0000 Subject: (diskfs_S_io_stat): Set S_IATRANS & S_IROOT bits in st_mode field of returned buffer if appropiate. --- libdiskfs/io-stat.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libdiskfs') diff --git a/libdiskfs/io-stat.c b/libdiskfs/io-stat.c index df8b4291..be584ff7 100644 --- a/libdiskfs/io-stat.c +++ b/libdiskfs/io-stat.c @@ -25,18 +25,32 @@ diskfs_S_io_stat (struct protid *cred, io_statbuf_t *statbuf) { struct node *np; + mach_port_t atrans; if (!cred) return EOPNOTSUPP; np = cred->po->np; mutex_lock (&np->lock); + iohelp_get_conch (&np->conch); if (diskfs_synchronous) diskfs_node_update (np, 1); else diskfs_set_node_times (np); + bcopy (&np->dn_stat, statbuf, sizeof (struct stat)); + statbuf->st_mode &= ~(S_IATRANS | S_IROOT); + if (fshelp_fetch_control (&np->transbox, &atrans) == 0 + && atrans != MACH_PORT_NULL) + { + statbuf->st_mode |= S_IATRANS; + mach_port_deallocate (mach_task_self (), atrans); + } + if (np == diskfs_root_node) + statbuf->st_mode |= S_IROOT; + mutex_unlock (&np->lock); + return 0; } -- cgit v1.2.3