![]() |
![]()
| ![]() |
![]()
NAME
LIBRARYlibrary “libcap_syslog” SYNOPSIS
void
void
void
void
int
DESCRIPTIONThe functions
All of these functions are reentrant but not thread-safe. That is, they may be called from separate threads only with different cap_channel_t arguments or with synchronization. EXAMPLESThe following example first opens a capability to casper and then
uses this capability to create the cap_channel_t *capcas, *capsyslog; /* Open capability to Casper. */ capcas = cap_init(); if (capcas == NULL) err(1, "Unable to contact Casper"); /* Enter capability mode sandbox. */ if (cap_enter() < 0 && errno != ENOSYS) err(1, "Unable to enter capability mode"); /* Use Casper capability to create capability to the system.syslog service. */ capsyslog = cap_service_open(capcas, "system.syslog"); if (capsyslog == NULL) err(1, "Unable to open system.syslog service"); /* Close Casper capability, we don't need it anymore. */ cap_close(capcas); /* Let's log something. */ cap_syslog(capsyslog, LOG_NOTICE, "System logs from capability mode."); SEE ALSOcap_enter(2), closelog(3), err(3), openlog(3), setlogmask(3), syslog(3), vsyslog(3), capsicum(4), nv(9) HISTORYThe AUTHORSMariusz Zaborski <oshogbo@FreeBSD.org>
|