Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / runtime / platform / solaris.h
CommitLineData
7f918cf1
CE
1#include <inttypes.h>
2
3#include <unistd.h>
4
5#include <dirent.h>
6#include <fcntl.h>
7#include <grp.h>
8#include <netdb.h>
9#include <netinet/in.h>
10#include <netinet/tcp.h>
11#include <netinet/udp.h>
12#include <poll.h>
13#include <pwd.h>
14#include <strings.h>
15#include <sys/filio.h> /* For FIONBIO, FIONREAD. */
16#include <sys/ioctl.h>
17#include <sys/mman.h>
18/* This is defined in <sys/mman.h>, bet we'll redefine it in export.h. */
19#undef PRIVATE
20#include <sys/param.h>
21#include <sys/poll.h>
22#include <sys/resource.h>
23#include <sys/socket.h>
24#include <sys/sockio.h> /* For SIOCATMARK. */
25#include <sys/stat.h>
26#include <sys/time.h>
27#include <sys/times.h>
28#include <sys/un.h>
29#include <sys/utsname.h>
30#include <sys/wait.h>
31#include <syslog.h>
32#include <termios.h>
33#include <ucontext.h>
34#include <unistd.h>
35#include <utime.h>
36
37#ifdef __sparc__
38#include "float-math.h"
39#include "setenv.h"
40#endif
41
42#define HAS_MSG_DONTWAIT TRUE
43#define HAS_REMAP FALSE
44#define HAS_SIGALTSTACK TRUE
45#define NEEDS_SIGALTSTACK_EXEC FALSE
46#define HAS_SPAWN FALSE
47#define HAS_TIME_PROFILING TRUE
48
49#define MLton_Platform_OS_host "solaris"
50
51#ifndef PRIxPTR
52#define PRIxPTR "x"
53#endif
54
55/* Solaris 8 and older do not define a value for UINTPTR_MAX, so
56 we redefine it with a value. */
57#ifdef UINTPTR_MAX
58#undef UINTPTR_MAX
59#if defined(_LP64) || defined(_I32LPx)
60#define UINTPTR_MAX UINT64_MAX
61#else
62#define UINTPTR_MAX UINT32_MAX
63#endif
64#endif
65
66
67/* ------------------------------------------------- */
68/* Posix.ProcEnv */
69/* ------------------------------------------------- */
70
71extern char **environ;
72
73
74/* ------------------------------------------------- */
75/* MLton.Syslog */
76/* ------------------------------------------------- */
77
78#define LOG_AUTHPRIV LOG_AUTH
79#define LOG_PERROR 0
80
81
82/* ------------------------------------------------- */
83/* Real */
84/* ------------------------------------------------- */
85
86#ifdef __sparc__
87#undef fegetround
88#undef fesetround
89#define fegetround MLton_fegetround
90#define fesetround MLton_fesetround
91int fegetround(void);
92int fesetround(int rounding_mode);
93#endif
94
95#define FE_TONEAREST 0
96#define FE_DOWNWARD 1
97#define FE_UPWARD 2
98#define FE_TOWARDZERO 3
99
100#define HAS_FEROUND TRUE
101
102/* These are not predefined on Solaris 8. */
103#ifndef NAN
104#define NAN (__builtin_nanf (""))
105#endif
106
107#ifndef INFINITY
108#define INFINITY (__builtin_inff())
109#endif