subfdins.c
author tomas@localhost
Thu, 01 Nov 2007 14:46:11 +0100
changeset 0 c045670f36e9
permissions -rw-r--r--
Imported queue-fix-1.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     1
#include "readwrite.h"
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     2
#include "substdio.h"
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     3
#include "subfd.h"
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     4
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     5
int subfd_readsmall(fd,buf,len) int fd; char *buf; int len;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     6
{
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     7
  if (substdio_flush(subfdoutsmall) == -1) return -1;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     8
  return read(fd,buf,len);
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     9
}
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    10
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    11
char subfd_inbufsmall[256];
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    12
static substdio it = SUBSTDIO_FDBUF(subfd_readsmall,0,subfd_inbufsmall,256);
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    13
substdio *subfdinsmall = ⁢