summaryrefslogtreecommitdiff
path: root/util-linux/nfsmount.c
diff options
context:
space:
mode:
authorEric Andersen2002-12-11 04:04:26 +0000
committerEric Andersen2002-12-11 04:04:26 +0000
commit80ff9449bf01d1134e0cbf1806a9d2223348f360 (patch)
tree1958125e34b54a3e5e878cec6413f79d16b25cc3 /util-linux/nfsmount.c
parent0552b9a7ffbf4d1211029fd1f369f4840ef97083 (diff)
downloadbusybox-80ff9449bf01d1134e0cbf1806a9d2223348f360.zip
busybox-80ff9449bf01d1134e0cbf1806a9d2223348f360.tar.gz
Eliminate dependancy on kernel header files. Naughty naughty.
Using linux kernel headers is a Bad Thing(tm) and should be punished. -Erik
Diffstat (limited to 'util-linux/nfsmount.c')
-rw-r--r--util-linux/nfsmount.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index cd722ac..ba14aa6 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -50,9 +50,56 @@
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
-#include <linux/nfs.h> /* For the kernels nfs stuff */
#include "nfsmount.h"
+
+/*
+ * NFS stats. The good thing with these values is that NFSv3 errors are
+ * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
+ * no-one uses anyway), so we can happily mix code as long as we make sure
+ * no NFSv3 errors are returned to NFSv2 clients.
+ * Error codes that have a `--' in the v2 column are not part of the
+ * standard, but seem to be widely used nevertheless.
+ */
+enum nfs_stat {
+ NFS_OK = 0, /* v2 v3 */
+ NFSERR_PERM = 1, /* v2 v3 */
+ NFSERR_NOENT = 2, /* v2 v3 */
+ NFSERR_IO = 5, /* v2 v3 */
+ NFSERR_NXIO = 6, /* v2 v3 */
+ NFSERR_EAGAIN = 11, /* v2 v3 */
+ NFSERR_ACCES = 13, /* v2 v3 */
+ NFSERR_EXIST = 17, /* v2 v3 */
+ NFSERR_XDEV = 18, /* v3 */
+ NFSERR_NODEV = 19, /* v2 v3 */
+ NFSERR_NOTDIR = 20, /* v2 v3 */
+ NFSERR_ISDIR = 21, /* v2 v3 */
+ NFSERR_INVAL = 22, /* v2 v3 that Sun forgot */
+ NFSERR_FBIG = 27, /* v2 v3 */
+ NFSERR_NOSPC = 28, /* v2 v3 */
+ NFSERR_ROFS = 30, /* v2 v3 */
+ NFSERR_MLINK = 31, /* v3 */
+ NFSERR_OPNOTSUPP = 45, /* v2 v3 */
+ NFSERR_NAMETOOLONG = 63, /* v2 v3 */
+ NFSERR_NOTEMPTY = 66, /* v2 v3 */
+ NFSERR_DQUOT = 69, /* v2 v3 */
+ NFSERR_STALE = 70, /* v2 v3 */
+ NFSERR_REMOTE = 71, /* v2 v3 */
+ NFSERR_WFLUSH = 99, /* v2 */
+ NFSERR_BADHANDLE = 10001, /* v3 */
+ NFSERR_NOT_SYNC = 10002, /* v3 */
+ NFSERR_BAD_COOKIE = 10003, /* v3 */
+ NFSERR_NOTSUPP = 10004, /* v3 */
+ NFSERR_TOOSMALL = 10005, /* v3 */
+ NFSERR_SERVERFAULT = 10006, /* v3 */
+ NFSERR_BADTYPE = 10007, /* v3 */
+ NFSERR_JUKEBOX = 10008 /* v3 */
+};
+
+#define NFS_PROGRAM 100003
+
+
+
#ifndef NFS_FHSIZE
static const int NFS_FHSIZE = 32;
#endif