Why sendmmsg is not available on iOS?

Questions and Answers about all things *OS (macOS, iOS, tvOS, watchOS)

Why sendmmsg is not available on iOS?

Postby wmm3416 » Tue Feb 19, 2019 10:55 am

I found that sendmmsg/recvmmsg is available in Linux. But when I tried to use sendmmsg to send multiple messages on a socket, I found it is not available on iOS.
Is is actually not implement on XNU or I used it in a wrong way?
wmm3416
 
Posts: 6
Joined: Wed Jan 16, 2019 3:34 am

Re: Why sendmmsg is not available on iOS?

Postby acura » Tue Feb 19, 2019 12:43 pm

It’s a Linux I think. Ported to some other kernelns.
Checkout recvmsg_x and sendmsg_x.
acura
 
Posts: 20
Joined: Thu Feb 15, 2018 9:16 pm

Re: Why sendmmsg is not available on iOS?

Postby wmm3416 » Thu Feb 21, 2019 2:49 am

Thanks a lot. That helps. As you suggested, I found this as below. It seems recvmsg_x is a private system call that we cannot call it directly. Am I right?
/*
* recvmsg_x() is a system call similar to recvmsg(2) to receive
* several datagrams at once in the array of message headers "msgp".
*
* recvmsg_x() can be used only with protocols handlers that have been specially
* modified to support sending and receiving several datagrams at once.
*
* The size of the array "msgp" is given by the argument "cnt".
*
* The "flags" arguments supports only the value MSG_DONTWAIT.
*
* Each member of "msgp" array is of type "struct msghdr_x".
*
* The "msg_iov" and "msg_iovlen" are input parameters that describe where to
* store a datagram in a scatter gather locations of buffers -- see recvmsg(2).
* On output the field "msg_datalen" gives the length of the received datagram.
*
* The field "msg_flags" must be set to zero on input. On output, "msg_flags"
* may have MSG_TRUNC set to indicate the trailing portion of the datagram was
* discarded because the datagram was larger than the buffer supplied.
* recvmsg_x() returns as soon as a datagram is truncated.
*
* recvmsg_x() may return with less than "cnt" datagrams received based on
* the low water mark and the amount of data pending in the socket buffer.
*
* recvmsg_x() returns the number of datagrams that have been received,
* or -1 if an error occurred.
*
* NOTE: This a private system call, the API is subject to change.
*/
wmm3416
 
Posts: 6
Joined: Wed Jan 16, 2019 3:34 am

Re: Why sendmmsg is not available on iOS?

Postby acura » Thu Feb 21, 2019 8:39 pm

Sorry, I missed that. It is still privat for unknown reasons as J states in the free networking chapter. viewtopic.php?f=8&t=19630
acura
 
Posts: 20
Joined: Thu Feb 15, 2018 9:16 pm

Re: Why sendmmsg is not available on iOS?

Postby wmm3416 » Fri Feb 22, 2019 7:07 am

Thanks! ^_^
wmm3416
 
Posts: 6
Joined: Wed Jan 16, 2019 3:34 am


Return to Questions and Answers

Who is online

Users browsing this forum: No registered users and 1 guest