1 /* Checking macros for socket functions.
2 Copyright (C) 2005 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 # error "Never include <bits/socket2.h> directly; use <sys/socket.h> instead."
24 extern ssize_t
__recv_chk (int __fd
, void *__buf
, size_t __n
, size_t __buflen
,
26 extern ssize_t
__REDIRECT (__recv_alias
, (int __fd
, void *__buf
, size_t __n
,
29 extern __always_inline ssize_t
30 recv (int __fd
, void *__buf
, size_t __n
, int __flags
)
32 if (__bos0 (__buf
) != (size_t) -1
33 && (!__builtin_constant_p (__n
) || __n
> __bos0 (__buf
)))
34 return __recv_chk (__fd
, __buf
, __n
, __bos0 (__buf
), __flags
);
35 return __recv_alias (__fd
, __buf
, __n
, __flags
);
38 extern ssize_t
__recvfrom_chk (int __fd
, void *__restrict __buf
, size_t __n
,
39 size_t __buflen
, int __flags
,
40 __SOCKADDR_ARG __addr
,
41 socklen_t
*__restrict __addr_len
);
42 extern ssize_t
__REDIRECT (__recvfrom_alias
,
43 (int __fd
, void *__restrict __buf
, size_t __n
,
44 int __flags
, __SOCKADDR_ARG __addr
,
45 socklen_t
*__restrict __addr_len
), recvfrom
);
47 extern __always_inline ssize_t
48 recvfrom (int __fd
, void *__restrict __buf
, size_t __n
, int __flags
,
49 __SOCKADDR_ARG __addr
, socklen_t
*__restrict __addr_len
)
51 if (__bos0 (__buf
) != (size_t) -1
52 && (!__builtin_constant_p (__n
) || __n
> __bos0 (__buf
)))
53 return __recvfrom_chk (__fd
, __buf
, __n
, __bos0 (__buf
), __flags
,
55 return __recvfrom_alias (__fd
, __buf
, __n
, __flags
, __addr
, __addr_len
);