diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-20 15:07:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-20 15:07:48 -0400 |
commit | f6d4786b860c92dffd855a90a070212324ff69dc (patch) | |
tree | da9357719589bd9e576649aee443f6d8b10e2a75 /Utility | |
parent | 9d26b532abfd04bc97f9b922ddb7c14e545a0073 (diff) |
left unsafe imports here; added a comment with a rationalle
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Mounts.hsc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Utility/Mounts.hsc b/Utility/Mounts.hsc index 4994c5e18..6b69e844a 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 |