diff options
Diffstat (limited to 'otherlibs/unix/sendrecv.c')
-rw-r--r-- | otherlibs/unix/sendrecv.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/otherlibs/unix/sendrecv.c b/otherlibs/unix/sendrecv.c index 58a896ecc..dfa54c902 100644 --- a/otherlibs/unix/sendrecv.c +++ b/otherlibs/unix/sendrecv.c @@ -72,21 +72,28 @@ value unix_send(sock, buff, ofs, len, flags) /* ML */ return Val_int(ret); } -value unix_sendto(argv, argc) /* ML */ - value * argv; - int argc; +value unix_sendto_native(sock, buff, ofs, len, flags, dest) + value sock, buff, ofs, len, flags, dest; { int ret; - get_sockaddr(argv[5]); + get_sockaddr(dest); enter_blocking_section(); - ret = sendto(Int_val(argv[0]), &Byte(argv[1], Long_val(argv[2])), - Int_val(argv[3]), convert_flag_list(argv[4], msg_flag_table), + ret = sendto(Int_val(sock), &Byte(buff, Long_val(ofs)), + Int_val(len), convert_flag_list(flags, msg_flag_table), &sock_addr.s_gen, sock_addr_len); leave_blocking_section(); if (ret == -1) uerror("sendto", Nothing); return Val_int(ret); } +value unix_sendto(argv, argc) /* ML */ + value * argv; + int argc; +{ + return unix_sendto_native + (argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); +} + #else value unix_recv() { invalid_argument("recv not implemented"); } @@ -95,6 +102,8 @@ value unix_recvfrom() { invalid_argument("recvfrom not implemented"); } value unix_send() { invalid_argument("send not implemented"); } +value unix_sendto_native() { invalid_argument("sendto not implemented"); } + value unix_sendto() { invalid_argument("sendto not implemented"); } #endif |