tnew - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 78052719a88c74bc8e0f16f3d370643fce3e9573
 (DIR) parent 52bba5f01e7f57a418d28d4473387e304a47a729
 (HTM) Author: rsc <devnull@localhost>
       Date:   Wed, 13 Jul 2005 21:00:26 +0000
       
       new
       
       Diffstat:
         A src/cmd/vbackup/mount-Darwin.c      |       1 +
         A src/cmd/vbackup/mount-NetBSD.c      |      52 +++++++++++++++++++++++++++++++
         A src/cmd/vbackup/mount-OpenBSD.c     |      52 +++++++++++++++++++++++++++++++
         A src/cmd/vbackup/mount-SunOS.c       |       1 +
       
       4 files changed, 106 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/vbackup/mount-Darwin.c b/src/cmd/vbackup/mount-Darwin.c
       t@@ -0,0 +1 @@
       +#include "mount-none.c"
 (DIR) diff --git a/src/cmd/vbackup/mount-NetBSD.c b/src/cmd/vbackup/mount-NetBSD.c
       t@@ -0,0 +1,52 @@
       +#include <u.h>
       +#include <sys/socket.h>
       +#include <netinet/in.h>
       +#include <netdb.h>
       +#include <sys/stat.h>
       +#include <sys/param.h>
       +#include <sys/mount.h>
       +#include <sys/syslog.h>
       +#include <rpc/rpc.h>
       +#include <rpc/pmap_clnt.h>
       +#include <rpc/pmap_prot.h>
       +#include <nfs/rpcv2.h>
       +#include <nfs/nfsproto.h>
       +#include <nfs/nfs.h>
       +#include <libc.h>
       +#include "mountnfs.h"
       +
       +void
       +mountnfs(int proto, struct sockaddr_in *sa,
       +        uchar *handle, int nhandle, char *mtpt)
       +{
       +        int mflag;
       +        struct nfs_args na;
       +
       +        memset(&na, 0, sizeof na);
       +        na.version = NFS_ARGSVERSION;
       +        na.addr = (struct sockaddr*)sa;
       +        na.addrlen = sizeof *sa;
       +        na.sotype = proto;
       +        na.proto = (proto == SOCK_STREAM) ? IPPROTO_TCP : IPPROTO_UDP;
       +        na.fh = handle;
       +        na.fhsize = nhandle;
       +        na.flags = NFSMNT_RESVPORT|NFSMNT_NFSV3|NFSMNT_INT;
       +        na.wsize = NFS_WSIZE;
       +        na.rsize = NFS_RSIZE;
       +        na.readdirsize = NFS_READDIRSIZE;
       +        na.timeo = 2;
       +        na.retrans = NFS_RETRANS;
       +        na.maxgrouplist = NFS_MAXGRPS;
       +        na.readahead = 0;
       +        na.leaseterm = 0;
       +        na.deadthresh = 0;
       +        na.hostname = "backup";
       +        na.acregmin = 60;
       +        na.acregmax = 600;
       +        na.acdirmin = 60;
       +        na.acdirmax = 600;
       +
       +        mflag = MNT_RDONLY|MNT_NOSUID|MNT_NOATIME|MNT_NODEV;
       +        if(mount("nfs", mtpt, mflag, &na) < 0)
       +                sysfatal("mount: %r");
       +}
 (DIR) diff --git a/src/cmd/vbackup/mount-OpenBSD.c b/src/cmd/vbackup/mount-OpenBSD.c
       t@@ -0,0 +1,52 @@
       +#include <u.h>
       +#include <sys/socket.h>
       +#include <netinet/in.h>
       +#include <netdb.h>
       +#include <sys/stat.h>
       +#include <sys/param.h>
       +#include <sys/mount.h>
       +#include <sys/syslog.h>
       +#include <rpc/rpc.h>
       +#include <rpc/pmap_clnt.h>
       +#include <rpc/pmap_prot.h>
       +#include <nfs/rpcv2.h>
       +#include <nfs/nfsproto.h>
       +#include <nfs/nfs.h>
       +#include <libc.h>
       +#include "mountnfs.h"
       +
       +void
       +mountnfs(int proto, struct sockaddr_in *sa,
       +        uchar *handle, int nhandle, char *mtpt)
       +{
       +        int mflag;
       +        struct nfs_args na;
       +
       +        memset(&na, 0, sizeof na);
       +        na.version = NFS_ARGSVERSION;
       +        na.addr = (struct sockaddr*)sa;
       +        na.addrlen = sizeof *sa;
       +        na.sotype = proto;
       +        na.proto = (proto == SOCK_STREAM) ? IPPROTO_TCP : IPPROTO_UDP;
       +        na.fh = handle;
       +        na.fhsize = nhandle;
       +        na.flags = NFSMNT_RESVPORT|NFSMNT_NFSV3|NFSMNT_INT;
       +        na.wsize = NFS_WSIZE;
       +        na.rsize = NFS_RSIZE;
       +        na.readdirsize = NFS_READDIRSIZE;
       +        na.timeo = 2;
       +        na.retrans = NFS_RETRANS;
       +        na.maxgrouplist = NFS_MAXGRPS;
       +        na.readahead = 0;
       +        na.leaseterm = 0;
       +        na.deadthresh = 0;
       +        na.hostname = "backup";
       +        na.acregmin = 60;
       +        na.acregmax = 600;
       +        na.acdirmin = 60;
       +        na.acdirmax = 600;
       +
       +        mflag = MNT_RDONLY|MNT_NOSUID|MNT_NOATIME|MNT_NODEV;
       +        if(mount("nfs", mtpt, mflag, &na) < 0)
       +                sysfatal("mount: %r");
       +}
 (DIR) diff --git a/src/cmd/vbackup/mount-SunOS.c b/src/cmd/vbackup/mount-SunOS.c
       t@@ -0,0 +1 @@
       +#include "mount-none.c"