summaryrefslogtreecommitdiff
path: root/nfs/nfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'nfs/nfs.c')
-rw-r--r--nfs/nfs.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/nfs/nfs.c b/nfs/nfs.c
index 490f494b..a44e1fde 100644
--- a/nfs/nfs.c
+++ b/nfs/nfs.c
@@ -97,6 +97,37 @@ hurd_mode_to_nfs_mode (mode_t mode)
return mode & 07777;
}
+/* Convert a Hurd mode to an NFS type */
+int
+hurd_mode_to_nfs_type (mode_t mode)
+{
+ switch (mode & S_IFMT)
+ {
+ case S_IFDIR:
+ return NFDIR;
+
+ case S_IFCHR:
+ default:
+ return NFCHR;
+
+ case S_IFBLK:
+ return NFBLK;
+
+ case S_IFREG:
+ return NFREG;
+
+ case S_IFLNK:
+ return NFLNK;
+
+ case S_IFSOCK:
+ return NFSOCK;
+
+ case S_IFIFO:
+ return protocol_version == 2 ? NF2FIFO : NF3FIFO;
+ }
+}
+
+
/* Each of the functions on this page copies its second arg to *P,
converting it to XDR representation along the way. They then