1 |
/* Main NFS server program |
/* Main NFS server program |
2 |
Copyright (C) 1996 Free Software Foundation, Inc. |
Copyright (C) 1996, 2002 Free Software Foundation, Inc. |
3 |
Written by Michael I. Bushnell, p/BSG. |
Written by Michael I. Bushnell, p/BSG. |
4 |
|
|
5 |
This file is part of the GNU Hurd. |
This file is part of the GNU Hurd. |
24 |
#include <rpc/pmap_prot.h> |
#include <rpc/pmap_prot.h> |
25 |
#include <maptime.h> |
#include <maptime.h> |
26 |
#include <hurd.h> |
#include <hurd.h> |
27 |
|
#include <error.h> |
28 |
|
|
29 |
int main_udp_socket, pmap_udp_socket; |
int main_udp_socket, pmap_udp_socket; |
30 |
struct sockaddr_in main_address, pmap_address; |
struct sockaddr_in main_address, pmap_address; |
48 |
nthreads = atoi (argv[1]); |
nthreads = atoi (argv[1]); |
49 |
if (!nthreads) |
if (!nthreads) |
50 |
nthreads = 4; |
nthreads = 4; |
51 |
|
|
52 |
authserver = getauth (); |
authserver = getauth (); |
53 |
maptime_map (0, 0, &mapped_time); |
maptime_map (0, 0, &mapped_time); |
54 |
|
|
65 |
sizeof (struct sockaddr_in)); |
sizeof (struct sockaddr_in)); |
66 |
if (fail) |
if (fail) |
67 |
error (1, errno, "Binding NFS socket"); |
error (1, errno, "Binding NFS socket"); |
68 |
|
|
69 |
fail = bind (pmap_udp_socket, (struct sockaddr *)&pmap_address, |
fail = bind (pmap_udp_socket, (struct sockaddr *)&pmap_address, |
70 |
sizeof (struct sockaddr_in)); |
sizeof (struct sockaddr_in)); |
71 |
if (fail) |
if (fail) |
75 |
|
|
76 |
cthread_detach (cthread_fork ((cthread_fn_t) server_loop, |
cthread_detach (cthread_fork ((cthread_fn_t) server_loop, |
77 |
(any_t) pmap_udp_socket)); |
(any_t) pmap_udp_socket)); |
78 |
|
|
79 |
while (nthreads--) |
while (nthreads--) |
80 |
cthread_detach (cthread_fork ((cthread_fn_t) server_loop, |
cthread_detach (cthread_fork ((cthread_fn_t) server_loop, |
81 |
(any_t) main_udp_socket)); |
(any_t) main_udp_socket)); |
82 |
|
|
83 |
for (;;) |
for (;;) |
84 |
{ |
{ |
85 |
sleep (1); |
sleep (1); |