- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
void
syslog(int pri, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsyslog(pri, fmt, ap);
va_end(ap);
}
......................................
void
vsyslog(int pri, const char *fmt, va_list ap)
{
vsyslog_r(pri, &sdata, fmt, ap);
}
....................................
void
vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap)
{
int cnt;
char ch, *p, *t;
time_t now;
int fd, saved_errno, error;
#define TBUF_LEN 2048
#define FMT_LEN 1024
char *stdp = NULL, tbuf[TBUF_LEN], fmt_cpy[FMT_LEN];
int tbuf_left, fmt_left, prlen;
#define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
/* Check for invalid bits. */
if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
if (data == &sdata) {
syslog(INTERNALLOG,
"syslog: unknown facility/priority: %x", pri);
} else {
syslog_r(INTERNALLOG, data,
"syslog_r: unknown facility/priority: %x", pri);
}
pri &= LOG_PRIMASK|LOG_FACMASK;
}
.......................
}
......................
Из исходников Bioninc - Android libc.
В реализации сислога, в случае ошибки, вызывается syslog