Deleted Added
full compact
linux_misc.c (50350) linux_misc.c (50465)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id: linux_misc.c,v 1.66 1999/08/25 11:19:02 marcel Exp $
28 * $Id: linux_misc.c,v 1.67 1999/08/25 14:11:01 marcel Exp $
29 */
30
31#include "opt_compat.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/sysproto.h>
36#include <sys/kernel.h>

--- 19 unchanged lines hidden (view full) ---

56#include <vm/vm_extern.h>
57
58#include <machine/frame.h>
59#include <machine/psl.h>
60
61#include <i386/linux/linux.h>
62#include <i386/linux/linux_proto.h>
63#include <i386/linux/linux_util.h>
29 */
30
31#include "opt_compat.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/sysproto.h>
36#include <sys/kernel.h>

--- 19 unchanged lines hidden (view full) ---

56#include <vm/vm_extern.h>
57
58#include <machine/frame.h>
59#include <machine/psl.h>
60
61#include <i386/linux/linux.h>
62#include <i386/linux/linux_proto.h>
63#include <i386/linux/linux_util.h>
64#include <i386/linux/linux_mib.h>
64
65#include <posix4/sched.h>
66
67static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] =
68{ RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK,
69 RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE,
70 RLIMIT_MEMLOCK, -1
71};

--- 803 unchanged lines hidden (view full) ---

875 p->p_retval[0] = (int)CONVTCK(tv);
876 return 0;
877}
878
879int
880linux_newuname(struct proc *p, struct linux_newuname_args *args)
881{
882 struct linux_new_utsname utsname;
65
66#include <posix4/sched.h>
67
68static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] =
69{ RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK,
70 RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE,
71 RLIMIT_MEMLOCK, -1
72};

--- 803 unchanged lines hidden (view full) ---

876 p->p_retval[0] = (int)CONVTCK(tv);
877 return 0;
878}
879
880int
881linux_newuname(struct proc *p, struct linux_newuname_args *args)
882{
883 struct linux_new_utsname utsname;
884 char *osrelease, *osname;
883
884#ifdef DEBUG
885 printf("Linux-emul(%ld): newuname(*)\n", (long)p->p_pid);
886#endif
887
885
886#ifdef DEBUG
887 printf("Linux-emul(%ld): newuname(*)\n", (long)p->p_pid);
888#endif
889
890 osname = linux_get_osname(p);
891 osrelease = linux_get_osrelease(p);
892
888 bzero(&utsname, sizeof(struct linux_new_utsname));
893 bzero(&utsname, sizeof(struct linux_new_utsname));
889 strncpy(utsname.sysname, "Linux", LINUX_MAX_UTSNAME-1);
894 strncpy(utsname.sysname, osname, LINUX_MAX_UTSNAME-1);
890 strncpy(utsname.nodename, hostname, LINUX_MAX_UTSNAME-1);
895 strncpy(utsname.nodename, hostname, LINUX_MAX_UTSNAME-1);
891 strncpy(utsname.release, "2.0.36", LINUX_MAX_UTSNAME-1);
896 strncpy(utsname.release, osrelease, LINUX_MAX_UTSNAME-1);
892 strncpy(utsname.version, version, LINUX_MAX_UTSNAME-1);
893 strncpy(utsname.machine, machine, LINUX_MAX_UTSNAME-1);
894 strncpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME-1);
895
896 return (copyout((caddr_t)&utsname, (caddr_t)args->buf,
897 sizeof(struct linux_new_utsname)));
898}
899

--- 441 unchanged lines hidden ---
897 strncpy(utsname.version, version, LINUX_MAX_UTSNAME-1);
898 strncpy(utsname.machine, machine, LINUX_MAX_UTSNAME-1);
899 strncpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME-1);
900
901 return (copyout((caddr_t)&utsname, (caddr_t)args->buf,
902 sizeof(struct linux_new_utsname)));
903}
904

--- 441 unchanged lines hidden ---