NetBSD Problem Report #1511

From gnats  Mon Sep 25 20:21:06 1995
Received: from Reno.Stanford.EDU (Reno.DSG.Stanford.EDU [36.18.0.71]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id UAA06049 for <gnats-bugs@gnats.netbsd.org>; Mon, 25 Sep 1995 20:21:01 -0400
Message-Id: <199509260017.RAA01352@Reno.Stanford.EDU>
Date: Mon, 25 Sep 1995 17:17:02 -0700
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
Reply-To: jonathan@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: dev/scsi/ files fail to include <sys/systm.h>
X-Send-Pr-Version: 3.2

>Number:         1511
>Category:       kern
>Synopsis:       sys/scsi/scsiconf.c etc. fail to include <sys/systm.h>
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 25 20:35:01 +0000 1995
>Closed-Date:    Tue Sep 26 19:25:39 +0000 1995
>Last-Modified:  Tue Sep 26 19:28:04 +0000 1995
>Originator:     Jonathan Stone
>Release:        NetBSD-current from 18 september 1995
>Organization:

>Environment:

System: NetBSD Reno.Stanford.EDU 1.0A NetBSD 1.0A (NEWCONF) #579: Mon Sep 25 13:42:43 PDT 1995 jonathan@Reno.Stanford.EDU:/usr/src/sys/arch/pmax/compile/NEWCONF pmax


>Description:
	[[ I thought I'd send-pr'ed this already but I couldn't find it
	   with query-pr]]

	The NetBSD /sys/scsi drivers use min() without, in general, including
	<sys/systm.h>, which is where min() is declared. This breaks the
	scsi code on ports that don't (yet) have min in the kernel, and
	breaks prototype checking for  functions declared in lib/libkern/libkern.h
	(such as min()).   cgd says the canonical way to get these is
	via <sys/systm.h>.


>How-To-Repeat:
	Configure a NetBSD/Pmax kernel with the NetBSD scsi drivers. The
	kernelwill fail to link, due to undefined references to min().
	Compiling with warnings about prototypes also fails, due to
	not including the relevant prototype declarations.

>Fix:
	1. Add #include <sys/systm.h> to the /sys/scsi/{cd,scsi_base,
	  scsi_ioctl}.c source files.  This cannot hurt.
	2. Add non-inline definitions for min(), etc. to the
	   sys/lib/libkern/arch/mips Makefile.inc.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: thorpej 
State-Changed-When: Tue Sep 26 12:25:39 PDT 1995 
State-Changed-Why:  
Fixed by #include <sys/systm.h>. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.