forked from lattera/glibc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add recvmmsg and sendmmsg to the generic glibc API.
- Loading branch information
Showing
13 changed files
with
147 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
2012-11-20 Thomas Schwinge <[email protected]> | ||
|
||
* sysdeps/unix/sysv/linux/bits/socket.h (struct mmsghdr, recvmmsg) | ||
(sendmmsg): Move declarations... | ||
* socket/sys/socket.h: ... here. | ||
* sysdeps/unix/sysv/linux/recvmmsg.c [!defined __NR_recvmmsg && | ||
!defined __NR_socketcall] (recvmmsg): Move ENOSYS stub into and | ||
include it from... | ||
* socket/recvmmsg.c: ... this new file. | ||
* sysdeps/unix/sysv/linux/internal_sendmmsg.S [__ASSUME_SENDMMSG] | ||
(sendmmsg): Rename to __sendmmsg, create weak alias and make | ||
definition of __sendmmsg hidden. | ||
* sysdeps/unix/sysv/linux/sendmmsg.c (sendmmsg): Likewise. | ||
[!defined __NR_sendmmsg && !defined __NR_socketcall] (sendmmsg): | ||
Move ENOSYS stub into and include it from... | ||
* socket/sendmmsg.c: ... this new file. | ||
* sysdeps/unix/sysv/linux/Makefile [subdir=socket] | ||
(sysdep_routines): Move recvmmsg and sendmmsg... | ||
* socket/Makefile (routines): ... here. | ||
* socket/Versions (GLIBC_2.17): Add recvmmsg and sendmmsg. | ||
(GLIBC_PRIVATE): Add __sendmmsg. | ||
* include/sys/socket.h (__sendmmsg): Add declarations. | ||
* resolv/res_send.c (send_dg): Invoke __sendmmsg instead of | ||
sendmmsg. | ||
|
||
2012-11-20 Joseph Myers <[email protected]> | ||
|
||
* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl): Mark | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,10 @@ libc { | |
GLIBC_2.10 { | ||
accept4; | ||
} | ||
GLIBC_2.17 { | ||
recvmmsg; sendmmsg; | ||
} | ||
GLIBC_PRIVATE { | ||
__sendmmsg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Receive multiple messages on a socket. Stub version. | ||
Copyright (C) 2010-2012 Free Software Foundation, Inc. | ||
This file is part of the GNU C Library. | ||
The GNU C Library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
The GNU C Library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with the GNU C Library; if not, see | ||
<http://www.gnu.org/licenses/>. */ | ||
|
||
#include <errno.h> | ||
#include <sys/socket.h> | ||
|
||
/* Receive up to VLEN messages as described by VMESSAGES from socket FD. | ||
Returns the number of bytes read or -1 for errors. */ | ||
int | ||
recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, | ||
const struct timespec *tmo) | ||
{ | ||
__set_errno (ENOSYS); | ||
return -1; | ||
} | ||
stub_warning (recvmmsg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* Send multiple messages on a socket. Stub version. | ||
Copyright (C) 2011-2012 Free Software Foundation, Inc. | ||
This file is part of the GNU C Library. | ||
The GNU C Library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
The GNU C Library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with the GNU C Library; if not, see | ||
<http://www.gnu.org/licenses/>. */ | ||
|
||
#include <errno.h> | ||
#include <sys/socket.h> | ||
|
||
/* Send a VLEN messages as described by VMESSAGES to socket FD. | ||
Returns the number of datagrams successfully written or -1 for errors. */ | ||
int | ||
__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | ||
{ | ||
__set_errno (ENOSYS); | ||
return -1; | ||
} | ||
libc_hidden_def (__sendmmsg) | ||
weak_alias (__sendmmsg, sendmmsg) | ||
stub_warning (sendmmsg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2010 Free Software Foundation, Inc. | ||
/* Copyright (C) 2010-2012 Free Software Foundation, Inc. | ||
This file is part of the GNU C Library. | ||
Contributed by Andreas Schwab <[email protected]>, 2010. | ||
|
@@ -88,12 +88,5 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, | |
/* When __ASSUME_RECVMMSG recvmmsg is defined in internal_recvmmsg.S. */ | ||
# endif | ||
#else | ||
int | ||
recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, | ||
const struct timespec *tmo) | ||
{ | ||
__set_errno (ENOSYS); | ||
return -1; | ||
} | ||
stub_warning (recvmmsg) | ||
# include <socket/recvmmsg.c> | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2011 Free Software Foundation, Inc. | ||
/* Copyright (C) 2011-2012 Free Software Foundation, Inc. | ||
This file is part of the GNU C Library. | ||
Contributed by Ulrich Drepper <[email protected]>, 2011. | ||
|
@@ -26,7 +26,7 @@ | |
|
||
#ifdef __NR_sendmmsg | ||
int | ||
sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | ||
__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | ||
{ | ||
if (SINGLE_THREAD_P) | ||
return INLINE_SYSCALL (sendmmsg, 4, fd, vmessages, vlen, flags); | ||
|
@@ -39,6 +39,8 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | |
|
||
return result; | ||
} | ||
libc_hidden_def (__sendmmsg) | ||
weak_alias (__sendmmsg, sendmmsg) | ||
#elif defined __NR_socketcall | ||
# ifndef __ASSUME_SENDMMSG | ||
extern int __internal_sendmmsg (int fd, struct mmsghdr *vmessages, | ||
|
@@ -48,7 +50,7 @@ extern int __internal_sendmmsg (int fd, struct mmsghdr *vmessages, | |
static int have_sendmmsg; | ||
|
||
int | ||
sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | ||
__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | ||
{ | ||
if (__builtin_expect (have_sendmmsg >= 0, 1)) | ||
{ | ||
|
@@ -81,15 +83,11 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | |
__set_errno (ENOSYS); | ||
return -1; | ||
} | ||
libc_hidden_def (__sendmmsg) | ||
weak_alias (__sendmmsg, sendmmsg) | ||
# else | ||
/* When __ASSUME_SENDMMSG sendmmsg is defined in internal_sendmmsg.S. */ | ||
# endif | ||
#else | ||
int | ||
sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) | ||
{ | ||
__set_errno (ENOSYS); | ||
return -1; | ||
} | ||
stub_warning (sendmmsg) | ||
# include <socket/sendmmsg.c> | ||
#endif |