Set the IO manager pipe descriptors to FD_CLOEXEC
[packages/base.git] / include / HsBase.h
index fd10e11..9bbbdc8 100644 (file)
@@ -9,7 +9,11 @@
 #ifndef __HSBASE_H__
 #define __HSBASE_H__
 
+#ifdef __NHC__
+# include "Nhc98BaseConfig.h"
+#else
 #include "HsBaseConfig.h"
+#endif
 
 /* ultra-evil... */
 #undef PACKAGE_BUGREPORT
@@ -628,6 +632,13 @@ INLINE int __hscore_sig_setmask( void )
 #endif
 }
 
+#ifndef __MINGW32__
+INLINE size_t __hscore_sizeof_siginfo_t (void)
+{
+    return sizeof(siginfo_t);
+}
+#endif
+
 INLINE int
 __hscore_f_getfl( void )
 {
@@ -648,6 +659,26 @@ __hscore_f_setfl( void )
 #endif
 }
 
+INLINE int
+__hscore_f_setfd( void )
+{
+#ifdef F_SETFD
+  return F_SETFD;
+#else
+  return 0;
+#endif
+}
+
+INLINE long
+__hscore_fd_cloexec( void )
+{
+#ifdef FD_CLOEXEC
+  return FD_CLOEXEC;
+#else
+  return 0;
+#endif
+}
+
 // defined in rts/RtsStartup.c.
 extern void* __hscore_get_saved_termios(int fd);
 extern void __hscore_set_saved_termios(int fd, void* ts);