Annotation of coherent/b/STREAMS/conf_79/echo/strtest.c, revision 1.1.1.1

1.1       root        1: #include <stropts.h>
                      2: #include <fcntl.h>
                      3: #include <stdio.h>
                      4: 
                      5: 
                      6: int main (argc, argv)
                      7: int            argc;
                      8: char         * argv [];
                      9: {
                     10:        int             fd;
                     11:        char            buf [20];
                     12:        int             cnt;
                     13: 
                     14:        if ((fd = open ("/dev/echo", O_RDWR)) == -1) {
                     15: 
                     16:                perror ("Couldn't open /dev/echo");
                     17:                return -1;
                     18:        }
                     19: 
                     20:        fprintf (stderr, "Returned %d\n", fd);
                     21: 
                     22:        fprintf (stderr, "PUSH ioctl () says %d\n", ioctl (fd, I_PUSH, "dump"));
                     23:        fprintf (stderr, "SRDOPT ioctl () says %d\n", ioctl (fd, I_SRDOPT, RMSGN));
                     24: 
                     25:        write (fd, "Foo!", 5);
                     26:        cnt = read (fd, buf, sizeof (buf));
                     27:        buf [cnt] = 0;
                     28: 
                     29:        fprintf (stderr, "Read %d bytes, result = %s\n", cnt, buf);
                     30: 
                     31:        close (fd);
                     32: 
                     33:        return 0;
                     34: }

unix.superglobalmegacorp.com

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