From owner-freebsd-hackers Fri Sep 1 16:16:43 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from sentinel.office1.bg (sentinel.office1.bg [195.24.48.182]) by hub.freebsd.org (Postfix) with SMTP id 0B37337B42C for ; Fri, 1 Sep 2000 16:16:39 -0700 (PDT) Received: (qmail 53292 invoked by uid 1001); 1 Sep 2000 23:13:20 -0000 Date: Sat, 2 Sep 2000 02:13:19 +0300 From: Peter Pentchev To: Don Lewis Cc: Alexander Maret , "'freebsd-hackers@freebsd.org'" Subject: Re: Redirect stdout/stderr to syslog [OFF-TOPIC] Message-ID: <20000902021319.A52922@ringwraith.office1.bg> References: <58A002A02C5ED311812E0050044517F00D25DB@erlangen01.atrada.de> <20000901152443.K46859@ringwraith.office1.bg> <200009012310.QAA14949@salsa.gv.tsc.tdk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200009012310.QAA14949@salsa.gv.tsc.tdk.com>; from Don.Lewis@tsc.tdk.com on Fri, Sep 01, 2000 at 04:10:40PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Sep 01, 2000 at 04:10:40PM -0700, Don Lewis wrote: > On Sep 1, 3:24pm, Peter Pentchev wrote: > } No, I don't think you can do anything cheaper than a fork and > } a pipe(2). popen(), as suggested in another message, is pretty > } much the same. I don't think stdio has a hook to capture all > } the data a process is sending to a stream, and pass it to some > } routine - that would be perfect, but unfortunately, I am not > } aware of such a thing. I might be wrong though. > > It's not very widely implemented, so any code using it won't be > portable, but take a look at the man page for fuopen(3). I presume you meant funopen() :) Hmm this one looks really nice. I guess what the original poster wanted would be a call to fwopen(), then parsing the 'output' into lines and passing those to syslog().. I'll try it later today. Thanks for the pointer! G'luck, Peter -- If I had finished this sentence, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message