| #include <rpc/pmap_clnt.h> |
| #include <rpc/pmap_prot.h> |
| #include <nfs/nfsproto.h> |
| #if defined(__FreeBSD_version) && __FreeBSD_version >= 500000 |
| # include <nfsclient/nfs.h> |
| # include <nfs/nfsmount.h> |
| mountnfs(int proto, struct sockaddr_in *sa, |
| uchar *handle, int nhandle, char *mtpt) |
| memset(&na, 0, sizeof na); |
| na.version = NFS_ARGSVERSION; |
| na.addr = (struct sockaddr*)sa; |
| na.proto = (proto == SOCK_STREAM) ? IPPROTO_TCP : IPPROTO_UDP; |
| na.flags = NFSMNT_RESVPORT|NFSMNT_NFSV3|NFSMNT_INT; |
| na.readdirsize = NFS_READDIRSIZE; |
| na.retrans = NFS_RETRANS; |
| na.maxgrouplist = NFS_MAXGRPS; |
| #if !defined(__NetBSD__) && !defined(__APPLE__) |
| mflag = MNT_RDONLY|MNT_NOSUID|MNT_NOATIME|MNT_NODEV; |
| if(mount("nfs", mtpt, mflag, &na) < 0) |