The following reply was made to PR os-solaris/888; it has been noted by GNATS.

From: Dean Gaudet <[EMAIL PROTECTED]>
To: Larry Rosenman-CyberRamp System Administration <[EMAIL PROTECTED]>
Subject: RE: os-solaris/888: SIGHUP won't restart EVEN WITH THE PATCH
Date: Mon, 28 Jul 1997 03:40:33 -0700 (PDT)

 
 Larry, could you try compiling the program below.  Save it as
 "test-bind.c" and then execute: 
 
 cc -o test-bind test-bind.c -lsocket
 
 When you run it "./test-bind" it should count from 0 to 19.  Tell me what
 happens. 
 
 Also could you please send me the output of "showrev -a" for your system. 
 
 Thanks
 Dean
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <signal.h>
 #include <fcntl.h>
 #include <string.h>
 #include <stdlib.h>
 
 void main (void)
 {
     int i, s, t;
     struct sockaddr_in sa;
 
     sa.sin_family = AF_INET;
     sa.sin_addr.s_addr = htonl (INADDR_ANY);
     sa.sin_port = htons (2718);
 
     for (i = 0; i < 20; ++i) {
         printf ("i = %d\n", i);
        if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
            perror ("socket");
            exit (1);
        }
        if (bind (s, (struct sockaddr *)&sa, sizeof (sa)) == -1) {
            fprintf (stderr, "i = %d, bind: %s\n", i, strerror (errno));
            exit (1);
        }
        if ((t = fcntl (s, F_DUPFD, 16)) == -1) {
            perror ("dup");
            exit (1);
        }
        close (s);
        close (t);
     }
     exit (0);
 }
 

Reply via email to