2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-
7 #include "PrelIOUtils.h"
13 #define offsetof(t, f) ((size_t) &((t *)0)->f)
21 HsBool prel_supportsTextMode()
23 #if defined(mingw32_TARGET_OS)
59 HsInt prel_setmode(HsInt fd, HsBool toBin)
62 return setmode(fd,(toBin == HS_BOOL_TRUE) ? _O_BINARY : _O_TEXT);
68 HsInt prel_PrelHandle_write(HsInt fd, HsAddr ptr, HsInt off, int sz)
70 return write(fd,ptr + off, sz);
73 HsInt prel_PrelHandle_read(HsInt fd, HsAddr ptr, HsInt off, int sz)
75 return read(fd,ptr + off, sz);
78 void *prel_PrelIO_memcpy(char *dst, HsInt dst_off, const char *src, size_t sz)
80 return memcpy(dst+dst_off, src, sz);