<s>
In	O
computer	B-Architecture
networking	I-Architecture
,	O
STREAMS	B-Operating_System
is	O
the	O
native	O
framework	O
in	O
Unix	B-Operating_System
System	I-Operating_System
V	I-Operating_System
for	O
implementing	O
character	O
device	O
drivers	O
,	O
network	B-Application
protocols	O
,	O
and	O
inter-process	B-Operating_System
communication	I-Operating_System
.	O
</s>
<s>
In	O
this	O
framework	O
,	O
a	O
stream	O
is	O
a	O
chain	O
of	O
coroutines	B-Architecture
that	O
pass	B-Architecture
messages	I-Architecture
between	O
a	O
program	O
and	O
a	O
device	O
driver	O
(	O
or	O
between	O
a	O
pair	O
of	O
programs	O
)	O
.	O
</s>
<s>
STREAMS	B-Operating_System
originated	O
in	O
Version	O
8	O
Research	B-Operating_System
Unix	I-Operating_System
,	O
as	O
Streams	B-Operating_System
(	O
not	O
capitalized	O
)	O
.	O
</s>
<s>
STREAMS	B-Operating_System
's	O
design	O
is	O
a	O
modular	O
architecture	O
for	O
implementing	O
full-duplex	O
I/O	B-General_Concept
between	O
kernel	B-Operating_System
and	O
device	O
drivers	O
.	O
</s>
<s>
Its	O
most	O
frequent	O
uses	O
have	O
been	O
in	O
developing	O
terminal	O
I/O	B-General_Concept
(	O
line	B-Operating_System
discipline	I-Operating_System
)	O
and	O
networking	O
subsystems	O
.	O
</s>
<s>
In	O
System	B-Operating_System
V	I-Operating_System
Release	O
4	O
,	O
the	O
entire	O
terminal	O
interface	O
was	O
reimplemented	O
using	O
STREAMS	B-Operating_System
.	O
</s>
<s>
An	O
important	O
concept	O
in	O
STREAMS	B-Operating_System
is	O
the	O
ability	O
to	O
push	O
drivers	O
custom	O
code	O
modules	O
which	O
can	O
modify	O
the	O
functionality	O
of	O
a	O
network	B-Application
interface	O
or	O
other	O
device	O
together	O
to	O
form	O
a	O
stack	O
.	O
</s>
<s>
STREAMS	B-Operating_System
was	O
based	O
on	O
the	O
Streams	B-Operating_System
I/O	B-General_Concept
subsystem	O
introduced	O
in	O
the	O
Eighth	B-Operating_System
Edition	I-Operating_System
Research	I-Operating_System
Unix	I-Operating_System
(	O
V8	O
)	O
by	O
Dennis	O
Ritchie	O
,	O
where	O
it	O
was	O
used	O
for	O
the	O
terminal	O
I/O	B-General_Concept
subsystem	O
and	O
the	O
Internet	B-Protocol
protocol	I-Protocol
suite	I-Protocol
.	O
</s>
<s>
This	O
version	O
,	O
not	O
yet	O
called	O
STREAMS	B-Operating_System
in	O
capitals	O
,	O
fit	O
the	O
new	O
functionality	O
under	O
the	O
existing	O
device	O
I/O	B-General_Concept
system	B-Operating_System
calls	I-Operating_System
(	O
open	O
,	O
close	O
,	O
read	O
,	O
write	O
,	O
and	O
ioctl	B-Operating_System
)	O
,	O
and	O
its	O
application	O
was	O
limited	O
to	O
terminal	O
I/O	B-General_Concept
and	O
protocols	O
providing	O
pipe-like	O
I/O	B-General_Concept
semantics	O
.	O
</s>
<s>
This	O
I/O	B-General_Concept
system	O
was	O
ported	O
to	O
System	B-Operating_System
V	I-Operating_System
Release	I-Operating_System
3	I-Operating_System
by	O
Robert	O
Israel	O
,	O
Gil	O
McGrath	O
,	O
Dave	O
Olander	O
,	O
Her-Daw	O
Che	O
,	O
and	O
Maury	O
Bach	O
as	O
part	O
of	O
a	O
wider	O
framework	O
intended	O
to	O
support	O
a	O
variety	O
of	O
transport	B-Architecture
protocols	I-Architecture
,	O
including	O
TCP	O
,	O
ISO	O
Class	O
4	O
transport	O
,	O
SNA	O
LU	O
6.2	O
,	O
and	O
the	O
AT&T	O
NPACK	O
protocol	O
(	O
used	O
in	O
RFS	B-Operating_System
)	O
.	O
</s>
<s>
It	O
was	O
first	O
released	O
with	O
the	O
Network	B-Application
Support	O
Utilities	O
(	O
NSU	O
)	O
package	O
of	O
UNIX	B-Operating_System
System	I-Operating_System
V	I-Operating_System
Release	O
3	O
.	O
</s>
<s>
This	O
port	O
added	O
the	O
putmsg	O
,	O
getmsg	O
,	O
and	O
poll	O
system	B-Operating_System
calls	I-Operating_System
,	O
which	O
are	O
nearly	O
equivalent	O
in	O
purpose	O
to	O
the	O
send	O
,	O
recv	O
,	O
and	O
select	B-Language
calls	O
from	O
Berkeley	B-Protocol
sockets	I-Protocol
.	O
</s>
<s>
The	O
putmsg	O
and	O
getmsg	O
system	B-Operating_System
calls	I-Operating_System
were	O
originally	O
called	O
send	O
and	O
recv	O
,	O
but	O
were	O
renamed	O
to	O
avoid	O
namespace	O
conflict	O
.	O
</s>
<s>
In	O
System	B-Operating_System
V	I-Operating_System
Release	O
4	O
,	O
STREAMS	B-Operating_System
was	O
extended	O
and	O
used	O
for	O
the	O
terminal	O
I/O	B-General_Concept
framework	O
and	O
pipes	O
,	O
providing	O
useful	O
new	O
functionality	O
like	O
bidirectional	O
pipes	O
and	O
file	B-Application
descriptor	I-Application
passing	O
.	O
</s>
<s>
A	O
port	O
for	O
UNICOS	B-Operating_System
was	O
also	O
produced	O
.	O
</s>
<s>
Eric	O
S	O
.	O
Raymond	O
quotes	O
Ritchie	O
as	O
saying	O
about	O
the	O
complexity	O
of	O
System	B-Operating_System
V	I-Operating_System
STREAMS	B-Operating_System
when	O
compared	O
to	O
his	O
V8	O
Streams	B-Operating_System
that	O
"	O
Streams	B-Operating_System
means	O
something	O
different	O
when	O
shouted	O
"	O
.	O
</s>
<s>
Concurrent	O
with	O
the	O
System	B-Operating_System
V	I-Operating_System
Release	I-Operating_System
3	I-Operating_System
port	O
,	O
AT&T	O
developed	O
protocol-independent	O
STREAMS	B-Operating_System
message	B-Architecture
passing	I-Architecture
guidelines	O
for	O
the	O
link	B-Protocol
,	O
network	B-Application
,	O
and	O
transport	B-Architecture
layers	I-Architecture
of	O
the	O
OSI	O
model	O
(	O
layers	O
2-4	O
)	O
.	O
</s>
<s>
Due	O
to	O
the	O
typically	O
close	O
implementation	O
coupling	O
of	O
the	O
network	B-Application
and	O
transport	B-Architecture
protocols	I-Architecture
in	O
a	O
given	O
protocol	B-Protocol
stack	I-Protocol
,	O
and	O
the	O
typical	O
practice	O
of	O
implementing	O
layers	O
5-7	O
outside	O
of	O
the	O
kernel	B-Operating_System
,	O
only	O
the	O
link	B-Protocol
and	O
transport	B-Architecture
layer	I-Architecture
STREAMS	B-Operating_System
service	O
interfaces	O
were	O
later	O
standardized	O
by	O
X/Open	O
.	O
</s>
<s>
In	O
conjunction	O
with	O
the	O
transport	O
message	B-Architecture
passing	I-Architecture
model	O
,	O
the	O
Transport	B-Application
Layer	I-Application
Interface	I-Application
(	O
later	O
adopted	O
as	O
the	O
X/Open	B-Application
Transport	I-Application
Interface	I-Application
)	O
was	O
defined	O
to	O
provide	O
a	O
transport	O
protocol-independent	O
API	O
for	O
application	O
development	O
.	O
</s>
<s>
Also	O
,	O
a	O
library	O
supporting	O
the	O
session	B-Application
,	O
presentation	B-Application
and	O
application	B-Application
layers	I-Application
was	O
defined	O
and	O
later	O
standardized	O
by	O
The	B-Application
Open	I-Application
Group	I-Application
.	O
</s>
<s>
STREAMS	B-Operating_System
was	O
required	O
for	O
conformance	O
with	O
the	O
Single	O
UNIX	O
Specification	O
versions	O
1	O
(	O
UNIX	O
95	O
)	O
and	O
2	O
(	O
UNIX	O
98	O
)	O
,	O
but	O
as	O
a	O
result	O
of	O
the	O
refusal	O
of	O
the	O
BSD	B-Operating_System
and	O
Linux	B-Operating_System
developers	O
to	O
provide	O
STREAMS	B-Operating_System
,	O
was	O
marked	O
as	O
optional	O
for	O
POSIX	O
compliance	O
by	O
the	O
Austin	O
Group	O
in	O
version	O
3	O
(	O
UNIX	O
03	O
)	O
.	O
</s>
<s>
POSIX.1-2008	O
with	O
TC1	O
(	O
IEEE	O
Std	O
1003.1	O
,	O
2013	O
edition	O
)	O
has	O
designated	O
STREAMS	B-Operating_System
as	O
'	O
marked	O
obsolescent	O
 '	O
