diff options
author | Thomas Bushnell <thomas@gnu.org> | 1997-09-16 19:30:42 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1997-09-16 19:30:42 +0000 |
commit | d75428bda5e617c4b5a4384c9c4ec2cf4c8f36bb (patch) | |
tree | a0008c9c8e684aead6e572b4f717755e3e699233 /proc | |
parent | 12deb7789c80390e1a5a3fa883c578876694ab4d (diff) |
Tue Sep 16 15:26:04 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* host.c (hostid, hostname, hostnamelen): Delete variables.
(S_proc_sethostid, S_proc_gethostid, S_proc_sethostname,
S_proc_gethostname): Delete functions.
Diffstat (limited to 'proc')
-rw-r--r-- | proc/ChangeLog | 6 | ||||
-rw-r--r-- | proc/host.c | 81 |
2 files changed, 8 insertions, 79 deletions
diff --git a/proc/ChangeLog b/proc/ChangeLog index 75a4c8c0..4411b38a 100644 --- a/proc/ChangeLog +++ b/proc/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 16 15:26:04 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * host.c (hostid, hostname, hostnamelen): Delete variables. + (S_proc_sethostid, S_proc_gethostid, S_proc_sethostname, + S_proc_gethostname): Delete functions. + Wed Aug 20 14:06:46 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * main.c (main): New args for diff --git a/proc/host.c b/proc/host.c index fbbe1317..8f9460cb 100644 --- a/proc/host.c +++ b/proc/host.c @@ -1,5 +1,5 @@ /* Proc server host management calls - Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation + Copyright (C) 1992, 1993, 1994, 1996, 1997 Free Software Foundation This file is part of the GNU Hurd. @@ -36,9 +36,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "proc.h" #include "process_S.h" -static long hostid; -static char *hostname; -static int hostnamelen; static mach_port_t *std_port_array; static int *std_int_array; static int n_std_ports, n_std_ints; @@ -57,81 +54,6 @@ struct execdata_notify struct execdata_notify *next; } *execdata_notifys; -/* Implement proc_sethostid as described in <hurd/proc.defs>. */ -kern_return_t -S_proc_sethostid (struct proc *p, - int newhostid) -{ - if (!p) - return EOPNOTSUPP; - - if (! check_uid (p, 0)) - return EPERM; - - hostid = newhostid; - - return 0; -} - -/* Implement proc_gethostid as described in <hurd/proc.defs>. */ -kern_return_t -S_proc_gethostid (struct proc *p, - int *outhostid) -{ - /* No need to check P here; we don't use it. */ - *outhostid = hostid; - return 0; -} - -/* Implement proc_sethostname as described in <hurd/proc.defs>. */ -kern_return_t -S_proc_sethostname (struct proc *p, - char *newhostname, - u_int newhostnamelen) -{ - int len; - if (!p) - return EOPNOTSUPP; - - if (! check_uid (p, 0)) - return EPERM; - - if (hostname) - free (hostname); - - hostname = malloc (newhostnamelen + 1); - hostnamelen = newhostnamelen; - - bcopy (newhostname, hostname, newhostnamelen); - hostname[newhostnamelen] = '\0'; - - len = newhostnamelen + 1; - if (len > sizeof uname_info.nodename) - len = sizeof uname_info.nodename; - bcopy (hostname, uname_info.nodename, len); - uname_info.nodename[sizeof uname_info.nodename - 1] = '\0'; - - return 0; -} - -/* Implement proc_gethostname as described in <hurd/proc.defs>. */ -kern_return_t -S_proc_gethostname (struct proc *p, - char **outhostname, - u_int *outhostnamelen) -{ - /* No need to check P here; we don't use it. */ - - if (*outhostnamelen < hostnamelen + 1) - vm_allocate (mach_task_self (), (vm_address_t *)outhostname, - hostnamelen + 1, 1); - *outhostnamelen = hostnamelen + 1; - if (hostname) - bcopy (hostname, *outhostname, hostnamelen + 1); - else - **outhostname = '\0'; - return 0; -} /* Implement proc_getprivports as described in <hurd/proc.defs>. */ kern_return_t @@ -483,3 +405,4 @@ S_proc_register_version (pstruct_t server, mach_port_deallocate (mach_task_self (), credential); return 0; } + |