__hscore_memcpy_src_off( char *dst, char *src, int src_off, size_t sz )
{ return memcpy(dst, src+src_off, sz); }
-INLINE HsBool
-__hscore_supportsTextMode()
-{
-#if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
- return HS_BOOL_FALSE;
-#else
- return HS_BOOL_TRUE;
-#endif
-}
-
INLINE HsInt
__hscore_bufsiz()
{
INLINE int __hscore_open(char *file, int how, mode_t mode) {
#ifdef __MINGW32__
if ((how & O_WRONLY) || (how & O_RDWR) || (how & O_APPEND))
- return _sopen(file,how,_SH_DENYRW,mode);
+ return _sopen(file,how | _O_NOINHERIT,_SH_DENYRW,mode);
+ // _O_NOINHERIT: see #2650
else
- return _sopen(file,how,_SH_DENYWR,mode);
+ return _sopen(file,how | _O_NOINHERIT,_SH_DENYWR,mode);
+ // _O_NOINHERIT: see #2650
#else
return open(file,how,mode);
#endif
void errorBelch2(const char*s, char *t);
void debugBelch2(const char*s, char *t);
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
+
+INLINE int fcntl_read(int fd, int cmd) {
+ return fcntl(fd, cmd);
+}
+INLINE int fcntl_write(int fd, int cmd, long arg) {
+ return fcntl(fd, cmd, arg);
+}
+INLINE int fcntl_lock(int fd, int cmd, struct flock *lock) {
+ return fcntl(fd, cmd, lock);
+}
+
+#endif
+
#endif /* __HSBASE_H__ */