4 * This is the user level part of nfsd. This is very primitive, because
5 * all the work is now done in the kernel module.
7 * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
20 static void usage(const char *);
23 main(int argc, char **argv)
25 int count = 1, c, error, port;
29 /* FIXME: Check for nfs in /etc/services */
31 while ((c = getopt(argc, argv, "hp:P:")) != EOF) {
33 case 'P': /* XXX for nfs-server compatibility */
36 if (port <= 0 || port > 65535) {
37 fprintf(stderr, "%s: bad port number: %s\n",
49 if (chdir(NFS_STATEDIR)) {
50 fprintf(stderr, "%s: chdir(%s) failed: %s\n",
51 argv [0], NFS_STATEDIR, strerror(errno));
56 if ((count = atoi(argv[optind])) < 0) {
57 /* insane # of servers */
59 "%s: invalid server count (%d), using 1\n",
65 if ((error = nfssvc(port, count)) < 0)
72 usage(const char *prog)
74 fprintf(stderr, "usage:\n"
75 "%s nrservs\n", prog);