SYSLOG(2)

NAME
syslog - security logging

SYNOPSIS
#include <sys/log.h>

int syslog(command, arg2, arg3)

DESCRIPTION
Syslog controls security logging. The command argument determines the meaning of the other arguments.

Logging is done by writing on special files, described in log(4). One of these files is the `system log file' where the kernel records certain events automatically. Each process has an `audit mask' that determines which events cause logging records; mask items are defined in <sys/log.h>; see log(5). Each file has a `poison class' with value 0, 1, 2, or 3. The kernel has a table of four corresponding `poison masks' and a global audit mask. When a system call mentions a file in a pathname, the poison mask corresponding to the file's poison level is ORed into the process audit mask; when a process executes a file, the global log mask is ORed into the process audit mask.

The forms of the several syslog commands follow. Arguments shown as 0 are ignored.

syslog(LOGON,  fd ,  x )
    Turn logging on; nominate file descriptor fd as repository for log file with minor device number x. Fd must be open for writing. Logging will persist after fd is closed.

syslog(LOGOFF, 0, x")
    Turn logging off on minor device number x.

syslog(LOGGET, n, 0)
    Return the value of the nth poison mask; n=4 designates the global audit mask.

syslog(LOGSET, n, x)
    Set the nth poison mask to x.

syslog(LOGFGET, fd, 0)
    Return the poison level of the file associated with file descriptor fd, which may be open for reading or writing.

syslog(LOGFSET, fd, x)
    Set the poison level of the file associated with file descriptor fd, (which may be open for reading or writing) to x. The poison level is stored in field di_label.lb_junk of the file's inode; see inode(5).

syslog(LOGPGET, pid, 0)
    Return the audit mask of process pid.

syslog(LOGPSET, pid, x)
    Set the audit mask of process pid to x.

Syslog works only in processes with capability T_LOG; see getplab(2).

SEE ALSO
log(4), log(5), syslog(8)

DIAGNOSTICS
EBADF, EFAULT, EINVAL, EIO