Date: Wed, 7 Jun 1995 16:30:02 -0700 From: Paul Traina <pst@Shockwave.COM> To: freebsd-bugs Subject: kern/497: bug in BSDI compatibility - ogetkerninfo() not up to date Message-ID: <199506072330.QAA22459@freefall.cdrom.com> In-Reply-To: Your message of Wed, 7 Jun 1995 16:28:58 -0700 <199506072328.QAA07871@precipice.shockwave.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>Number: 497 >Category: kern >Synopsis: system calls to the kernel for BSDI uname() compatibility break >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 7 16:30:01 1995 >Originator: Paul Traina >Organization: Shockwave Engineering >Release: FreeBSD 2.0-BUILT-19950510 i386 >Environment: FreeBSD-current as of may 10th. >Description: 7727 netscape.bin11n CALL old.gethostname(0xefbfd238,0x100) 7727 netscape.bin11n RET old.gethostname 0 7727 netscape.bin11n CALL old.getkerninfo(0x6500,0,0,0) 7727 netscape.bin11n RET old.getkerninfo -1 errno 45 Operation not supported 7727 netscape.bin11n CALL write(0x2,0xefbfbd44,0x49) 7727 netscape.bin11n GIO fd 2 wrote 73 bytes "netscape.bin11n: uname() failed; can't tell what system we're running \ on " >How-To-Repeat: Run the BSDI version of netscape 1.1n under FreeBSD and you get an error message (see above).... it's doing a getkerninfo(KINFO_SYSINFO) as part of the uname() library call. >Fix: Fix ogetkerninfo system call to do the right thing when presented with that calling sequence. We probably just need a KINFO_SYSINFO emulator, but here's the whole list that we're missing. The following routines are missing from FreeBSD's ogetkerninfo support: KINFO_SYSINFO 101<<8 KINFO_CPU 102<<8 KINFO_VM 103<<8 KINFO_DISK_NAMES 104<<8 KINFO_DISK_STATS 105<<8 KINFO_TTY_TOTALS 106<<8 KINFO_TTY_NAMES_TMP 111<<8 KINFO_TTY_STATS_TMP 112<<8 and the KINFO_SYSINFO routine should return a pointer to a data structure of the following format: /* * Information about the current system. * This structure includes only fairly static information * (set no later than boot time.) Returned by getkerninfo(). * The strings are copied out immediately after this structure. * The pointers are offsets from the start of the buffer * when returned by the kernel. */ struct sysinfo { /* machine info */ char *sys_machine; /* generic machine type */ char *sys_model; /* specific machine type/model */ long sys_ncpu; /* number of cpus */ long sys_cpuspeed; /* ~mips, per cpu */ long sys_hwflags; /* additional info, see below */ u_long sys_physmem; /* amount of physical memory, KB */ u_long sys_usermem; /* amount of memory for procs, KB */ u_long sys_pagesize; /* software page size */ /* system info */ char *sys_ostype; /* generic OS type: "BSD" */ char *sys_osrelease; /* general OS release */ long sys_os_revision; /* OS interface version number */ long sys_posix1_version; /* POSIX.1 version number */ char *sys_version; /* binary version info */ /* system parameters */ long sys_hz; /* time-of-day clock frequency */ long sys_phz; /* profiling/stats clock frequency */ int sys_ngroup_max; /* max number of groups */ long sys_argmax; /* max arg list size */ llong sys_openmax; /* approx. max number of open files */ long sys_childmax; /* approx. max number of procs */ /* local info */ struct timeval sys_boottime; /* time of last system boot */ char *sys_hostname; /* specific host name */ /* string values follow */ }; /* * values for sys_hwflags * Bits above 0xff are reserved for hardware-dependent features. */ #define SYS_FPA 0x01 /* has floating-point accelerator */ Please note that this was excerpted from sysinfo.h which contains the following copyright: /*- * Copyright (c) 1992 Berkeley Software Design, Inc. All rights reserved. * The Berkeley Software Design Inc. software License Agreement specifies * the terms and conditions for redistribution. * * BSDI $Id: sysinfo.h,v 1.1 1992/08/20 18:33:06 karels Exp $ */ The engineer who implements this should be untainted (I am not untainted in this case, so I can't do it). >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506072330.QAA22459>