}
}
+void sockpushdata(struct socket *sk, void *buf, size_t size)
+{
+ switch(sk->type)
+ {
+ case SOCK_STREAM:
+ sizebuf(&sk->inbuf.s.buf, &sk->inbuf.s.bufsize, sk->inbuf.s.datasize + size, 1, 1);
+ memmove(sk->inbuf.s.buf + size, sk->inbuf.s.buf, sk->inbuf.s.datasize);
+ memcpy(sk->inbuf.s.buf, buf, size);
+ sk->inbuf.s.datasize += size;
+ break;
+ case SOCK_DGRAM:
+ /* XXX */
+ break;
+ }
+ return;
+}
+
void *sockgetinbuf(struct socket *sk, size_t *size)
{
void *buf;
struct socket *netcslistenlocal(int type, struct sockaddr *name, socklen_t namelen, void (*func)(struct socket *, struct socket *, void *), void *data)
{
struct socket *sk;
+ int intbuf;
/* I don't know if this is actually correct (it probably isn't),
* but since, at on least Linux systems, PF_* are specifically