Hi,
It seems that file l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c misses recvmsg() function. There is send(), sendto(), sendmsg(), recv(), recvfrom(), but no recvmsg(). Maybe it's just oversight?
Best regards, Alexander Valitov
Hi,
On Thu Mar 26, 2009 at 06:50:39 -0700, Alexander Valitov wrote:
It seems that file l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c misses recvmsg() function. There is send(), sendto(), sendmsg(), recv(), recvfrom(), but no recvmsg(). Maybe it's just oversight?
Hmm, probably the one who wrote that file back then did not need it, or overlooked it.
Adam
Adam Lackorzynski wrote:
Hi,
On Thu Mar 26, 2009 at 06:50:39 -0700, Alexander Valitov wrote:
It seems that file l4/pkg/l4vfs/lib/libc_backends/socket_io/socket.c misses recvmsg() function. There is send(), sendto(), sendmsg(), recv(), recvfrom(), but no recvmsg(). Maybe it's just oversight?
Hmm, probably the one who wrote that file back then did not need it, or overlooked it.
I believe the problem is a little bit more complicated than that ;-). Getting the corresponding IDL right is tricky, so we delayed the implementation until needed ...
See l4vfs/idl/net_io.idl.
Cheers, Martin
I believe the problem is a little bit more complicated than that ;-). Getting the corresponding IDL right is tricky, so we delayed the implementation until needed ...
Are there any chances that the function will be implemented? Any 'when'? If it's difficult why not to temporarily add recvmsg() that uses recvfrom(). Maybe ignoring msg_control field in msghdr struct. Something like this:
int recvmsg(int s, struct msghdr *msg, int flags) { int i; int byteCnt; int ret;
byteCnt = 0; for( i = 0 ; i < msg->msg_iovlen ; i++ ) { if( ret = recvfrom( s, msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len, flags, (struct sockaddr *) msg->msg_name, &(msg->msg_namelen) ) < 0 ) return byteCnt; byteCnt += ret; } return byteCnt; }
Best Regards, Alexander Valitov
Hi Alexander,
Alexander Valitov wrote: [...]
Are there any chances that the function will be implemented? Any 'when'? If it's difficult why not to temporarily add recvmsg() that uses recvfrom().
I am not anymore working on DROPS and gave up maintainership of L4VFS. Maybe the current maintainers can comment regarding above questions.
Maybe ignoring msg_control field in msghdr struct. Something like this:
int recvmsg(int s, struct msghdr *msg, int flags) { int i; int byteCnt; int ret;
byteCnt = 0; for( i = 0 ; i < msg->msg_iovlen ; i++ ) { if( ret = recvfrom( s, msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len, flags, (struct sockaddr *) msg->msg_name, &(msg->msg_namelen) ) < 0 ) return byteCnt; byteCnt += ret; } return byteCnt; }
There already is a similar hack in L4VFS for readv:
l4vfs/lib/libc_backends/io/vector_io.c
However, if your proposed workaround works for you, just use it :-).
Cheers, Martin
l4-hackers@os.inf.tu-dresden.de