+-- POSIX flags only:
+foreign import ccall unsafe "__hscore_o_rdonly" o_RDONLY :: CInt
+foreign import ccall unsafe "__hscore_o_wronly" o_WRONLY :: CInt
+foreign import ccall unsafe "__hscore_o_rdwr" o_RDWR :: CInt
+foreign import ccall unsafe "__hscore_o_append" o_APPEND :: CInt
+foreign import ccall unsafe "__hscore_o_creat" o_CREAT :: CInt
+foreign import ccall unsafe "__hscore_o_excl" o_EXCL :: CInt
+foreign import ccall unsafe "__hscore_o_trunc" o_TRUNC :: CInt
+
+-- non-POSIX flags.
+foreign import ccall unsafe "__hscore_o_noctty" o_NOCTTY :: CInt
+foreign import ccall unsafe "__hscore_o_nonblock" o_NONBLOCK :: CInt
+foreign import ccall unsafe "__hscore_o_binary" o_BINARY :: CInt
+
+foreign import ccall unsafe "__hscore_s_isreg" s_isreg :: CMode -> Bool
+foreign import ccall unsafe "__hscore_s_ischr" s_ischr :: CMode -> Bool
+foreign import ccall unsafe "__hscore_s_isblk" s_isblk :: CMode -> Bool
+foreign import ccall unsafe "__hscore_s_isdir" s_isdir :: CMode -> Bool
+foreign import ccall unsafe "__hscore_s_isfifo" s_isfifo :: CMode -> Bool
+
+foreign import ccall unsafe "__hscore_sizeof_stat" sizeof_stat :: Int
+foreign import ccall unsafe "__hscore_st_mtime" st_mtime :: Ptr CStat -> IO CTime
+foreign import ccall unsafe "__hscore_st_size" st_size :: Ptr CStat -> IO COff
+foreign import ccall unsafe "__hscore_st_mode" st_mode :: Ptr CStat -> IO CMode
+
+foreign import ccall unsafe "__hscore_lflag" c_lflag :: Ptr CTermios -> IO CTcflag
+foreign import ccall unsafe "__hscore_poke_lflag" poke_c_lflag :: Ptr CTermios -> CTcflag -> IO ()
+foreign import ccall unsafe "__hscore_ptr_c_cc" ptr_c_cc :: Ptr CTermios -> IO (Ptr Word8)
+
+foreign import ccall unsafe "__hscore_echo" const_echo :: CInt
+foreign import ccall unsafe "__hscore_tcsanow" const_tcsanow :: CInt
+foreign import ccall unsafe "__hscore_icanon" const_icanon :: CInt
+foreign import ccall unsafe "__hscore_vmin" const_vmin :: CInt
+foreign import ccall unsafe "__hscore_vtime" const_vtime :: CInt
+foreign import ccall unsafe "__hscore_sigttou" const_sigttou :: CInt
+foreign import ccall unsafe "__hscore_sig_block" const_sig_block :: CInt
+foreign import ccall unsafe "__hscore_sig_setmask" const_sig_setmask :: CInt
+foreign import ccall unsafe "__hscore_f_getfl" const_f_getfl :: CInt
+foreign import ccall unsafe "__hscore_f_setfl" const_f_setfl :: CInt
+
+#ifndef mingw32_TARGET_OS
+foreign import ccall unsafe "__hscore_sizeof_termios" sizeof_termios :: Int
+foreign import ccall unsafe "__hscore_sizeof_sigset_t" sizeof_sigset_t :: Int
+#endif