[project @ 2002-02-12 11:44:54 by simonmar]
[ghc-hetmet.git] / ghc / lib / std / cbits / HsStd.h
1 /* -----------------------------------------------------------------------------
2  * $Id: HsStd.h,v 1.6 2001/12/03 20:59:08 sof 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 #ifdef HAVE_STRING_H
35 #include <string.h>
36 #endif
37 #if defined(HAVE_GETTIMEOFDAY)
38 #  ifdef HAVE_SYS_TIME_H
39 #   include <sys/time.h>
40 #  endif
41 #elif defined(HAVE_GETCLOCK)
42 # ifdef HAVE_SYS_TIMERS_H
43 #  define POSIX_4D9 1
44 #  include <sys/timers.h>
45 # endif
46 #endif
47 #if defined(HAVE_TIME_H)
48 # include <time.h>
49 #endif
50 #ifdef HAVE_SYS_TIMEB_H
51 #include <sys/timeb.h>
52 #endif
53 #ifdef HAVE_WINDOWS_H
54 #include <windows.h>
55 #endif
56 #ifdef HAVE_SYS_TIMES_H
57 #include <sys/times.h>
58 #endif
59 #ifdef HAVE_WINSOCK_H
60 #include <winsock.h>
61 #endif
62
63 #if !defined(mingw32_TARGET_OS) && !defined(irix_TARGET_OS)
64 # if defined(HAVE_SYS_RESOURCE_H)
65 #  include <sys/resource.h>
66 # endif
67 #endif
68
69 #ifdef hpux_TARGET_OS
70 #include <sys/syscall.h>
71 #define getrusage(a, b)  syscall(SYS_GETRUSAGE, a, b)
72 #define HAVE_GETRUSAGE
73 #endif
74
75 /* For System */
76 #ifdef HAVE_SYS_WAIT_H
77 #include <sys/wait.h>
78 #endif
79 #ifdef HAVE_VFORK_H
80 #include <vfork.h>
81 #endif
82
83 #include "lockFile.h"
84
85 #include "HsFFI.h"
86
87 /* in ghc_errno.c */
88 int *ghcErrno(void);
89
90 /* in system.c */
91 HsInt systemCmd(HsAddr cmd);
92
93 /* in inputReady.c */
94 int inputReady(int fd, int msecs, int isSock);
95
96 /* in progargs.c */
97 HsAddr get_prog_argv(void);
98 HsInt  get_prog_argc();
99
100 #endif