mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Add recvmmsg and sendmmsg to the generic glibc API.
This commit is contained in:
@ -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 <drepper@gmail.com>, 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
|
||||
|
Reference in New Issue
Block a user