diff options
author | Michael I. Bushnell <mib@gnu.org> | 1995-11-16 20:16:37 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1995-11-16 20:16:37 +0000 |
commit | e80dfab0304b0ff2b3ea5846bc62a540f345b5fd (patch) | |
tree | 2b020d38ef4312e87912dd56e695921ed0515e12 /pfinet | |
parent | 25967741c828a8a2a2e7ead4006e717fee48a5a4 (diff) |
Formerly misc.c.~5~
Diffstat (limited to 'pfinet')
-rw-r--r-- | pfinet/misc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pfinet/misc.c b/pfinet/misc.c index e30f9493..45cf61ae 100644 --- a/pfinet/misc.c +++ b/pfinet/misc.c @@ -113,11 +113,22 @@ struct socket * sock_alloc (void) { struct socket *sock; + struct wait_queue *wait, **waitp; + + sock = malloc (sizeof (struct wait_queue) + + sizeof (struct wait_queue *) + + sizeof (struct socket)); + wait = (void *)sock + sizeof (struct socket); + waitp = (void *)wait + sizeof (struct wait_queue); - sock = malloc (sizeof (struct socket)); bzero (sock, sizeof (struct socket)); - sock->state = SS_UNCONNECTED; + sock->wait = waitp; + + condition_init (&wait->c); + + *waitp = wait; + return sock; } |