propolice and syslog-ng

Robert Connolly robert at linuxfromscratch.org
Wed Sep 29 08:17:09 PDT 2004


Okay. I used the libc syslog function and:

socket(PF_FILE, SOCK_DGRAM, 0)          = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 16) = -1 EPROTOTYPE (Protocol 
wrong type for socket)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0
send(3, "<10>Sep 29 11:07:48 fail: stack "..., 58, 0) = 58
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGABRT, {SIG_DFL}, NULL, 8) = 0

It works good. Glibc's function tries to use SOCK_DGRAM first, and SOCK_STREAM 
second. I don't know if there's a third fallback. But now there's one problem 
remaining. This:

Sep 29 11:07:48 SecondFloor fail: stack overflow in function %s%m

The "%s%m" isn't being expanded. My code is this:

const char message[] = "stack overflow in function %s";
...
syslog(LOG_CRIT, message, "%s%m");

I'm going to try again without the quotes, but it looks like %s doesn't expand 
to anything.

Robert



More information about the hlfs-dev mailing list