Path: utzoo!attcan!uunet!husc6!mailrus!uflorida!gatech!udel!burdvax!coltoff From: coltoff@PRC.Unisys.COM (Joel Coltoff) Newsgroups: comp.unix.wizards Subject: help needed with a server Keywords: sockets, disassociating from tty Message-ID: <8387@burdvax.PRC.Unisys.COM> Date: 21 Nov 88 16:32:11 GMT Organization: Unisys/Paoli Research Center, Paoli, PA 19301 Lines: 35 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@burdvax.prc.unisys.com (ARPA)