
SunOS 5.5 Devices log(7D)
ENXIO is returned for I_TRCLOG ioctls without any trace_ids structures, or for any
unrecognized ioctl calls. The driver silently ignores incorrectly formatted log messages
sent to the driver by a user process (no error results).
Processes that wish to write a message to the console logger may direct their output to
/dev/conslog, using either write(2) or putmsg(2).
EXAMPLES Example of I_ERRLOG registration:
struct strioctl ioc;
ioc.ic_cmd = I_ERRLOG;
ioc.ic_timout = 0; /∗ default timeout (15 secs.) ∗/
ioc.ic_len = 0;
ioc.ic_dp = NULL;
ioctl(log, I_STR, &ioc);
Example of I_TRCLOG registration:
struct trace_ids tid[2];
tid[0].ti_mid = 2;
tid[0].ti_sid = 0;
tid[0].ti_level = 1;
tid[1].ti_mid = 1002;
tid[1].ti_sid = −1; /∗ any sub-id will be allowed ∗/
tid[1].ti_level = −1; /∗ any level will be allowed ∗/
ioc.ic_cmd = I_TRCLOG;
ioc.ic_timout = 0;
ioc.ic_len = 2 ∗ sizeof(struct trace_ids);
ioc.ic_dp = (char ∗)tid;
ioctl(log, I_STR, &ioc);
Example of submitting a log message (no arguments):
struct strbuf ctl, dat;
struct log_ctl lc;
char ∗message = "Don’t forget to pick up some milk
on the way home";
ctl.len = ctl.maxlen = sizeof(lc);
ctl.buf = (char ∗)&lc;
dat.len = dat.maxlen = strlen(message);
modified 23 Feb 1994 7D-197
Comentários a estes Manuais