Re: logd vs. Polygraph

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 22 Aug 2001 22:39:47 +0200

Robert Collins wrote:

> I take it SIGSTOP stops a process getting any more scheduler time,
> pausing it?

And further, it cannot be blocked or trapped.

> I call
> lf->logfd = lf->ipccomm.pwfd;
> commUnsetNonBlocking(lf->logfd);
> where lf->logfd is the fd that logfileWrite calls will use to send data
> to the log. That should set it NonBlocking yes?

This should clear the non-blocking flags, reverting to blocking I/O mode.

> I've added an assert to the write function, to die if bytes_read
> increases on the logd's stdin fd. I can't commit that until sourceforge
> come back up though.

???

What you should check is that the amount of bytes written is the same as the
requested amount. Reading is irrelevant.

> A related question: should we flush() the pipe/socket before we kill the
> old helper? (If we don't, when we reuse the pipe/socket, I think we
> could collide with in-pipe/socket data?).

Are you using stdio? If so you SHOULD fflush() before killing to make sure all
log data has been sent over the pipe. But the log FILE should at most be set for
line buffering as there may be more than one process writing.

--
Henrik
Received on Wed Aug 22 2001 - 15:02:43 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:15 MST