[project @ 2004-02-17 11:22:22 by simonmar]
[haskell-directory.git] / include / HsBase.h
index 6c68618..33f44f4 100644 (file)
@@ -128,7 +128,7 @@ HsInt rawSystem(HsAddr cmd, HsAddr args);
 int inputReady(int fd, int msecs, int isSock);
 
 /* in writeError.c */
-void writeErrString__(HsAddr msg_hdr, HsAddr msg, HsInt len);
+void writeErrString__(HsAddr msg, HsInt len);
 
 /* in Signals.c */
 extern HsInt nocldstop;
@@ -390,7 +390,7 @@ __hscore_setmode( HsInt fd, HsBool toBin )
   return setmode(fd,(toBin == HS_BOOL_TRUE) ? _O_BINARY : _O_TEXT);
 #else
   return 0;
-#endif  
+#endif
 }
 
 INLINE HsInt
@@ -467,7 +467,7 @@ INLINE mode_t __hscore_S_IXUSR() { return S_IXUSR; }
 #if !defined(_MSC_VER)
 INLINE HsAddr
 __hscore_d_name( struct dirent* d )
-{ 
+{
 #if !defined(mingw32_TARGET_OS) && !defined(_MSC_VER)
   return (HsAddr)(&d->d_name);
 #else
@@ -483,7 +483,7 @@ __hscore_end_of_dir( void )
   return 0;
 #else
   return ENOENT;
-#endif  
+#endif
 }
 
 INLINE void
@@ -513,7 +513,7 @@ INLINE void
 __hscore_poke_lflag( struct termios* ts, tcflag_t t ) { ts->c_lflag = t; }
 
 INLINE unsigned char*
-__hscore_ptr_c_cc( struct termios* ts ) 
+__hscore_ptr_c_cc( struct termios* ts )
 { return (unsigned char*) &ts->c_cc; }
 
 INLINE HsInt
@@ -675,5 +675,17 @@ INLINE int __hsposix_SIG_UNBLOCK() { return SIG_UNBLOCK; }
 INLINE int __hsposix_SIG_SETMASK() { return SIG_SETMASK; }
 #endif /* mingw32_TARGET_OS */
 
+// These two are wrapped because on some OSs (eg. Linux) they are
+// macros which redirect to the 64-bit-off_t versions when large file
+// support is enabled.
+//
+INLINE int __hscore_open(char *file, int how, mode_t mode) {
+       return (open(file,how,mode));
+}
+
+INLINE off_t __hscore_lseek(int fd, off_t off, int whence) {
+       return (lseek(fd,off,whence));
+}
+
 #endif /* __HSBASE_H__ */