HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehsyslog-5.0.2Haskell2010

System.Posix.Syslog.Functions

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

  • 5 values
  • Packagehsyslog-5.0.2
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFunctions.hs
value_syslog
  1. :: CInt

    The system-specific identifier for System.Posix.Syslog.Facility.

  2. -> CInt

    The system-specific identifier for System.Posix.Syslog.Priority.

  3. -> CString

    The actual log message, which does not need to be terminated by a NUL byte. It should not contain NUL bytes either, though.

  4. -> 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?

  5. -> 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.

value_openlog
  1. :: 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.

  2. -> CInt

    A bit set that combines various Option values.

  3. -> CInt

    A default Facility to use for messages that don't specify one.

  4. -> IO ()
#

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

value_closelog :: IO ()
#

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

value_setlogmask
  1. :: CInt

    A bit mask that determines which priorities are enabled or disabled. See also _LOG_MASK.

  2. -> IO CInt
#

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

value_logMask :: CInt -> CInt
#

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.