X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=include%2FHsBase.h;h=e091f14aba39a5154facb6cb1d5d652a1918a2b8;hb=e7ddb1da757db6a5898d252e9aead0282965b405;hp=cc64b4a4e04209657240df297c7f31b1839e7b76;hpb=36eed61fede3856f9b710dde0871f284d5ec7cc9;p=haskell-directory.git diff --git a/include/HsBase.h b/include/HsBase.h index cc64b4a..e091f14 100644 --- a/include/HsBase.h +++ b/include/HsBase.h @@ -1,14 +1,14 @@ /* ----------------------------------------------------------------------------- - * $Id: HsBase.h,v 1.14 2002/09/25 15:24:07 simonmar Exp $ + * $Id: HsBase.h,v 1.27 2003/09/21 22:20:57 wolfgang Exp $ * * (c) The University of Glasgow 2001-2002 * - * Definitions for package `core' which are visible in Haskell land. + * Definitions for package `base' which are visible in Haskell land. * * ---------------------------------------------------------------------------*/ -#ifndef HSCORE_H -#define HSCORE_H +#ifndef __HSBASE_H__ +#define __HSBASE_H__ #include "config.h" #include "HsFFI.h" @@ -47,6 +47,9 @@ #ifdef HAVE_UTIME_H #include #endif +#ifdef HAVE_SYS_UTSNAME_H +#include +#endif #if defined(HAVE_GETTIMEOFDAY) # ifdef HAVE_SYS_TIME_H # include @@ -75,6 +78,9 @@ #ifdef HAVE_LIMITS_H #include #endif +#ifdef HAVE_WCTYPE_H +#include +#endif #if !defined(mingw32_TARGET_OS) && !defined(irix_TARGET_OS) # if defined(HAVE_SYS_RESOURCE_H) @@ -111,11 +117,24 @@ int *ghcErrno(void); HsInt systemCmd(HsAddr cmd); /* in rawSystem.c */ -HsInt rawSystemCmd(HsAddr cmd); +#if defined(mingw32_TARGET_OS) +HsInt rawSystem(HsAddr cmd); +#else +HsInt rawSystem(HsAddr cmd, HsAddr args); +#endif /* in inputReady.c */ int inputReady(int fd, int msecs, int isSock); +/* in writeError.c */ +void writeErrString__(HsAddr msg_hdr, HsAddr msg, HsInt len); + +/* in forkOS.c */ +int forkOS_createThread ( HsStablePtr entry ); + +/* in Signals.c */ +extern HsInt nocldstop; + /* ----------------------------------------------------------------------------- 64-bit operations, defined in longlong.c -------------------------------------------------------------------------- */ @@ -246,11 +265,7 @@ __hscore_seek_cur() INLINE HsInt __hscore_o_binary() { -#ifdef HAVE_O_BINARY - return O_BINARY; -#else - return 0; -#endif + return CONST_O_BINARY; } INLINE int @@ -371,10 +386,10 @@ __hscore_PrelHandle_write( HsInt fd, HsBool isSock, HsAddr ptr, { #if defined(__MINGW32__) if (isSock) { - return send(fd,ptr + off, sz, 0); + return send(fd,(char *)ptr + off, sz, 0); } #endif - return write(fd,ptr + off, sz); + return write(fd,(char *)ptr + off, sz); } INLINE HsInt @@ -383,10 +398,10 @@ __hscore_PrelHandle_read( HsInt fd, HsBool isSock, HsAddr ptr, { #if defined(__MINGW32__) if (isSock) { - return recv(fd,ptr + off, sz, 0); + return recv(fd,(char *)ptr + off, sz, 0); } #endif - return read(fd,ptr + off, sz); + return read(fd,(char *)ptr + off, sz); } @@ -418,7 +433,15 @@ __hscore_lstat( HsAddr fname, HsAddr st ) #endif } -INLINE HsInt __hscore_path_max() { return PATH_MAX; } +#ifdef PATH_MAX +/* A size that will contain many path names, but not necessarily all + * (PATH_MAX is not defined on systems with unlimited path length, + * e.g. the Hurd). + */ +INLINE HsInt __hscore_long_path_size() { return PATH_MAX; } +#else +INLINE HsInt __hscore_long_path_size() { return 4096; } +#endif INLINE mode_t __hscore_R_OK() { return R_OK; } INLINE mode_t __hscore_W_OK() { return W_OK; } @@ -617,7 +640,9 @@ INLINE int __hsposix_SIGTTIN() { return SIGTTIN; } INLINE int __hsposix_SIGTTOU() { return SIGTTOU; } INLINE int __hsposix_SIGUSR1() { return SIGUSR1; } INLINE int __hsposix_SIGUSR2() { return SIGUSR2; } +#if HAVE_SIGPOLL INLINE int __hsposix_SIGPOLL() { return SIGPOLL; } +#endif INLINE int __hsposix_SIGPROF() { return SIGPROF; } INLINE int __hsposix_SIGSYS() { return SIGSYS; } INLINE int __hsposix_SIGTRAP() { return SIGTRAP; } @@ -629,7 +654,7 @@ INLINE int __hsposix_SIGXFSZ() { return SIGXFSZ; } INLINE int __hsposix_SIG_BLOCK() { return SIG_BLOCK; } INLINE int __hsposix_SIG_UNBLOCK() { return SIG_SETMASK; } INLINE int __hsposix_SIG_SETMASK() { return SIG_UNBLOCK; } -#endif // mingw32_TARGET_OS +#endif /* mingw32_TARGET_OS */ -#endif +#endif /* __HSBASE_H__ */