diff options
author | Miles Bader <miles@gnu.org> | 1995-12-07 23:40:53 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-12-07 23:40:53 +0000 |
commit | cea61d5fe1bcbf4ed3d91ee7a63964c9975546d5 (patch) | |
tree | 80c47906a25491e10c10f94d9b333d27f16ecaed | |
parent | 95badf84206ce957c870e8406d312ce3d8f5bd18 (diff) |
Formerly socket-ops.c.~8~
-rw-r--r-- | pfinet/socket-ops.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c index 650343c9..973fb242 100644 --- a/pfinet/socket-ops.c +++ b/pfinet/socket-ops.c @@ -208,7 +208,7 @@ S_socket_bind (struct sock_user *user, mutex_lock (&global_lock); become_task (user); - err = (*user->sock->ops->bind) (user->sock, addr->address, addr->len); + err = - (*user->sock->ops->bind) (user->sock, addr->address, addr->len); mutex_unlock (&global_lock); /* MiG should do this for us, but it doesn't. */ @@ -375,7 +375,20 @@ S_socket_setopt (struct sock_user *user, char *data, u_int datalen) { - return EOPNOTSUPP; + error_t err; + + if (! user) + return EOPNOTSUPP; + + mutex_lock (&global_lock); + become_task (user); + + err = + - (user->sock->ops->setsockopt)(user->sock, level, option, data, datalen); + + mutex_unlock (&global_lock); + + return err; } error_t @@ -404,11 +417,11 @@ S_socket_send (struct sock_user *user, become_task (user); if (addr) - err = (*user->sock->ops->sendto) (user->sock, data, datalen, + err = - (*user->sock->ops->sendto) (user->sock, data, datalen, user->sock->userflags, flags, addr->address, addr->len); else - err = (*user->sock->ops->send) (user->sock, data, datalen, + err = - (*user->sock->ops->send) (user->sock, data, datalen, user->sock->userflags, flags); mutex_unlock (&global_lock); @@ -466,7 +479,7 @@ S_socket_recv (struct sock_user *user, mutex_lock (&global_lock); become_task (user); - err = (*user->sock->ops->recvfrom) (user->sock, *data, amount, 0, flags, + err = - (*user->sock->ops->recvfrom) (user->sock, *data, amount, 0, flags, (struct sockaddr *)addr, &addrlen); mutex_unlock (&global_lock); |