help needed with a server

Joel Coltoff coltoff at PRC.Unisys.COM
Tue Nov 22 02:32:11 AEST 1988


I have an application that needs a server. Most of the code
works fine on our Suns and 4.3bsd VAX. I'm in the process of
porting this to a System V.3 version of UNIX running on an
Arix nee Arete.

The first question has to do with disassociating from the controlling tty.
On the Sun/VAX version I do the following.

        i = open("/dev/tty", O_RDWR);
        if (i >= 0) {
                if ( ioctl(i, TIOCNOTTY, (char *)0) == -1 ){
                        perror( "ioctl:" );
                }
                (void) close(i);
        }

I can't find anyway to do this on the Arix. How does V.3 deal with this
issue?


The second question deals with sockets. The server sets up a socket
to communicate with the application and then forks and execs. I don't
want to dup() any descriptors. In some cases we need to have stdin,
stdout and stderr available for debugging purposes. When this happens
a window is open on the Sun and we directly access the applcation through
it. Where the problem arises is getting the application to know which
file descriptor to use for the socket. Is there a clever way to do this?
If I do a stat on all open descriptors I don't see one that is marked as
a socket. Any pointers on this would be greatly appreciated.

Thanks in advance.
-- 
	- Joel
		{psuvax1,sdcrdcf}!burdvax!coltoff	(UUCP)
		coltoff at burdvax.prc.unisys.com		(ARPA)



More information about the Comp.unix.wizards mailing list