/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.c,v 1.10 1992/02/03 23:44:05 jinx Exp $
+$Id: ux.c,v 1.11 1993/02/18 05:15:19 gjr Exp $
-Copyright (c) 1990-1992 Massachusetts Institute of Technology
+Copyright (c) 1990-1993 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
#endif /* HAVE_BSD_SIGNALS */
#endif /* not _POSIX */
+\f
+#ifdef EMULATE_SYSCONF
+
+long
+DEFUN (sysconf, (parameter), int parameter)
+{
+ switch (parameter)
+ {
+ case _SC_CLK_TCK:
+#ifdef CLK_TCK
+ return ((long) (CLK_TCK));
+#else
+#ifdef HZ
+ return ((long) HZ);
+#else
+ return (60);
+#endif /* HZ */
+#endif /* CLK_TCK */
+
+ case _SC_OPEN_MAX:
+#ifdef OPEN_MAX
+ return ((long) OPEN_MAX);
+#else
+#ifdef _NFILE
+ return ((long) _NFILE);
+#else
+ return ((long) 16);
+#endif /* _NFILE */
+#endif /* OPEN_MAX */
+
+ case _SC_CHILD_MAX:
+#ifdef CHILD_MAX
+ return ((long) CHILD_MAX);
+#else
+ return ((long) 6);
+#endif /* CHILD_MAX */
+
+ case _SC_JOB_CONTROL:
+#if defined(_POSIX_JOB_CONTROL) || defined(HAVE_BSD_JOB_CONTROL)
+ return ((long) 1);
+#else
+ return ((long) 0);
+#endif
+
+ default:
+ errno = EINVAL;
+ return ((long) (-1));
+ }
+}
+
+#endif /* EMULATE_SYSCONF */
+
+#ifdef EMULATE_FPATHCONF
+
+long
+DEFUN (fpathconf, (filedes, parameter), int filedes AND int parameter)
+{
+ switch (parameter)
+ {
+ case _PC_VDISABLE:
+ return ((long) '\377');
+
+ default:
+ errno = EINVAL;
+ return ((long) (-1));
+ }
+}
+
+#endif /* EMULATE_FPATHCONF */
/* -*-C-*-
-$Id: ux.h,v 1.41 1993/02/14 23:03:51 gjr Exp $
+$Id: ux.h,v 1.42 1993/02/18 05:14:28 gjr Exp $
Copyright (c) 1988-1993 Massachusetts Institute of Technology
#include "ansidecl.h"
#include "posixtype.h"
-#include <sys/times.h>
+#ifndef _POSIX /* Prevent multiple inclusion */
+# include <sys/times.h>
+#endif /* _POSIX */
#include <sys/file.h>
#include <sys/param.h>
#include <sys/stat.h>
extern int errno;
/* These seem to be missing from versions of unistd.h */
-extern int EXFUN (ioctl, (int, int, ...));
+
+#ifndef _HPUX
+/* <unistd.h> in HP-UX has mis-matching prototype
+ The following is as specified by OSF/1 Programmer's reference.
+ */
+extern int EXFUN (ioctl, (int, unsigned long, ...));
+#endif
extern int EXFUN (open, (const char *, int, ...));
extern int EXFUN (kill, (pid_t, int));
#ifdef __osf__
# include <sys/time.h>
# include <sys/ioctl.h>
+# define SYSTEM_VARIANT "OSF"
+#endif
+
+#ifdef __386BSD__
+# include <sys/ioctl.h>
+# define EMULATE_FPATHCONF
+# define EMULATE_SYSCONF
+# define NO_BAUD_CONVERSION
#endif
#ifdef sonyrisc
extern PTR EXFUN (malloc, (unsigned int size));
extern PTR EXFUN (realloc, (PTR ptr, unsigned int size));
extern char * EXFUN (getenv, (CONST char * name));
-extern int EXFUN (gethostname, (char * name, unsigned int size));
+
+#ifndef _HPUX
+/* <unistd.h> in HP-UX has mis-matching prototype
+ The following is as specified by OSF/1 Programmer's reference.
+ */
+extern int EXFUN (gethostname, (char * name, int size));
+#endif /* _HPUX */
#ifdef HAVE_FCNTL
#define UX_fcntl fcntl
\f
#ifdef _POSIX
+#ifdef EMULATE_FPATHCONF
+
+/* These values match HP-UX, and the index in the table in the
+ OSF/1 Programmer's reference.
+ */
+
+extern long EXFUN (fpathconf, (int, int));
+
+# define _PC_VDISABLE 8
+
+#endif /* EMULATE_FPATHCONF */
+
+#ifdef EMULATE_SYSCONF
+
+extern long EXFUN (sysconf, (int));
+
+/* These values match HP-UX, and the index in the table in the
+ OSF/1 Programmer's reference.
+ */
+
+# define _SC_CHILD_MAX 1
+# define _SC_CLK_TCK 2
+# define _SC_OPEN_MAX 4
+# define _SC_JOB_CONTROL 5
+
+#endif /* EMULATE_SYSCONF */
+
extern cc_t EXFUN (UX_PC_VDISABLE, (int fildes));
extern clock_t EXFUN (UX_SC_CLK_TCK, (void));
#define UX_SC_OPEN_MAX() ((size_t) (sysconf (_SC_OPEN_MAX)))