From: Ross Maloney <defaultuser@domain.com>
Subject: Help to crawl into the file system
Date: 1997/10/10 [thread overview]
Message-ID: <343DF14A.9FB4DCBA@domain.com> (raw)
Hi,
I need to create a program on DUnix that acts as an extension of the
file system. The program, running in the background, is to mount at a
particular point in the file system and then respond to DUnix system
requests, much in the fashion of NFS. Could somebody help me in
overcoming these coding difficulties:
o establishing the mount via the system procedure;
o showing how DUnix would send service requests (together with their
format) to, and expect responses from, this program - may be by
a reference to the documentation set.
My suspicion is that sockets are involved in this process.
I am using DUnix v3.2c, compiling with gcc v2.7.2 and have access to
V3.2C Online Documentation. </P>
In relation to the first of these questions, the following program was
written:
#include <sys/mount.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
main()
{
int mnt_type, mnt_flag;
struct nfs_args mnt_structure;
struct sockaddr_in *sock;
mnt_type = MOUNT_NFS3;
mnt_flag = M_NOEXEC; /* not very ambitious */
bzero((char *)&mnt_structure, sizeof(mnt_structure));
mnt_structure.addr = sock;
mnt_structure.fh = "/";
mnt_structure.flags = M_GRPID;
mnt_structure.wsize = 8192;
mnt_structure.rsize = 8192;
mnt_structure.timeo = 100; /* 10s timeout */
mnt_structure.retrans = 0;
mnt_structure.hostname = "rwin";
mnt_structure.netname = "net";
printf("mount return = %d\n",
mount(mnt_type, "/mnt", mnt_flag, (caddr_t)&mnt_structure));
printf("mount: [%d] %s\n", errno, strerror(errno));
}
When run, a "[14] Bad address" error response was obtained. What am I
doing wrong?
Ross
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Ross Maloney = voice: +61 (08) 9364 1927
+
Graduate Student =
Department of Computer Science +
Curtin University of Technology = email: x409@cs.curtin.edu.au
Perth, WA. +
AUSTRALIA =
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
reply other threads:[~1997-10-10 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox