hsyslog-5.0.2: FFI interface to syslog(3) from POSIX.1-2001

Maintainer | simons@cryp.to
Stability | provisional
Portability | POSIX
Safe Haskell | None
Language | Haskell2010

System.Posix.Syslog.Functions

Description

Low-level FFI bindings to `syslog(3)` et al from POSIX.1-2008. This module is intended for purposes of low-level implementation. Users of this library should prefer safer and more convenient API provided by System.Posix.Syslog

Synopsis

- _syslog :: CInt -> CInt -> CString -> CInt -> IO ()
- _openlog :: CString -> CInt -> CInt -> IO ()
- _closelog :: IO ()
- _setlogmask :: CInt -> IO CInt
- _logMask :: CInt -> CInt

# Documentation

_syslog Source #

Arguments

:: CInt | The system-specific identifier for `Facility`.
-> CInt | The system-specific identifier for `Priority`.
-> CString | The actual log message, which does not need to be terminated by a NUL byte. It should not contain NUL bytes either, though.
-> CInt | The length of the log message. Yes, this is a signed integer. Yes, an unsigned integer would be better. No, I can't do anything about it. It's frickin' C code from one and a half centuries ago; what do you expect? Just don't pass any negative values here, okay?
-> IO () |

The POSIX function syslog(3) imported into Haskell directly as an "unsafe" C-API call. We chose this specific signature for the variadic function, because it's ideal for the efficient zero-copy implementation provided by the high-level function `syslog`.

_openlog Source #

Arguments

:: CString | A process-wide identifier to prepent to every log message. Note that this string must exist until `closelog` is called. If the underlying memory buffer changes, the identifier used by `syslog` probably changes too. It's safe to pass `nullPtr`, but POSIX does not specify how that choice is interpreted.
-> CInt | A bit set that combines various `Option` values.
-> CInt | A default `Facility` to use for messages that don't specify one.
-> IO () |

The POSIX function openlog(3), imported into Haskell directly as an "unsafe" foreign function call.

_closelog :: IO () Source #

The POSIX function closelog(3) imported into Haskell directly as an "unsafe" foreign function call.

_setlogmask Source #

Arguments

:: CInt | A bit mask that determines which priorities are enabled or disabled. See also `_LOG_MASK`.
-> IO CInt |

The POSIX function setlogmask(3) imported into Haskell directly as an "unsafe" foreign function call.

_logMask :: CInt -> CInt Source #

The POSIX macro LOG_MASK() imported into Haskell directly as a pure, "unsafe" foreign function call. It does feel a little silly to bother with this functions since we pretty much know `_logMask = (2^)` for certain, but, well, POSIX provides this abstraction and so it's probably no good idea to make that assumption.