From f6d4786b860c92dffd855a90a070212324ff69dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 20 Jul 2012 15:07:48 -0400 Subject: [PATCH] left unsafe imports here; added a comment with a rationalle --- Utility/Mounts.hsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Utility/Mounts.hsc b/Utility/Mounts.hsc index 4994c5e180..6b69e844a3 100644 --- a/Utility/Mounts.hsc +++ b/Utility/Mounts.hsc @@ -57,11 +57,13 @@ getMounts = do } getmntent h (ent:c) +{- Using unsafe imports because the C functions are belived to never block. + - Note that getmntinfo is called with MNT_NOWAIT to avoid possibly blocking; + - while getmntent only accesses a file in /etc (or /proc) that should not + - block. -} foreign import ccall unsafe "libmounts.h mounts_start" c_mounts_start :: IO (Ptr ()) - foreign import ccall unsafe "libmounts.h mounts_next" c_mounts_next :: Ptr () -> IO (Ptr ()) - foreign import ccall unsafe "libmounts.h mounts_end" c_mounts_end :: Ptr () -> IO CInt