Main index | Section 3 | Options |
#include <libcasper.h>
#include <casper/cap_syslog.h>
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.");
CAP_SYSLOG (3) | May 5, 2020 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | This philosophy, in the hands of amateurs, leads to inexplicably mind-numbing botches like the existence of two programs, “head” and “tail,” which print the first part or the last part of a file, depending. Even though their operations are duals of one another, “head” and “tail” are different programs, written by different authors, and take different options! | ” |
— The Unix Haters' handbook |