Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Sep 2000 08:15:22 -0400 (EDT)
From:      Thomas David Rivers <rivers@dignus.com>
To:        maret@atrada.net, roam@orbitel.bg
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: AW: Redirect stdout/stderr to syslog [OFF-TOPIC]
Message-ID:  <200009011215.IAA99159@lakes.dignus.com>
In-Reply-To: <58A002A02C5ED311812E0050044517F00D25DB@erlangen01.atrada.de>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > -----Ursprungliche Nachricht-----
> > Von: Peter Pentchev [mailto:roam@orbitel.bg]
> > Gesendet: Freitag, 1. September 2000 14:00
> > 
> > man 1 logger
> > 
> > pipe your stdout/stderr to logger(1), and you're all set.  
> > You may even
> > specify a facility/level to log with.
> > 
> 
> Thanks for your quick answer but I would prefer to
> do it entirely in C without calling external progs. 
> I could think of a solution forking another child process 
> which does the syslog logging and redirecting stdout/stderr
> of the execvped program via IPC to this child.
> 
> But is there any easier solution?

 You can use popen() to start the external process (logger in this
 case) with the `IPC' already set up.

 Then, perhaps an freopen() stdin/stdout... to the pipes would be
 all you need.

 popen() is one-way though...

	- Dave R. -

--
rivers@dignus.com                         Work: (919) 676-0847
Get your mainframe (370) `C' compiler at http://www.dignus.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009011215.IAA99159>