Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Dec 1997 23:47:20 +1100 (EST)
From:      John Birrell  <jb@freebsd1.cimlogic.com.au>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        bde@zeta.org.au, bde@FreeBSD.ORG, current@FreeBSD.ORG, grog@lemis.com, julian@whistle.com
Subject:   Re: Bruce vandalism again
Message-ID:  <199712201247.XAA00609@freebsd1.cimlogic.com.au>
In-Reply-To: <199712201139.WAA04443@godzilla.zeta.org.au> from Bruce Evans at "Dec 20, 97 10:39:27 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:
> A great way to enlarge 200000-line diffs between NetBSD and FreeBSD for code
> that isn't really different :-(.

NetBSD and FreeBSD have deviated so much that I would claim that the
code really _is_ different. Try, for instance, taking part of FreeBSD
user land and compiling/linking it against NetBSD. Look at how the header
files clash. You need some headers that match the kernel, but you need
others that match the user libraries. So why do the header files differ?
The answer is that the interface between user-land and the kernel/device
drivers is _very_ different (and in neither system is it cleanly designed).
As each operating system develops, the greater the differences become.
You will probably say that's a bad thing. I'd say it is progress.

Attached are diffs between sys/types.h from FreeBSD and NetBSD.
Now is it supposed to be _KERNEL (NetBSD) or KERNEL (FreeBSD)?!!
FreeBSD and NetBSD may have started with the same source, but NetBSD
has moved away from that source just as much as FreeBSD has.
In different directions.

Regards,

-- 
John Birrell - jb@cimlogic.com.au; jb@netbsd.org; jb@freebsd.org
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137

