sendmmsg (was: GNU C Library master sources branch, master, updated. glibc-2.15-526-gc030f70)

Thomas Schwinge thomas@codesourcery.com
Fri Jun 22 13:07:00 GMT 2012


Hi!

On 30 Mar 2012 11:43:09 -0000, drepper@sourceware.org wrote:
> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c030f70c8796c7743c3aa97d6beff3bd5b8dcd5d
> 
> commit c030f70c8796c7743c3aa97d6beff3bd5b8dcd5d
> Author: Ulrich Drepper <drepper@gmail.com>
> Date:   Fri Mar 30 07:42:29 2012 -0400
> 
>     Speed up DNS by avoiding a system call if possible

This patch adds a call to the (currently) Linux-specific sendmmsg to
generic code:

    res_send.c: In function 'send_dg':
    res_send.c:1113:22: error: array type has incomplete element type
           struct mmsghdr reqs[2];
                          ^
    res_send.c:1132:7: warning: implicit declaration of function 'sendmmsg' [-Wimplicit-function-declaration]
           int ndg = sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
           ^

> +	* resolv/res_send.c (send_dg): Use sendmmsg if we have to write two
> +	requests to save a system call.

> +++ b/resolv/res_send.c
> [...]
> +		    int ndg = sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);

How do people want me to solve this?  a) Make the code use sendmmsg only
if it is is available, or b) add a generic ENOSYS sendmmsg stub
(appropriately versioned for 2.16/2.17) and move struct sendmmsg etc. to
a generic place?  (The existing code already does and has to do the
correct thing if sendmmsg "returns" ENOSYS (and probes only once), as
this will also happen with older Linux kernels.)  I'd tend towards b)
because we might add a sendmmsg implementation for GNU/Hurd later on.


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120622/e003de5c/attachment.sig>


More information about the Libc-alpha mailing list