Annotation of researchv9/ipc/src/internet/tcpconfig.c, revision 1.1.1.1

1.1       root        1: #include <stdio.h>
                      2: #include <sgtty.h>
                      3: #include <signal.h>
                      4: 
                      5: extern int tcp_ld;
                      6: 
                      7: main(argc, argv)
                      8: char *argv[];
                      9: {
                     10:        int fd, ai;
                     11:        int maxseg = 1024;
                     12: 
                     13:        switch(argc) {
                     14:        case 2:
                     15:                break;
                     16:        case 3:
                     17:                maxseg = atoi(argv[2]);
                     18:                break;
                     19:        default:
                     20:                fprintf(stderr, "Usage: %s device [maxseg]\n", argv[0]);
                     21:                exit(1);
                     22:        }
                     23:        signal(SIGHUP, SIG_IGN);
                     24:        fd = open(argv[1], 2);
                     25:        if(fd < 0){
                     26:                perror(argv[1]);
                     27:                exit(1);
                     28:        }
                     29:        if(ioctl(fd, FIOPUSHLD, &tcp_ld) < 0){
                     30:                perror("PUSHLD tcp");
                     31:                exit(1);
                     32:        }
                     33:        if(argc == 3)
                     34:                if(ioctl(fd, TCPIOMAXSEG, &maxseg) < 0) {
                     35:                        perror("TCPIOMAXSEG tcp");
                     36:                        exit(1);
                     37:                }
                     38:        pause();
                     39: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.