$NetBSD: patch-aa,v 1.4 2005/10/03 20:34:56 joerg Exp $ --- fileio.c.orig 1992-08-29 21:51:00.000000000 +0000 +++ fileio.c @@ -38,7 +38,6 @@ # define MATCH dosmatch # endif /* ?OS2 */ #else /* !MSDOS */ - extern int errno; /* error number from system functions */ # ifdef VMS # define RMDIR # define link rename @@ -59,16 +58,6 @@ #endif /* ?VMS */ -/* For now, assume DIRENT implies System V implies TERMIO */ -#ifdef DIRENT -# ifndef MINIX -# ifndef TERMIO -# define TERMIO -# endif /* !TERMIO */ -# endif /* !MINIX */ -#endif /* DIRENT */ - - #ifndef EXPORT # ifdef MSVMS # ifdef MSDOS @@ -77,7 +66,13 @@ # define getch() getc(stderr) # endif /* ?MSDOS */ # else /* !MSVMS */ -# ifdef TERMIO /* Amdahl, Cray, all SysV? */ +# if defined(TERMIOS) +# include +# define sgttyb termios +# define sg_flags c_lflag +# define GTTY(f, s) tcgetattr(f, (void *) s) +# define STTY(f, s) tcsetattr(f, TCSAFLUSH, (void *) s) +# elif defined(TERMIO) /* Amdahl, Cray, all SysV? */ # ifdef CONVEX # include # include @@ -99,11 +94,16 @@ # define GTTY gtty # define STTY stty # endif /* ?TERMIO */ +#ifdef MODERN +#include +#include +#else int isatty OF((int)); char *ttyname OF((int)); int open OF((char *, int, ...)); int close OF((int)); int read OF((int, voidp *, int)); +#endif # endif /* ?MSVMS */ #endif /* !EXPORT */ @@ -197,6 +197,9 @@ #endif /* !UTIL */ +#ifdef MODERN +#include +#else /* Library functions not in (most) header files */ char *mktemp OF((char *)); int link OF((char *, char *)); @@ -207,6 +210,7 @@ int unlink OF((char *)); * parameter is an unsigned long. */ #endif /* !CONVEX */ +#endif #ifndef UTIL /* the companion #endif is a bit of ways down ... */ @@ -215,11 +219,15 @@ int unlink OF((char *)); int utime OF((char *, time_t *)); #endif /* !__TURBOC__ */ #ifndef MSDOS +#ifdef MODERN +#include +#else int open OF((char *, int, ...)); int close OF((int)); # ifndef RMDIR int rmdir OF((char *)); # endif /* !RMDIR */ +#endif #endif /* !MSDOS */