meaning	O
that	O
said	O
functionality	O
may	O
be	O
removed	O
in	O
a	O
future	O
version	O
of	O
the	O
specification	O
.	O
</s>
<s>
In	O
Version	B-Operating_System
7	I-Operating_System
Unix	I-Operating_System
,	O
a	O
command	O
was	O
connected	O
to	O
a	O
terminal	O
(	O
keyboard	O
and	O
screen	O
,	O
or	O
keyboard	O
and	O
printer	O
)	O
through	O
a	O
mechanism	O
called	O
the	O
line	B-Operating_System
discipline	I-Operating_System
,	O
which	O
would	O
buffer	O
a	O
single	O
line	O
of	O
input	O
,	O
i.e.	O
,	O
wait	O
for	O
the	O
user	O
to	O
press	O
the	O
Return	B-Device
key	I-Device
before	O
sending	O
input	O
to	O
the	O
program	O
for	O
processing	O
;	O
this	O
allowed	O
simple	O
error	O
correction	O
.	O
</s>
<s>
Streams	B-Operating_System
replaced	O
this	O
with	O
a	O
set	O
of	O
processing	O
modules	O
organized	O
in	O
a	O
linear	O
chain	O
that	O
allowed	O
bidirectional	O
communication	O
between	O
neighboring	O
modules	O
.	O
</s>
<s>
Ritchie	O
gives	O
the	O
example	O
chain	O
of	O
a	O
terminal	O
module	O
chained	O
with	O
a	O
Datakit	B-General_Concept
network	B-Application
module	O
to	O
achieve	O
remote	O
login	O
over	O
a	O
network	B-Application
.	O
</s>
<s>
Aside	O
from	O
characters	O
(	O
bytes	O
)	O
going	O
from	O
program	O
to	O
device	O
and	O
vice	O
versa	O
,	O
Streams	B-Operating_System
could	O
carry	O
control	O
messages	O
such	O
as	O
"	O
hangup	O
"	O
(	O
drop	O
connection	O
)	O
and	O
ioctl	B-Operating_System
messages	O
.	O
</s>
<s>
Streams	B-Operating_System
could	O
also	O
be	O
used	O
for	O
inter-process	B-Operating_System
communication	I-Operating_System
,	O
by	O
connecting	O
two	O
processes	O
to	O
pseudoterminals	B-Protocol
.	O
</s>
<s>
This	O
functionality	O
was	O
implemented	O
in	O
the	O
mpx	O
window	O
system	O
for	O
the	O
Blit	B-Protocol
graphics	O
terminal	O
,	O
which	O
could	O
display	O
multiple	O
terminal	B-Application
emulator	I-Application
windows	O
.	O
</s>
<s>
Each	O
window	O
was	O
a	O
process	O
that	O
communicated	O
with	O
the	O
window	O
system	O
through	O
a	O
pseudoterminal	B-Protocol
that	O
had	O
the	O
line	B-Operating_System
discipline	I-Operating_System
driver	O
installed	O
,	O
sending	O
typed	O
characters	O
to	O
it	O
and	O
receiving	O
text	O
(	O
and	O
graphics	O
)	O
to	O
display	O
.	O
</s>
<s>
The	O
actual	O
Streams	B-Operating_System
modules	O
live	O
in	O
kernel	B-Operating_System
space	I-Operating_System
on	O
Unix	O
,	O
and	O
are	O
installed	O
(	O
pushed	O
)	O
and	O
removed	O
(	O
popped	O
)	O
by	O
the	O
ioctl	B-Operating_System
system	B-Operating_System
call	I-Operating_System
.	O
</s>
<s>
For	O
example	O
,	O
to	O
install	O
the	O
aforementioned	O
line	B-Operating_System
discipline	I-Operating_System
on	O
a	O
file	B-Application
descriptor	I-Application
fd	O
referring	O
to	O
a	O
terminal	O
device	O
,	O
one	O
would	O
write	O
(	O
in	O
C	B-Language
)	O
:	O
</s>
<s>
To	O
perform	O
input/output	B-General_Concept
on	O
a	O
stream	O
,	O
one	O
either	O
uses	O
the	O
read	O
and	O
write	O
system	B-Operating_System
calls	I-Operating_System
as	O
with	O
regular	O
file	B-Application
descriptors	I-Application
,	O
or	O
a	O
set	O
of	O
STREAMS-specific	O
functions	O
to	O
send	O
control	O
messages	O
.	O
</s>
<s>
Ritchie	O
admitted	O
to	O
regretting	O
having	O
to	O
implement	O
Streams	B-Operating_System
in	O
the	O
kernel	B-Operating_System
,	O
rather	O
than	O
as	O
processes	O
,	O
but	O
felt	O
compelled	O
to	O
do	O
so	O
for	O
reasons	O
of	O
efficiency	O
.	O
</s>
<s>
A	O
later	O
Plan	B-Operating_System
9	I-Operating_System
implementation	O
did	O
implement	O
modules	O
as	O
user-level	B-Operating_System
processes	O
.	O
</s>
<s>
STREAMS	B-Operating_System
has	O
mostly	O
been	O
used	O
in	O
the	O
System	B-Operating_System
V	I-Operating_System
Unix	I-Operating_System
world	O
;	O
however	O
,	O
other	O
implementations	O
exist	O
:	O
</s>
<s>
Plan	B-Operating_System
9	I-Operating_System
originally	O
used	O
a	O
multi-processor	O
variant	O
of	O
Research	B-Operating_System
Unix	I-Operating_System
's	O
Streams	B-Operating_System
.	O
</s>
<s>
During	O
the	O
transition	O
to	O
the	O
third	O
edition	O
of	O
Plan	B-Operating_System
9	I-Operating_System
,	O
Streams	B-Operating_System
were	O
further	O
simplified	O
to	O
simple	O
I/O	B-General_Concept
queues	O
.	O
</s>
<s>
An	O
implementation	O
written	O
at	O
Mentat	O
was	O
used	O
in	O
Novell	B-Operating_System
NetWare	I-Operating_System
for	O
its	O
TCP/IP	B-Protocol
stack	I-Protocol
,	O
and	O
licensed	O
by	O
Apple	O
for	O
use	O
in	O
the	O
classic	B-Application
Mac	I-Application
OS	I-Application
starting	O
in	O
version	O
7.5.2	O
,	O
as	O
part	O
of	O
the	O
Open	B-Protocol
Transport	I-Protocol
networking	O
system	O
.	O
</s>
<s>
(	O
In	O
macOS	B-Application
,	O
the	O
Classic	O
Environment	O
used	O
the	O
STREAMS	B-Operating_System
architecture	O
,	O
but	O
the	O
native	O
networking	O
architecture	O
uses	O
the	O
Berkeley	B-Protocol
sockets	I-Protocol
API	O
and	O
is	O
derived	O
from	O
the	O
BSD	B-Operating_System
networking	O
code	O
.	O
)	O
</s>
<s>
FreeBSD	B-Operating_System
has	O
basic	O
support	O
for	O
STREAMS-related	O
system	B-Operating_System
calls	I-Operating_System
,	O
as	O
required	O
by	O
SVR4	O
binary	O
compatibility	B-General_Concept
layer	I-General_Concept
.	O
</s>
<s>
The	O
Windows	B-Device
NT	I-Device
kernel	B-Operating_System
offered	O
a	O
full	O
port	O
of	O
STREAMS	B-Operating_System
as	O
the	O
streams.sys	O
binary	O
.	O
</s>
<s>
NT	O
DDK	O
even	O
had	O
a	O
chapter	O
on	O
STREAMS	B-Operating_System
,	O
going	O
as	O
late	O
as	O
NT4	O
though	O
in	O
NT4	O
DDK	O
it	O
was	O
declared	O
obsolete	O
.	O
</s>
<s>
The	O
original	O
TCP/IP	B-Protocol
stack	I-Protocol
for	O
Windows	B-Device
NT	I-Device
3.1	O
was	O
implemented	O
atop	O
STREAMS	B-Operating_System
by	O
Spider	O
Systems	O
,	O
and	O
used	O
the	O
streams.sys	O
binary	O
.	O
</s>
<s>
From	O
NT	O
3.5	O
up	O
,	O
TCP/IP	B-Protocol
was	O
remade	O
completely	O
,	O
by	O
adopting	O
the	O
one	O
from	O
Microsoft	B-Algorithm
LAN	I-Algorithm
Manager	I-Algorithm
for	O
OS/2	B-Application
1.x	O
.	O
</s>
<s>
Linux	B-Operating_System
does	O
not	O
include	O
STREAMS	B-Operating_System
functionality	O
without	O
third-party	O
add-ons	O
.	O
</s>
<s>
Caldera	O
had	O
"	O
pushed	O
"	O
for	O
STREAMS	B-Operating_System
to	O
be	O
included	O
in	O
Linux	B-Operating_System
ca	O
.	O
</s>
<s>
1998	O
,	O
to	O
support	O
its	O
Netware	B-Operating_System
for	O
Linux	B-Operating_System
,	O
but	O
it	O
was	O
rejected	O
outright	O
by	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
developers	O
on	O
technical	O
grounds	O
(	O
mainly	O
performance	O
)	O
.	O
</s>
<s>
The	O
compatibility	B-General_Concept
layers	I-General_Concept
in	O
Linux	B-Operating_System
for	O
other	O
operating	O
systems	O
convert	O
STREAMS	B-Operating_System
operations	O
into	O
sockets	O
as	O
early	O
as	O
possible	O
.	O
</s>
<s>
The	O
implementation	O
used	O
by	O
Caldera	O
was	O
"	O
LiS	O
"	O
,	O
by	O
a	O
company	O
called	O
GCOM	O
;	O
it	O
later	O
figured	O
in	O
the	O
legal	O
battles	O
by	O
Caldera	O
's	O
successor	O
,	O
the	O
SCO	O
Group	O
,	O
against	O
Linux	B-Operating_System
,	O
with	O
SCO	O
claiming	O
that	O
Linux	B-Operating_System
with	O
STREAMS	B-Operating_System
infringed	O
what	O
it	O
believed	O
to	O
be	O
its	O
copyrights	O
to	O
System	B-Operating_System
V	I-Operating_System
.	O
</s>
