Subject: bin/916: KERNEL -> _KERNEL in binaries
To: None <gnats-admin@NetBSD.ORG>
From: Bernd Ernesti <bernd@arresum.inka.de>
List: netbsd-bugs
Date: 03/28/1995 08:50:03
>Number:         916
>Category:       bin
>Synopsis:       KERNEL -> _KERNEL in binaries
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 28 08:50:01 1995
>Originator:     Bernd Ernesti
>Organization:
	
>Release:        NetBSD-current 03-27-95
>Environment:
	
System: NetBSD arresum 1.0A NetBSD 1.0A (VEEGO) #103: Mon Mar 20 11:55:32 MET 1995 root@arresum:/src/sys/arch/amiga/compile/VEEGO amiga


>Description:
	there are some #define KERNEL in some sources of binaries
	and so the includes files has problems with it
	so this KERNEL must be changed to _KERNEL
>How-To-Repeat:
	make this binaries with the new includes and you get Errors
>Fix:
	use this diff to patch this files:

games/battlestar/com6.c
libexec/identd/netbsd.c
sbin/mount_nfs/mount_nfs.c
usr.bin/kdump/kdump.c
usr.bin/fstat/fstat.c
usr.bin/ipcs/ipcs.c
usr.bin/netstat/mroute.c
usr.bin/netstat/route.c
usr.bin/netstat/unix.c
usr.sbin/pstat/pstat.c
lib/libkvm/kvm_file.c
lib/libkvm/kvm_getfiles.3
share/man/man5/dir.5

*** games/battlestar/com6.c-orig	Wed Mar 22 11:52:03 1995
--- games/battlestar/com6.c	Tue Mar 28 13:10:31 1995
***************
*** 99,107 ****
   * sigh -- this program thinks "time" is an int.  It's easier to not load
   * <time.h> than try and fix it.
   */
! #define KERNEL
  #include <sys/time.h>
! #undef KERNEL
  
  post(ch)
  char ch;
--- 99,107 ----
   * sigh -- this program thinks "time" is an int.  It's easier to not load
   * <time.h> than try and fix it.
   */
! #define _KERNEL
  #include <sys/time.h>
! #undef _KERNEL
  
  post(ch)
  char ch;
*** libexec/identd/netbsd.c-orig	Sat Dec 24 12:24:19 1994
--- libexec/identd/netbsd.c	Tue Mar 28 13:30:49 1995
***************
*** 29,39 ****
  
  #include <sys/socketvar.h>
  
! #define KERNEL
  
  #include <sys/file.h>
  
! #undef KERNEL
  #include <sys/sysctl.h>
  
  #include <fcntl.h>
--- 29,39 ----
  
  #include <sys/socketvar.h>
  
! #define _KERNEL
  
  #include <sys/file.h>
  
! #undef _KERNEL
  #include <sys/sysctl.h>
  
  #include <fcntl.h>
*** sbin/mount_nfs/mount_nfs.c-orig	Mon Mar 20 08:31:07 1995
--- sbin/mount_nfs/mount_nfs.c	Tue Mar 28 13:09:21 1995
***************
*** 72,80 ****
  
  #include <nfs/rpcv2.h>
  #include <nfs/nfsv2.h>
! #define KERNEL
  #include <nfs/nfs.h>
! #undef KERNEL
  #include <nfs/nqnfs.h>
  
  #include <arpa/inet.h>
--- 72,80 ----
  
  #include <nfs/rpcv2.h>
  #include <nfs/nfsv2.h>
! #define _KERNEL
  #include <nfs/nfs.h>
! #undef _KERNEL
  #include <nfs/nqnfs.h>
  
  #include <arpa/inet.h>
*** usr.bin/kdump/kdump.c-orig	Sun Mar 26 13:25:36 1995
--- usr.bin/kdump/kdump.c	Tue Mar 28 12:40:48 1995
***************
*** 49,57 ****
  #include <sys/ktrace.h>
  #include <sys/ioctl.h>
  #include <sys/ptrace.h>
! #define KERNEL
  #include <sys/errno.h>
! #undef KERNEL
  
  #include <err.h>
  #include <signal.h>
--- 49,57 ----
  #include <sys/ktrace.h>
  #include <sys/ioctl.h>
  #include <sys/ptrace.h>
! #define _KERNEL
  #include <sys/errno.h>
! #undef _KERNEL
  
  #include <err.h>
  #include <signal.h>
*** usr.bin/fstat/fstat.c-orig	Wed Feb 15 12:22:21 1995
--- usr.bin/fstat/fstat.c	Tue Mar 28 12:46:53 1995
***************
*** 55,65 ****
  #include <sys/unpcb.h>
  #include <sys/sysctl.h>
  #include <sys/filedesc.h>
! #define	KERNEL
  #include <sys/file.h>
  #include <ufs/ufs/quota.h>
  #include <ufs/ufs/inode.h>
! #undef KERNEL
  #define NFS
  #include <sys/mount.h>
  #include <nfs/nfsv2.h>
--- 55,65 ----
  #include <sys/unpcb.h>
  #include <sys/sysctl.h>
  #include <sys/filedesc.h>
! #define	_KERNEL
  #include <sys/file.h>
  #include <ufs/ufs/quota.h>
  #include <ufs/ufs/inode.h>
! #undef _KERNEL
  #define NFS
  #include <sys/mount.h>
  #include <nfs/nfsv2.h>
*** usr.bin/ipcs/ipcs.c-orig	Sun Dec 25 12:28:00 1994
--- usr.bin/ipcs/ipcs.c	Tue Mar 28 12:48:39 1995
***************
*** 40,50 ****
  #include <sys/types.h>
  #include <sys/param.h>
  #include <sys/proc.h>
! #define KERNEL
  #include <sys/ipc.h>
  #include <sys/sem.h>
  #include <sys/shm.h>
  #include <sys/msg.h>
  
  int	semconfig __P((int,...));
  void	usage __P((void));
--- 40,51 ----
  #include <sys/types.h>
  #include <sys/param.h>
  #include <sys/proc.h>
! #define _KERNEL
  #include <sys/ipc.h>
  #include <sys/sem.h>
  #include <sys/shm.h>
  #include <sys/msg.h>
+ #undef _KERNEL
  
  int	semconfig __P((int,...));
  void	usage __P((void));
*** usr.bin/netstat/mroute.c-orig	Fri Jun 10 12:15:46 1994
--- usr.bin/netstat/mroute.c	Tue Mar 28 12:50:09 1995
***************
*** 51,59 ****
  
  #include <netinet/in.h>
  #include <netinet/igmp.h>
! #define KERNEL 1
  #include <netinet/ip_mroute.h>
! #undef KERNEL
  
  #include <stdio.h>
  #include <stdlib.h>
--- 51,59 ----
  
  #include <netinet/in.h>
  #include <netinet/igmp.h>
! #define _KERNEL
  #include <netinet/ip_mroute.h>
! #undef _KERNEL
  
  #include <stdio.h>
  #include <stdlib.h>
*** usr.bin/netstat/route.c-orig	Fri May 13 13:51:55 1994
--- usr.bin/netstat/route.c	Tue Mar 28 12:51:05 1995
***************
*** 44,52 ****
  #include <net/if.h>
  #include <net/if_dl.h>
  #include <net/if_types.h>
! #define  KERNEL
  #include <net/route.h>
! #undef KERNEL
  #include <netinet/in.h>
  
  #include <netns/ns.h>
--- 44,52 ----
  #include <net/if.h>
  #include <net/if_dl.h>
  #include <net/if_types.h>
! #define  _KERNEL
  #include <net/route.h>
! #undef _KERNEL
  #include <netinet/in.h>
  
  #include <netns/ns.h>
*** usr.bin/netstat/unix.c-orig	Mon Nov 21 23:52:55 1994
--- usr.bin/netstat/unix.c	Tue Mar 28 12:52:02 1995
***************
*** 47,56 ****
  #include <sys/sysctl.h>
  #include <sys/un.h>
  #include <sys/unpcb.h>
