mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
* ext/socket/rubysocket.h (SOCKLEN_MAX): Defined.
* ext/socket/raddrinfo.c (ext/socket/raddrinfo.c): Reject too long Linux abstract socket name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cef6a377fc
commit
ce6db8f286
3 changed files with 16 additions and 1 deletions
|
@ -91,6 +91,12 @@
|
|||
#ifndef HAVE_TYPE_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
#define SOCKLEN_MAX \
|
||||
(0 < (((socklen_t)0)-1) ? \
|
||||
~(socklen_t)0 : \
|
||||
(((((socklen_t)1) << (sizeof(socklen_t) * CHAR_BIT - 2)) - 1) * 2 + 1))
|
||||
|
||||
#ifndef RSTRING_SOCKLEN
|
||||
# define RSTRING_SOCKLEN (socklen_t)RSTRING_LENINT
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue