[comp.os.minix] Patches to fix opendir

pa1285@sdcc13.ucsd.edu (David L. Brown) (01/05/90)

I have received enough response to post the patches to make opendir
work.  Two #define's need to be changed in lib/other/getdents.c.
These changes could probably also be made in a header file.

David Brown
dbrown@ucsd.edu

--- Cut here ---
*** old/getdents.c	Mon Jan  1 19:57:14 1990
--- getdents.c	Mon Jan  1 19:59:07 1990
***************
*** 95,102 ****
  
! #ifndef DIRENTSIZ
! #define DIRENTSIZ(x)	(x)
! #endif
! #ifndef DIRENTBASESIZ
! #define DIRENTBASESIZ 0
! #endif
  #ifndef DIRBLKSIZ
--- 95,105 ----
  
! #ifndef DIRENTSIZ
! #define DIRENTSIZ( namlen )	((DIRENTBASESIZ + sizeof(long) + (namlen)) \
! 				/ sizeof(long) * sizeof(long))
! #endif
! #ifndef DIRENTBASESIZ
! #define DIRENTBASESIZ		(((struct dirent *)0)->d_name \
! 				- (char *)&((struct dirent *)0)->d_ino)
! #endif
! 
  #ifndef DIRBLKSIZ