Hello, I have been reading about STREAMS in various Unix Programming
books.  I am working on Linux (RH 6), though.  I found your site, and
installed the LiS package.

Right now, I am still a little overwhelmed by the incomplete examples in
the texts and documentation I have.  I would like to just create a very
simple STREAMS example
program.  I would like it to use the terminal device (pts/x), and then
call putmsg() which will send a message to the terminal.

I believe I need to define a string buffer as follows:

struct strbuf {
    int maxlen; //max buffer length
    int len;    //length of data
    char *buf    //pointer to buffer
}

I would then initialize the string buffer with some data.

strbuf msg_buf;
char data[6] = "Hello\n";

msg_buf.maxlen = 1024;
msg_buf.len = 6;
msg_buf.buf = &data;

Then I would open a stream head with the open() function like follows:

fd = open("/dev/pts/0", O_RDWR);

Then I could call putmsg()

putmsg(fd, , msg_buf.buf, );

I am completely new to this, and I am sure I am missing much in my line
of thinking.  Can anyone help out, or perhaps email me a simple piece of
code I can work with to accomplish this
task?  Thanks in advance!

Davis

----------------------- *THE_LIST_HAS_MOVED* -------------------------------
It is now hosted at gsyc.escet.urjc.es.
To (un)subscribe send a mail to <[EMAIL PROTECTED]>
To send a contribution  send a mail to <[EMAIL PROTECTED]>
Web archives for lists can be found at http://gsyc.escet.urjc.es/lists

Reply via email to