0a1,2
> /*	$NetBSD: types.h,v 1.32 1997/11/23 20:39:08 kleink Exp $	*/
> 
2c4
<  * Copyright (c) 1982, 1986, 1991, 1993, 1994
---
>  * Copyright (c) 1982, 1986, 1991, 1993
38,39c40
<  *	@(#)types.h	8.6 (Berkeley) 2/19/95
<  * $Id: types.h,v 1.21 1997/05/08 13:50:36 peter Exp $
---
>  *	@(#)types.h	8.4 (Berkeley) 1/21/94
46,47d46
< #include <sys/cdefs.h>			/* XXX for __signed in machine/ansi.h */
< #include <machine/ansi.h>
50c49,52
< #ifndef _POSIX_SOURCE
---
> #include <machine/ansi.h>
> #include <machine/endian.h>
> 
> #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
54a57,58
> 
> typedef unsigned char	unchar;		/* Sys V compatibility */
56a61
> typedef unsigned long	ulong;		/* Sys V compatibility */
62a68,69
> typedef	int64_t		blkcnt_t;	/* fs block count */
> typedef	u_int32_t	blksize_t;	/* fs optimal block size */
70,74c77,81
< typedef	u_int16_t	mode_t;		/* permissions */
< typedef	u_int16_t	nlink_t;	/* link count */
< typedef	_BSD_OFF_T_	off_t;		/* file offset */
< typedef	_BSD_PID_T_	pid_t;		/* process id */
< typedef	quad_t		rlim_t;		/* resource limit */
---
> typedef	u_int32_t	mode_t;		/* permissions */
> typedef	u_int32_t	nlink_t;	/* link count */
> typedef	quad_t		off_t;		/* file offset */
> typedef	int32_t		pid_t;		/* process id */
> typedef quad_t		rlim_t;		/* resource limit */
79,84d85
< #ifdef KERNEL
< typedef	int		boolean_t;
< typedef	struct vm_page	*vm_page_t;
< #endif
< 
< #ifndef _POSIX_SOURCE
86,88c87,89
<  * minor() gives a cookie instead of an index since we don't want to
<  * change the meanings of bits 0-15 or waste time and space shifting
<  * bits 16-31 for devices that don't use them.
---
>  * These belong in unistd.h, but are placed here too to ensure that
>  * long arguments will be promoted to off_t if the program fails to
>  * include that header or explicitly cast them to off_t.
90,93c91,100
< #define	major(x)	((int)(((u_int)(x) >> 8)&0xff))	/* major number */
< #define	minor(x)	((int)((x)&0xffff00ff))		/* minor number */
< #define	makedev(x,y)	((dev_t)(((x) << 8) | (y)))	/* create dev_t */
< #endif
---
> #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
> #ifndef _KERNEL
> #include <sys/cdefs.h>
> __BEGIN_DECLS
> off_t	 lseek __P((int, off_t, int));
> int	 ftruncate __P((int, off_t));
> int	 truncate __P((const char *, off_t));
> __END_DECLS
> #endif /* !_KERNEL */
> #endif /* !defined(_POSIX_SOURCE) ... */
95c102,107
< #include <machine/endian.h>
---
> #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
> /* Major, minor numbers, dev_t's. */
> #define	major(x)	((int32_t)(((u_int32_t)(x) >> 8) & 0xff))
> #define	minor(x)	((int32_t)((x) & 0xff))
> #define	makedev(x,y)	((dev_t)(((x) << 8) | (y)))
> #endif
98c110
< typedef	_BSD_CLOCK_T_	clock_t;
---
> typedef	_BSD_CLOCK_T_		clock_t;
103c115
< typedef	_BSD_SIZE_T_	size_t;
---
> typedef	_BSD_SIZE_T_		size_t;
108c120
< typedef	_BSD_SSIZE_T_	ssize_t;
---
> typedef	_BSD_SSIZE_T_		ssize_t;
113c125
< typedef	_BSD_TIME_T_	time_t;
---
> typedef	_BSD_TIME_T_		time_t;
118c130
< typedef	_BSD_CLOCKID_T_	clockid_t;
---
> typedef	_BSD_CLOCKID_T_		clockid_t;
123c135
< typedef	_BSD_TIMER_T_	timer_t;
---
> typedef	_BSD_TIMER_T_		timer_t;
127c139,149
< #ifndef _POSIX_SOURCE
---
> #ifdef	_BSD_SUSECONDS_T_
> typedef	_BSD_SUSECONDS_T_	suseconds_t;
> #undef	_BSD_SUSECONDS_T_
> #endif
> 
> #ifdef	_BSD_USECONDS_T_
> typedef	_BSD_USECONDS_T_	useconds_t;
> #undef	_BSD_USECONDS_T_
> #endif
> 
> #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
137c159
< #define	FD_SETSIZE	1024
---
> #define	FD_SETSIZE	256
140,141c162,163
< typedef	long	fd_mask;
< #define	NFDBITS	(sizeof(fd_mask) * NBBY)	/* bits per mask */
---
> typedef int32_t	fd_mask;
> #define NFDBITS	(sizeof(fd_mask) * NBBY)	/* bits per mask */
153a176
> #ifdef _KERNEL
156,171c179,181
< 
< /*
<  * These declarations belong elsewhere, but are repeated here and in
<  * <stdio.h> to give broken programs a better chance of working with
<  * 64-bit off_t's.
<  */
< #ifndef KERNEL
< #include <sys/cdefs.h>
< __BEGIN_DECLS
< #ifndef _FTRUNCATE_DECLARED
< #define	_FTRUNCATE_DECLARED
< int	 ftruncate __P((int, off_t));
< #endif
< #ifndef _LSEEK_DECLARED
< #define	_LSEEK_DECLARED
< off_t	 lseek __P((int, off_t, int));
---
> #else
> #define	FD_COPY(f, t)	(void)memcpy(t, f, sizeof(*(f)))
> #define	FD_ZERO(p)	(void)memset(p, 0, sizeof(*(p)))
173,182d182
< #ifndef _MMAP_DECLARED
< #define	_MMAP_DECLARED
< caddr_t	 mmap __P((caddr_t, size_t, int, int, int, off_t));
< #endif
< #ifndef _TRUNCATE_DECLARED
< #define	_TRUNCATE_DECLARED
< int	 truncate __P((const char *, off_t));
< #endif
< __END_DECLS
< #endif /* !KERNEL */
184c184
< #if defined(__STDC__) && defined(KERNEL)
---
> #if defined(__STDC__) && defined(_KERNEL)
200c200
< #endif /* !_POSIX_SOURCE */
---
> #endif /* !defined(_POSIX_SOURCE) ... */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712201247.XAA00609>