From b6d97b691ed11c322ca8c20d3329302b58d5e706 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 27 Mar 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-03-27 --- carrera/main.c | 2 +- port/portfns.h | 1 + port/qio.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/carrera/main.c b/carrera/main.c index 0b49638155c3d9995cb2241efce186b0b06f17da..118f48451fcd837c545be053d08bec1f27eddda1 100644 --- a/carrera/main.c +++ b/carrera/main.c @@ -503,7 +503,7 @@ rdbginit(void) { uchar *vec; ulong jba; - +return; /* Only interested in the PC */ Mipsjmpbuf.pc = 0x8001C020; diff --git a/port/portfns.h b/port/portfns.h index a35efc7ad40641cd16cadf4d748d62c16091db2a..d25887481b75ed21d635ef987001e02fe98f67d6 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -204,6 +204,7 @@ int qproduce(Queue*, void*, int); long qread(Queue*, void*, int); void qreopen(Queue*); void qunlock(QLock*); +int qwindow(Queue*); long qwrite(Queue*, void*, int, int); int readnum(ulong, char*, ulong, ulong, int); int readstr(ulong, char*, ulong, char*); diff --git a/port/qio.c b/port/qio.c index 4a51ec131e53474b2933e5045798673a4cd90dfd..748582e21a6c66f9841a6dbadf227d539118d143 100644 --- a/port/qio.c +++ b/port/qio.c @@ -655,6 +655,20 @@ qlen(Queue *q) return q->len; } +/* + * return space remaining before flow control + */ +int +qwindow(Queue *q) +{ + int l; + + l = q->limit - q->len; + if(l < 0) + l = 0; + return l; +} + /* * return true if we can read without blocking */