From 48fa2d15260325182050a5d60f15dc7e3c1eb55a Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 2 Feb 1996 00:28:06 +0000 Subject: Formerly main.c.~3~ --- nfs/main.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'nfs') diff --git a/nfs/main.c b/nfs/main.c index fa4b082d..c91992be 100644 --- a/nfs/main.c +++ b/nfs/main.c @@ -19,14 +19,53 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ #include +#include +#include +#include #include "nfs.h" int main () { + mach_port_t bootstrap; + static volatile int hold = 1; + + while (hold); + + bootstrap = task_get_bootstrap_port (mach_task_self (), &bootstrap); netfs_init (); + main_udp_socket = socket (PF_INET, SOCK_DGRAM, 0); + soft_mount_retries = 3; + + { + mach_port_t host, dev_master, timedev, obj; + errno = get_privileged_ports (&host, &dev_master); + if (errno) + { + perror ("getting privileged ports"); + exit (1); + } + device_open (dev_master, 0, "time", &timedev); + device_map (timedev, VM_PROT_READ, 0, + sizeof (mapped_time_value_t), &obj, 0); + vm_map (mach_task_self (), (vm_address_t *)&mapped_time, + sizeof (mapped_time_value_t), 0, 1, obj, 0, 0, VM_PROT_READ, + VM_PROT_READ, VM_INHERIT_NONE); + mach_port_deallocate (mach_task_self (), timedev); + mach_port_deallocate (mach_task_self (), obj); + } + + cthread_detach (cthread_fork ((cthread_fn_t) timeout_service_thread, 0)); + cthread_detach (cthread_fork ((cthread_fn_t) rpc_receive_thread, 0)); + netfs_root_node = mount_root ("/home/gd4", "duality.gnu.ai.mit.edu"); + hostname = ""; + + if (!netfs_root_node) + exit (1); + + netfs_startup (bootstrap, 0); for (;;) netfs_server_loop (); -- cgit v1.2.3