summaryrefslogtreecommitdiff
path: root/nfs/nfs.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-09-04 12:47:04 +0000
committerThomas Bushnell <thomas@gnu.org>1996-09-04 12:47:04 +0000
commitad593a5f3264eeef8d8cc3dd95202d49de2e376a (patch)
tree2a58a24d0ef4e63b02f4af72155e63f899d703c5 /nfs/nfs.c
parent74751f8f52c16a07d75247cd5258e83ba5d11638 (diff)
*** empty log message ***
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