90 #if defined(OPENSSL_NO_POSIX_IO)
95 static unsigned char *net=NULL;
99 static unsigned char *unnet=NULL;
100 static int unnet_start=0;
101 static int unnet_left=0;
102 static unsigned char *tmpbuf=NULL;
110 if (tmpbuf == NULL)
return(-1);
115 if (net == NULL)
return(-1);
120 if (unnet == NULL)
return(-1);
125 if (unnet_left < len)
130 memcpy(buf,&(unnet[unnet_start]),
135 unnet_start=unnet_left=0;
139 memcpy(buf,&(unnet[unnet_start]),len);
153 #ifndef OPENSSL_SYS_WIN32
154 i=
read(fd,(
void *)&(net[net_num]),
HDRSIZE-net_num);
156 i=_read(fd,(
void *)&(net[net_num]),
HDRSIZE-net_num);
159 if ((i == -1) && (
errno == EINTR))
continue;
161 if (i <= 0)
return(0);
174 rnum=(num < 8)?8:((num+7)/8*8);
177 while (net_num < rnum)
179 #ifndef OPENSSL_SYS_WIN32
180 i=
read(fd,(
void *)&(net[net_num]),rnum-net_num);
182 i=_read(fd,(
void *)&(net[net_num]),rnum-net_num);
185 if ((i == -1) && (
errno == EINTR))
continue;
187 if (i <= 0)
return(0);
198 memcpy(buf,unnet,len);
225 memcpy(buf,tmpbuf,num);