Try omit-local-package (#116)
[packages/unix.git] / include / HsUnix.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The University of Glasgow 2002
4 *
5 * Definitions for package `unix' which are visible in Haskell land.
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #ifndef HSUNIX_H
10 #define HSUNIX_H
11
12 #include "HsUnixConfig.h"
13 #include "HsFFI.h"
14
15 /* ultra-evil... */
16 #undef PACKAGE_BUGREPORT
17 #undef PACKAGE_NAME
18 #undef PACKAGE_STRING
19 #undef PACKAGE_TARNAME
20 #undef PACKAGE_VERSION
21
22 #include <stdlib.h>
23 #include <stdio.h>
24
25 #ifdef HAVE_STRING_H
26 #include <string.h>
27 #endif
28 #ifdef HAVE_SYS_TIMES_H
29 #include <sys/times.h>
30 #endif
31 #ifdef HAVE_SYS_TIME_H
32 #include <sys/time.h>
33 #endif
34 #ifdef HAVE_SYS_RESOURCE_H
35 #include <sys/resource.h>
36 #endif
37 #ifdef HAVE_SYS_WAIT_H
38 #include <sys/wait.h>
39 #endif
40 #ifdef HAVE_SYS_STAT_H
41 #include <sys/stat.h>
42 #endif
43 #ifdef HAVE_TIME_H
44 #include <time.h>
45 #endif
46 #ifdef HAVE_UNISTD_H
47 #include <unistd.h>
48 #endif
49 #ifdef HAVE_UTIME_H
50 #include <utime.h>
51 #endif
52 #ifdef HAVE_FCNTL_H
53 #include <fcntl.h>
54 #endif
55 #ifdef HAVE_LIMITS_H
56 #include <limits.h>
57 #endif
58 #ifdef HAVE_TERMIOS_H
59 #include <termios.h>
60 #endif
61 #ifdef HAVE_SYS_UTSNAME_H
62 #include <sys/utsname.h>
63 #endif
64 #ifdef HAVE_PWD_H
65 #include <pwd.h>
66 #endif
67 #ifdef HAVE_GRP_H
68 #include <grp.h>
69 #endif
70 #ifdef HAVE_DIRENT_H
71 #include <dirent.h>
72 #endif
73
74 #if defined(HAVE_BSD_LIBUTIL_H)
75 #include <bsd/libutil.h>
76 #elif defined(HAVE_LIBUTIL_H)
77 #include <libutil.h>
78 #endif
79 #ifdef HAVE_PTY_H
80 #include <pty.h>
81 #endif
82 #ifdef HAVE_UTMP_H
83 #include <utmp.h>
84 #endif
85
86 #include <dlfcn.h>
87
88 #ifdef HAVE_SIGNAL_H
89 #include <signal.h>
90 #endif
91
92 /* defined in rts/posix/Signals.c */
93 extern HsInt nocldstop;
94
95 /* defined in libc */
96 extern char **environ;
97
98 #ifdef HAVE_RTLDNEXT
99 void *__hsunix_rtldNext (void);
100 #endif
101
102 #ifdef HAVE_RTLDDEFAULT
103 void *__hsunix_rtldDefault (void);
104 #endif
105
106 /* O_SYNC doesn't exist on Mac OS X and (at least some versions of) FreeBSD,
107 fall back to O_FSYNC, which should be the same */
108 #ifndef O_SYNC
109 # define O_SYNC O_FSYNC
110 #endif
111
112 // not part of POSIX, hence may not be always defined
113 #ifndef WCOREDUMP
114 # define WCOREDUMP(s) 0
115 #endif
116
117 // push a SVR4 STREAMS module; do nothing if STREAMS not available
118 int __hsunix_push_module(int fd, const char *module);
119
120 #endif