! #define KERNEL
  struct uio;
  struct proc;
  #include <sys/file.h>
  
  #include <netinet/in.h>
  
--- 47,57 ----
  #include <sys/sysctl.h>
  #include <sys/un.h>
  #include <sys/unpcb.h>
! #define _KERNEL
  struct uio;
  struct proc;
  #include <sys/file.h>
+ #undef _KERNEL
  
  #include <netinet/in.h>
  
*** usr.sbin/pstat/pstat.c-orig	Thu Mar  2 06:17:10 1995
--- usr.sbin/pstat/pstat.c	Tue Mar 28 13:00:04 1995
***************
*** 47,60 ****
  #include <sys/vnode.h>
  #include <sys/map.h>
  #include <sys/ucred.h>
! #define KERNEL
  #include <sys/file.h>
  #include <ufs/ufs/quota.h>
  #include <ufs/ufs/inode.h>
  #define NFS
  #include <sys/mount.h>
  #undef NFS
! #undef KERNEL
  #include <sys/stat.h>
  #include <nfs/nfsnode.h>
  #include <sys/ioctl.h>
--- 47,60 ----
  #include <sys/vnode.h>
  #include <sys/map.h>
  #include <sys/ucred.h>
! #define _KERNEL
  #include <sys/file.h>
  #include <ufs/ufs/quota.h>
  #include <ufs/ufs/inode.h>
  #define NFS
  #include <sys/mount.h>
  #undef NFS
! #undef _KERNEL
  #include <sys/stat.h>
  #include <nfs/nfsnode.h>
  #include <sys/ioctl.h>
*** lib/libkvm/kvm_file.c-orig	Mon Nov 21 22:44:48 1994
--- lib/libkvm/kvm_file.c	Tue Mar 28 18:05:32 1995
***************
*** 46,54 ****
  #include <sys/user.h>
  #include <sys/proc.h>
  #include <sys/exec.h>
! #define KERNEL
  #include <sys/file.h>
! #undef KERNEL
  #include <sys/stat.h>
  #include <sys/ioctl.h>
  #include <sys/tty.h>
--- 46,54 ----
  #include <sys/user.h>
  #include <sys/proc.h>
  #include <sys/exec.h>
! #define _KERNEL
  #include <sys/file.h>
! #undef _KERNEL
  #include <sys/stat.h>
  #include <sys/ioctl.h>
  #include <sys/tty.h>
*** lib/libkvm/kvm_getfiles.3-orig	Mon May  9 05:15:39 1994
--- lib/libkvm/kvm_getfiles.3	Tue Mar 28 18:07:56 1995
***************
*** 44,52 ****
  .Sh SYNOPSIS
  .Fd #include <kvm.h>
  .Fd #include <sys/kinfo.h>
! .Fd #define KERNEL
  .Fd #include <sys/file.h>
! .Fd #undef KERNEL
  .\" .Fa kvm_t *kd
  .br
  .Ft char *
--- 44,52 ----
  .Sh SYNOPSIS
  .Fd #include <kvm.h>
  .Fd #include <sys/kinfo.h>
! .Fd #define _KERNEL
  .Fd #include <sys/file.h>
! .Fd #undef _KERNEL
  .\" .Fa kvm_t *kd
  .br
  .Ft char *
*** share/man/man5/dir.5-orig	Thu Dec  1 12:23:19 1994
--- share/man/man5/dir.5	Tue Mar 28 18:29:47 1995
***************
*** 135,145 ****
  
  #endif /* _POSIX_SOURCE */
  
! #ifndef KERNEL
  
  #include <sys/cdefs.h>
  
! #endif /* !KERNEL */
  
  #endif /* !_DIRENT_H_ */
  .Ed
--- 135,145 ----
  
  #endif /* _POSIX_SOURCE */
  
! #ifndef _KERNEL
  
  #include <sys/cdefs.h>
  
! #endif /* !_KERNEL */
  
  #endif /* !_DIRENT_H_ */
  .Ed
>Audit-Trail:
>Unformatted: