HP3000-L Archives

April 1999, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Date:
Wed, 14 Apr 1999 13:27:10 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (23 lines)
Jeff Kell writes:
>
> If you'll pardon my laziness <grin> does someone have a code snippet
> of the necessary "plumbing" required for a process that is launched
> by inetd?  I am trying to create a service on a new port number and
> would like $stdin/$stdlist pointing cleanly at the socket [if that
> is yet possible].  Is it exactly like the fork() and CGI cases?

When INETD.NET.SYS launches your process, stdin fd 0 is already redirected to
the network socket.  Note that stdout fd 1 and stderr fd 2 are unredirected,
and output sent to these will show up in JINETD's $STDLIST.

To duplicate the HPUX inetd environment where stdout fd 1 is also redirected to
the socket, have your application do:

        dup2(STDIN_FILENO,STDOUT_FILENO);
--
Mark Bixby                      E-mail: [log in to unmask]
Coast Community College Dist.   Web: http://www.cccd.edu/~markb/
District Information Services   1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support               Voice: +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)

ATOM RSS1 RSS2