1 /* -----------------------------------------------------------------------------
2 * $Id: HsCore.h,v 1.4 2001/09/14 11:25:57 simonmar Exp $
4 * Definitions for package `core' which are visible in Haskell land.
6 * ---------------------------------------------------------------------------*/
14 #ifdef HAVE_SYS_TYPES_H
15 #include <sys/types.h>
20 #ifdef HAVE_SYS_STAT_H
44 #if defined(HAVE_GETTIMEOFDAY)
45 # ifdef HAVE_SYS_TIME_H
46 # include <sys/time.h>
48 #elif defined(HAVE_GETCLOCK)
49 # ifdef HAVE_SYS_TIMERS_H
51 # include <sys/timers.h>
54 #if defined(HAVE_TIME_H)
57 #ifdef HAVE_SYS_TIMEB_H
58 #include <sys/timeb.h>
63 #ifdef HAVE_SYS_TIMES_H
64 #include <sys/times.h>
67 #if !defined(mingw32_TARGET_OS) && !defined(irix_TARGET_OS)
68 # if defined(HAVE_SYS_RESOURCE_H)
69 # include <sys/resource.h>
74 #include <sys/syscall.h>
75 #define getrusage(a, b) syscall(SYS_GETRUSAGE, a, b)
76 #define HAVE_GETRUSAGE
80 #ifdef HAVE_SYS_WAIT_H
87 extern inline int s_isreg_wrap(m) { return S_ISREG(m); }
88 extern inline int s_isdir_wrap(m) { return S_ISDIR(m); }
89 extern inline int s_isfifo_wrap(m) { return S_ISFIFO(m); }
90 extern inline int s_isblk_wrap(m) { return S_ISBLK(m); }
91 extern inline int s_ischr_wrap(m) { return S_ISCHR(m); }
93 extern inline int s_issock_wrap(m) { return S_ISSOCK(m); }
97 memcpy_wrap_dst_off(char *dst, int dst_off, char *src, size_t sz)
98 { return memcpy(dst+dst_off, src, sz); }
101 memcpy_wrap_src_off(char *dst, char *src, int src_off, size_t sz)
102 { return memcpy(dst, src+src_off, sz); }
105 read_ba_wrap(int fd, void *ptr, HsInt off, int size)
106 { return read(fd, ptr + off, size); }
109 write_wrap(int fd, void *ptr, HsInt off, int size)
110 { return write(fd, ptr + off, size); }
113 read_wrap(int fd, void *ptr, HsInt off, int size)
114 { return read(fd, ptr + off, size); }
116 #include "lockFile.h"
124 HsInt systemCmd(HsAddr cmd);
126 /* in inputReady.c */
127 int inputReady(int fd, int msecs);