Sponsored Content
Full Discussion: Stream Read And Write Queues
Top Forums UNIX for Advanced & Expert Users Stream Read And Write Queues Post 21794 by S.P.Prasad on Thursday 23rd of May 2002 12:23:25 AM
Old 05-23-2002
Following is the diagram I found in SCO manuals :-
(upstream) (downstream)
(up^stream) (downstr|eam)
(up|stream) (downstr|eam)
(up|stream) (downstrXeam)
READ QUEUE«.........»WRITE QUEUE
(up^stream) (downstr|eam)
(up|stream) (downstr|eam)
(up|stream) (downstrXeam)
READ QUEUE«...........»WRITE QUEUE
(upstream) (downstream)

The above figure shows queue's linkage with neighboring modules with links ( solid vertical arrows - --> or --X ) in both directions.
I can very well understand the flow of message from downstream to upstream direction. But according to the manual each queue locates it mates ( see dotted line ) .
My question is I am not able to understand why such a relation is required or else I am completely wrong ?

Thanks in advance.

Last edited by S.P.Prasad; 05-23-2002 at 01:37 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read and write from a file

I have tried to show the file name whose size is greater than 200 byte in current directory. Please help me. ls -l | tr -s " " " " | cut -f 5,9 -d " " >out.txt #set -a x `cat out.txt` i=0 `cat out.txt` | while do read x echo $x #re=200 j=0 if }" < "200" ] then echo $j j=`expr $j... (2 Replies)
Discussion started by: rinku
2 Replies

2. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

3. Programming

read/write files

Hi all, I have a problem with some read/write functions. I have a .bin file which contains a lot of structures as follows: struct alumno { char id; char apellido1; char apellido2; char nombre; float nota1p; float nota2p; float notamedia; char photofilename; }; What I have... (3 Replies)
Discussion started by: Attenea
3 Replies

4. Programming

read() blocks process until the stream is closed

Hi @all, i really stuck in programming a tool with bidirectional process communication (popen(cmd, "rw") ... something like that ;-)). Here is the code: if(pipe(p_stdin) != 0 || pipe(p_stdout) != 0) { fprintf(stderr, "Aufruf von pipe() schlug fehl.\n"); exit(1); } ... (6 Replies)
Discussion started by: jens.g
6 Replies

5. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

6. Shell Programming and Scripting

[Video stream] network stream recording with mplayer

Hi I used this command: mplayer http://host/axis-cgi/mjpg/video.cgi -user root -passwd root \ -cache 1024 -fps 25.0 -nosound -vc ffh264 \ -demuxer 3 -dumpstream -dumpfile output.avi It's ok but... Video Playing is very fast! Why? Is it a synch problem? What parameter I have to use for... (1 Reply)
Discussion started by: takeo.kikuta
1 Replies

7. IP Networking

write() / read() syntax

hi am newbie to unix and socket programing I am trying to figuring out syntax for read and write to send data from server to client and client can read it I have to send two integers write(newsockfd,buffer,"%d %d",x,y,0) writing from client where x and y are two integers.. ... (7 Replies)
Discussion started by: karthik1238
7 Replies

8. Programming

Need help about read() and write() on TCP/IP

HI I need to implement a client/server TCP application. the customer is the client and the bartender is the server. When the customer enter the Bar, client connects to the server Server should reply the client immediately. Other wise if the server is busy, it should send an update message... (10 Replies)
Discussion started by: lixiao1212
10 Replies

9. UNIX for Dummies Questions & Answers

Read data from given filename or stream

I have a script that takes 2 parameters (say) as mandatory script1.sh a b The 3rd parameter can be filename which it should process or it can come through a pipeline stream The script should work both ways: script1.sh a b filec or cat filec | script1.sh a b How to put logic in the... (1 Reply)
Discussion started by: ysrini
1 Replies

10. Shell Programming and Scripting

File Read and Write

I have got a file in following format: AAAAAAA BBBBBBBB CCCCCCC DDDDDDD I am trying to read this file and out put it in following format: AAAAAAA,BBBBBBB,CCCCCCC,DDDDDD Preferred method is shell or Perl. Any help appreciated. (11 Replies)
Discussion started by: Araoki
11 Replies
ldterm(7M)							  STREAMS Modules							ldterm(7M)

NAME
ldterm - standard STREAMS terminal line discipline module SYNOPSIS
#include <sys/stream.h> #include <sys/termios.h> int ioctl(fd,I_PUSH,"ldterm"); DESCRIPTION
The ldterm STREAMS module provides most of the termio(7I) terminal interface. The vis module does not perform the low-level device control functions specified by flags in the c_cflag word of the termio/termios structure, or by the IGNBRK, IGNPAR, PARMRK, or INPCK flags in the c_iflag word of the termio/termios structure. Those functions must be performed by the driver or by modules pushed below the ldterm mod- ule. The ldterm module performs all other termio/termios functions, though some may require the cooperation of the driver or modules pushed below ldterm and may not be performed in some cases. These include the IXOFF flag in the c_iflag word and the delays specified in the c_oflag word. The ldterm module also handles single and multi-byte characters from various codesets including both Extended Unix Code (EUC) and non-EUC codesets. The remainder of this section describes the processing of various STREAMS messages on the read- and write-side. Read-side Behavior Various types of STREAMS messages are processed as follows: M_BREAK Depending on the state of the BRKINT flag, either an interrupt signal is generated or the message is treated as if it were an M_DATA message containing a single ASCII NUL character when this message is received. M_DATA This message is normally processed using the standard termio input processing. If the ICANON flag is set, a single input record (``line'') is accumulated in an internal buffer and sent upstream when a line-terminating character is received. If the ICANON flag is not set, other input processing is performed and the processed data are passed upstream. If output is to be stopped or started as a result of the arrival of characters (usually CNTRL-Q and CNTRL-S), M_STOP and M_START messages are sent downstream. If the IXOFF flag is set and input is to be stopped or started as a result of flow- control considerations, M_STOPI and M_STARTI messages are sent downstream. M_DATA messages are sent downstream, as necessary, to perform echoing. If a signal is to be generated, an M_FLUSH message with a flag byte of FLUSHR is placed on the read queue. If the signal is also to flush output, an M_FLUSH message with a flag byte of FLUSHW is sent downstream. All other messages are passed upstream unchanged. Write-side Behavior Various types of STREAMS messages are processed as follows: M_FLUSH The write queue of the module is flushed of all its data messages and the message is passed downstream. M_IOCTL The function of this ioctl is performed and the message is passed downstream in most cases. The TCFLSH and TCXONC ioctls can be performed entirely in the ldterm module, so the reply is sent upstream and the message is not passed downstream. M_DATA If the OPOST flag is set, or both the XCASE and ICANON flags are set, output processing is performed and the processed mes- sage is passed downstream along with any M_DELAY messages generated. Otherwise, the message is passed downstream without change. M_CTL If the size of the data buffer associated with the message is the size of struct iocblk, ldterm will perform functional negotiation to determine where the termio(7I) processing is to be done. If the command field of the iocblk structure (ioc_cmd) is set to MC_NO_CANON, the input canonical processing normally performed on M_DATA messages is disabled and those messages are passed upstream unmodified. (This is for the use of modules or drivers that perform their own input process- ing, such as a pseudo-terminal in TIOCREMOTE mode connected to a program that performs this processing). If the command is MC_DO_CANON, all input processing is enabled. If the command is MC_PART_CANON, then an M_DATA message containing a termios structure is expected to be attached to the original M_CTL message. The ldterm module will examine the iflag, oflag, and lflag fields of the termios structure and from that point on, will process only those flags that have not been turned ON. If none of the above commands are found, the message is ignored. In any case, the message is passed upstream. M_FLUSH The read queue of the module is flushed of all its data messages and all data in the record being accumulated are also flushed. The message is passed upstream. M_IOCACK The data contained within the message, which is to be returned to the process, are augmented if necessary, and the message is passed upstream. All other messages are passed downstream unchanged. IOCTLS
The ldterm module processes the following TRANSPARENT ioctls. All others are passed downstream. TCGETS/TCGETA The message is passed downstream. If an acknowledgment is seen, the data provided by the driver and modules downstream are augmented and the acknowledgement is passed upstream. TCSETS/TCSETSW/TCSETSF/TCSETA/TCSETAW/TCSETAF The parameters that control the behavior of the ldterm module are changed. If a mode change requires options at the stream head to be changed, an M_SETOPTS message is sent upstream. If the ICANON flag is turned on or off, the read mode at the stream head is changed to message-nondiscard or byte-stream mode, respectively. If the TOSTOP flag is turned on or off, the tostop mode at the stream head is turned on or off, respectively. In any case, ldterm passes the ioctl on downstream for possible additional processing. TCFLSH If the argument is 0, an M_FLUSH message with a flag byte of FLUSHR is sent downstream and placed on the read queue. If the argument is 1, the write queue is flushed of all its data messages and an M_FLUSH message with a flag byte of FLUSHW is sent upstream and down- stream. If the argument is 2, the write queue is flushed of all its data messages and an M_FLUSH message with a flag byte of FLUSHRW is sent downstream and placed on the read queue. TCXONC If the argument is 0 and output is not already stopped, an M_STOP message is sent downstream. If the argument is 1 and output is stopped, an M_START message is sent downstream. If the argument is 2 and input is not already stopped, an M_STOPI message is sent downstream. If the argument is 3 and input is stopped, an M_STARTI message is sent downstream. TCSBRK The message is passed downstream, so the driver has a chance to drain the data and then send an M_IOCACK message upstream. EUC_WSET This call takes a pointer to an eucioc structure, and uses it to set the EUC line discipline's local definition for the code set widths to be used for subsequent operations. Within the stream, the line discipline may optionally notify other modules of this setting using M_CTL messages. When this call is received and the euciocstructure contains valid data, the line discipline changes into EUC handling mode once the euciocdata is completely transferred to an internal data structure. EUC_WGET This call takes a pointer to an eucioc structure, and returns in it the EUC code set widths currently in use by the EUC line disci- pline. If the current codeset of the line discipline is not an EUC one, the result is meaningless. SEE ALSO
termios(3C), console(7D), termio(7I) STREAMS Programming Guide SunOS 5.10 7 Jun1999 ldterm(7M)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy