diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-30 13:09:44 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-30 13:10:45 +0100 |
commit | 0884d8bbae6d76a603ec1385ada2938f88981c5c (patch) | |
tree | 15c91a3bc58ba3537d4b52c48accf8703f3d8ffb /haskell | |
parent | f850e1f065fb04df7cc87a921ab3c658741cc393 (diff) | |
download | libguestfs-0884d8bbae6d76a603ec1385ada2938f88981c5c.tar.gz libguestfs-0884d8bbae6d76a603ec1385ada2938f88981c5c.tar.xz libguestfs-0884d8bbae6d76a603ec1385ada2938f88981c5c.zip |
Generated code for mknod, mkfifo, mknod_b, mknod_c, umask.
Diffstat (limited to 'haskell')
-rw-r--r-- | haskell/Guestfs.hs | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index 3148450d..83706514 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -126,7 +126,12 @@ module Guestfs ( mount_loop, mkswap, mkswap_L, - mkswap_U + mkswap_U, + mknod, + mkfifo, + mknod_b, + mknod_c, + umask ) where import Foreign import Foreign.C @@ -1413,3 +1418,63 @@ mkswap_U h uuid device = do fail err else return () +foreign import ccall unsafe "guestfs_mknod" c_mknod + :: GuestfsP -> CInt -> CInt -> CInt -> CString -> IO (CInt) + +mknod :: GuestfsH -> Int -> Int -> Int -> String -> IO () +mknod h mode devmajor devminor path = do + r <- withCString path $ \path -> withForeignPtr h (\p -> c_mknod p (fromIntegral mode) (fromIntegral devmajor) (fromIntegral devminor) path) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_mkfifo" c_mkfifo + :: GuestfsP -> CInt -> CString -> IO (CInt) + +mkfifo :: GuestfsH -> Int -> String -> IO () +mkfifo h mode path = do + r <- withCString path $ \path -> withForeignPtr h (\p -> c_mkfifo p (fromIntegral mode) path) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_mknod_b" c_mknod_b + :: GuestfsP -> CInt -> CInt -> CInt -> CString -> IO (CInt) + +mknod_b :: GuestfsH -> Int -> Int -> Int -> String -> IO () +mknod_b h mode devmajor devminor path = do + r <- withCString path $ \path -> withForeignPtr h (\p -> c_mknod_b p (fromIntegral mode) (fromIntegral devmajor) (fromIntegral devminor) path) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_mknod_c" c_mknod_c + :: GuestfsP -> CInt -> CInt -> CInt -> CString -> IO (CInt) + +mknod_c :: GuestfsH -> Int -> Int -> Int -> String -> IO () +mknod_c h mode devmajor devminor path = do + r <- withCString path $ \path -> withForeignPtr h (\p -> c_mknod_c p (fromIntegral mode) (fromIntegral devmajor) (fromIntegral devminor) path) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_umask" c_umask + :: GuestfsP -> CInt -> IO (CInt) + +umask :: GuestfsH -> Int -> IO (Int) +umask h mask = do + r <- withForeignPtr h (\p -> c_umask p (fromIntegral mask)) + if (r == -1) + then do + err <- last_error h + fail err + else return (fromIntegral r) + |