unix-2.5.0.0: POSIX functionality

Portabilitynon-portable (requires POSIX)
Stabilityprovisional
Maintainerlibraries@haskell.org

System.Posix.Unistd

Description

POSIX miscellaneous stuff, mostly from unistd.h

System environment

data SystemID Source

Constructors

getSystemID :: IO SystemID Source

data SysVar Source

Constructors

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: Control.Concurrent.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. Control.Concurrent.threadDelay has neither of these shortcomings.

nanosleep :: Integer -> IO () Source

Sleep for the specified duration (in nanoseconds)

AltStyle によって変換されたページ (->オリジナル) /