[project @ 2001-06-06 11:03:48 by simonmar]
[ghc-hetmet.git] / ghc / lib / std / cbits / HsStd.h
1 /* -----------------------------------------------------------------------------
2  * $Id: HsStd.h,v 1.3 2001/06/06 11:03:48 simonmar Exp $
3  *
4  * Definitions for package `std' which are visible in Haskell land.
5  *
6  * ---------------------------------------------------------------------------*/
7
8 #ifndef HSSTD_H
9 #define HSSTD_H
10
11 #include "config.h"
12
13 #ifdef HAVE_SYS_TYPES_H
14 #include <sys/types.h>
15 #endif
16 #ifdef HAVE_UNISTD_H
17 #include <unistd.h>
18 #endif
19 #ifdef HAVE_SYS_STAT_H
20 #include <sys/stat.h>
21 #endif
22 #ifdef HAVE_FCNTL_H
23 # include <fcntl.h>
24 #endif
25 #ifdef HAVE_TERMIOS_H
26 #include <termios.h>
27 #endif
28 #ifdef HAVE_SIGNAL_H
29 #include <signal.h>
30 #endif
31 #ifdef HAVE_ERRNO_H
32 #include <errno.h>
33 #endif
34 #if defined(HAVE_GETTIMEOFDAY)
35 #  ifdef HAVE_SYS_TIME_H
36 #   include <sys/time.h>
37 #  endif
38 #elif defined(HAVE_GETCLOCK)
39 # ifdef HAVE_SYS_TIMERS_H
40 #  define POSIX_4D9 1
41 #  include <sys/timers.h>
42 # endif
43 #endif
44 #if defined(HAVE_TIME_H)
45 # include <time.h>
46 #endif
47 #ifdef HAVE_SYS_TIMEB_H
48 #include <sys/timeb.h>
49 #endif
50 #ifdef HAVE_WINDOWS_H
51 #include <windows.h>
52 #endif
53 #ifdef HAVE_SYS_TIMES_H
54 #include <sys/times.h>
55 #endif
56
57 #if !defined(mingw32_TARGET_OS) && !defined(irix_TARGET_OS)
58 # if defined(HAVE_SYS_RESOURCE_H)
59 #  include <sys/resource.h>
60 # endif
61 #endif
62
63 #ifdef hpux_TARGET_OS
64 #include <sys/syscall.h>
65 #define getrusage(a, b)  syscall(SYS_GETRUSAGE, a, b)
66 #define HAVE_GETRUSAGE
67 #endif
68
69 /* For System */
70 #ifdef HAVE_SYS_WAIT_H
71 #include <sys/wait.h>
72 #endif
73 #ifdef HAVE_VFORK_H
74 #include <vfork.h>
75 #endif
76
77 #include "lockFile.h"
78
79 #include "HsFFI.h"
80
81 /* in ghc_errno.c */
82 int *ghcErrno(void);
83
84 /* in system.c */
85 HsInt systemCmd(HsAddr cmd);
86
87 /* in inputReady.c */
88 int inputReady(int fd, int msecs);
89
90 /* in progargs.c */
91 HsAddr get_prog_argv(void);
92 HsInt  get_prog_argc();
93
94 #endif