🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jonathan Stone Mon, 17 Jun 1991 02:57
4.3BSD-Reno /usr/include/{sys/dir.h,dirent.h} break namei.h, DIRBLKSIZ
#390
Author: Jonathan Stone
Date: Mon, 17 Jun 1991 02:57
44 lines
2163 bytes
Subject: 4.3BSD-Reno /usr/include/{sys/dir.h,dirent.h} break namei.h, DIRBLKSIZ
Index:  /usr/include/dirent.h /usr/include/sys/dir.h  /usr/include/sys/namei.h
      /usr/include/ufs/dir.h

Description:
	The 4.3BSD-Reno release includes a placebo /usr/include/sys/dir.h
	for "backward compatibility".   The sys/dir.h file simply includes
	/usr/include/dirent.h, and defines a backward-compatible
	DIRSIZ macro.  Unfortunately, it also  ``direct'' to
	be ``dirent'', which breaks the definition of a ``struct direct''
	in ufs/dir.h,  which is in turn included by sys/namei.h.
	
	The macro DIRBLKSIZ is defined to be 1024 within
	/usr/include/dirent.h, and also (inconsistently) defined to
	be DEV_BSIZE in ufs/dir.h.   While DEV_BSIZE is fortuitously
	1024 on a CCI tahoe, on a vax or hp300, DEV_BSIZE is 512,
	not 1024.

	Both these problems break programs that include both
	<sys/dir.h> and <sys/user.h> (for example, gdb,	the GNU	debugger).
	

Repeat-By:
	Try and compile the following six-line program on a vax:

		#include <sys/types.h>
		#include <sys/dir.h>
		#include <sys/user.h.h>
		main ()
		{
		}

	I get the following output:

		nikau> cc -c dir-include-foulup.c
		/usr/include/ufs/dir.h: 51: DIRBLKSIZ redefined
		"/usr/include/ufs/dir.h", line 54: redeclaration of dirent


Workaround:
	One obvious workaround is to include <dirent.h> instead of
	<sys/dir.h>,  which fixes the problem with the ``struct direct''
	in ufs/dir.h.  But that does not fix the DIRBLKSIZ inconsistency.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads