Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
KUTIL_OPENLOG(3)       FreeBSD Library Functions Manual	      KUTIL_OPENLOG(3)

NAME
     kutil_openlog -- configure	log message sink

LIBRARY
     library "libkcgi"

SYNOPSIS
     #include <sys/types.h>
     #include <stdarg.h>
     #include <stdint.h>
     #include <kcgi.h>

     int
     kutil_openlog(const char *file);

DESCRIPTION
     The kutil_openlog() function configures output for	the kutil_log(3) fam-
     ily of functions.	By default, these functions log	to stderr and inherit
     the initial output	buffering behaviour (see setvbuf(3)).

     If	file is	not NULL, kutil_openlog() first	redirects stderr to file.
     Then, regardless of whether file is NULL, the output buffering of the
     stream is set to line buffered.

     CGI scripts invoking long-running child processes via fork(2) should use
     this function with	a valid	file as	the web	server might wait for all file
     descriptors to close before closing the request connection.

RETURN VALUES
     The kutil_openlog() function returns zero on failure (system error) and
     non-zero on success.  If kutil_openlog() fails to re-open stderr, the
     output stream may no longer be operable: the caller should	exit.

AUTHORS
     The kutil_openlog() function was written by Kristaps Dzonsons
     <kristaps@bsd.lv>.

CAVEATS
     In	most situations, file is configured in the default log directory,
     which is not writable to the CGI process.	Thus, file must	be pre-created
     and be writable to	the CGI	process.  Otherwise, kutil_openlog() will fail
     to	create the file	and exit with failure.

FreeBSD	13.0		       December	30, 2017		  FreeBSD 13.0

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | AUTHORS | CAVEATS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=kutil_openlog&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help