4 * Get the FH for a given client and directory. This function takes
5 * the NFS protocol version number as an additional argument.
7 * This function has nothing in common with the SunOS getfh function,
8 * which is a front-end to the RPC mount call.
10 * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
16 #include <sys/types.h>
21 getfh_old (struct sockaddr *addr, dev_t dev, ino_t ino)
23 static union nfsctl_res res;
24 struct nfsctl_arg arg;
26 arg.ca_version = NFSCTL_VERSION;
27 arg.ca_getfh.gf_version = 2; /* obsolete */
28 arg.ca_getfh.gf_dev = dev;
29 arg.ca_getfh.gf_ino = ino;
30 memcpy(&arg.ca_getfh.gf_addr, addr, sizeof(struct sockaddr_in));
32 if (nfsctl(NFSCTL_GETFH, &arg, &res) < 0)
39 getfh(struct sockaddr *addr, const char *path)
41 static union nfsctl_res res;
42 struct nfsctl_arg arg;
44 arg.ca_version = NFSCTL_VERSION;
45 arg.ca_getfd.gd_version = 2; /* obsolete */
46 strncpy(arg.ca_getfd.gd_path, path,
47 sizeof(arg.ca_getfd.gd_path) - 1);
48 arg.ca_getfd.gd_path[sizeof (arg.ca_getfd.gd_path) - 1] = '\0';
49 memcpy(&arg.ca_getfd.gd_addr, addr, sizeof(struct sockaddr_in));
51 if (nfsctl(NFSCTL_GETFD, &arg, &res) < 0)