| Main index | Section 3 | Options |
#include <libcasper.h>
#include <casper/cap_syslog.h>
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.
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) | December 6, 2023 |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | "I liken starting one's computing career with Unix, say as an undergraduate, to being born in East Africa. It is intolerably hot, your body is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act." | ” |
| — Ken Pier, Xerox PARC | ||