7.6. Posix, Device- and Class-Specific Functions
Prev | Chapter 7. The `posix` package: POSIX support | Next

## 7.6. Posix, Device- and Class-Specific Functions

    terminalMode    :: TerminalMode -> TerminalAttributes -> Bool
    withMode        :: TerminalAttributes -> TerminalMode -> TerminalAttributes
    withoutMode     :: TerminalAttributes -> TerminalMode -> TerminalAttributes

    bitsPerByte     :: TerminalAttributes -> Int
    withBits        :: TerminalAttributes -> Int -> TerminalAttributes

    controlChar     :: TerminalAttributes -> ControlCharacter -> Maybe Char
    withCC          :: TerminalAttributes
                    -> (ControlCharacter, Char)
                    -> TerminalAttributes
    withoutCC       :: TerminalAttributes
                    -> ControlCharacter
                    -> TerminalAttributes

    inputTime       :: TerminalAttributes -> Int
    withTime        :: TerminalAttributes -> Int -> TerminalAttributes

    minInput        :: TerminalAttributes -> Int
    withMinInput    :: TerminalAttributes -> Int -> TerminalAttributes

    inputSpeed      :: TerminalAttributes -> BaudRate
    withInputSpeed  :: TerminalAttributes -> BaudRate -> TerminalAttributes

    outputSpeed     :: TerminalAttributes -> BaudRate
    withOutputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes

    getTerminalAttributes :: Fd -> IO TerminalAttributes

`getTerminalAttributes fd` calls `tcgetattr` to obtain the `TerminalAttributes` associated with `Fd` `fd`.

    setTerminalAttributes :: Fd
                          -> TerminalAttributes
                          -> TerminalState
                          -> IO ()

`setTerminalAttributes fd attr ts` calls `tcsetattr` to change the `TerminalAttributes` associated with `Fd` `fd` to `attr`, when the terminal is in the state indicated by `ts`.

    sendBreak :: Fd -> Int -> IO ()

`sendBreak fd duration` calls `tcsendbreak` to transmit a continuous stream of zero-valued bits on `Fd` `fd` for the specified implementation-dependent `duration`.

    drainOutput :: Fd -> IO ()

`drainOutput fd` calls `tcdrain` to block until all output written to `Fd` `fd` has been transmitted.

    discardData :: Fd -> QueueSelector -> IO ()

`discardData fd queues` calls `tcflush` to discard pending input and/or output for `Fd` `fd`, as indicated by the `QueueSelector` `queues`.

    controlFlow :: Fd -> FlowAction -> IO ()

`controlFlow fd action` calls `tcflow` to control the flow of data on `Fd` `fd`, as indicated by `action`.

    getTerminalProcessGroupID :: Fd -> IO ProcessGroupID

`getTerminalProcessGroupID fd` calls `tcgetpgrp` to obtain the `ProcessGroupID` of the foreground process group associated with the terminal attached to `Fd` `fd`.

    setTerminalProcessGroupID :: Fd -> ProcessGroupID -> IO ()

`setTerminalProcessGroupID fd pgid` calls `tcsetpgrp` to set the `ProcessGroupID` of the foreground process group associated with the terminal attached to `Fd` `fd` to `pgid`.

Prev | Up | Next
7.5. Posix Input and Output Primitives | Home | 7.7. Posix System Databases