| unix-2.3.0.1: POSIX functionality | Source code | Contents | Index

System.Posix.Unistd

Portability | non-portable (requires POSIX)
Stability | provisional
Maintainer | libraries@haskell.org

Contents

System environment
Sleeping

Description
POSIX miscellaneous stuff, mostly from unistd.h
Synopsis

data SystemID = SystemID {

systemName :: String
nodeName :: String
release :: String
version :: String
machine :: String

}

getSystemID :: IO SystemID

data SysVar

= ArgumentLimit
| ChildLimit
| ClockTick
| GroupLimit
| OpenFileLimit
| PosixVersion
| HasSavedIDs
| HasJobControl

getSysVar :: SysVar -> IO Integer
sleep :: Int -> IO Int
usleep :: Int -> IO ()
nanosleep :: Integer -> IO ()

System environment

data SystemID | Source

Constructors

SystemID |

systemName :: String |
nodeName :: String |
release :: String |
version :: String |
machine :: String |

getSystemID :: IO SystemID | Source

data SysVar | Source

Constructors

ArgumentLimit |
ChildLimit |
ClockTick |
GroupLimit |
OpenFileLimit |
PosixVersion |
HasSavedIDs |
HasJobControl |

getSysVar :: SysVar -> IO Integer | Source

Sleeping

sleep :: Int -> IO Int | Source

Sleep for the specified duration (in seconds). Returns the time remaining (if the sleep was interrupted by a signal, for example). GHC Note: the comment for `usleep` also applies here.

usleep :: Int -> IO () | Source

Sleep for the specified duration (in microseconds). GHC Note: `threadDelay` is a better choice. Without the `-threaded` option, `usleep` will block all other user threads. Even with the `-threaded` option, `usleep` requires a full OS thread to itself. `threadDelay` has neither of these shortcomings.

nanosleep :: Integer -> IO () | Source

Sleep for the specified duration (in nanoseconds)
Produced by Haddock version 0.9