]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/nfsctl.c
nfsctl: fix building with newer arches
[nfs-utils.git] / support / nfs / nfsctl.c
index c04588f7f5abbed305d32c710650e0ce895fa834..fec775f913d6879cf24b187de8aeb43598258fff 100644 (file)
@@ -6,19 +6,27 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <unistd.h>
+#include <errno.h>
 #include <asm/unistd.h>
 #include "nfslib.h"
 
 /* compatibility hack... */
-#ifndef __NR_nfsctl
+#if !defined(__NR_nfsctl) && defined(__NR_nfsservctl)
 #define __NR_nfsctl    __NR_nfsservctl
 #endif
 
 int
 nfsctl (int cmd, struct nfsctl_arg * argp, union nfsctl_res * resp)
 {
+#ifdef __NR_nfsctl
   return syscall (__NR_nfsctl, cmd, argp, resp);
+#else
+  errno = ENOSYS;
+  return -1;
+#endif
 }