io.c (NUM2IOCTLREQ): Accept a value more than INT_MAX
ioctl accepts int as request arguments on some platforms, but some requests are more than INT_MAX, e.g., RNDGETENTCNT(0x80045200). Passing (0x80045200 | (-1 << 32)) may work around the issue, but it may not work on a platform where ioctl accepts unsigned long. So this change uses NUM2LONG and then casts it to int.
This commit is contained in:
parent
9e4a53fe13
commit
c866663784
2
io.c
2
io.c
@ -9565,7 +9565,7 @@ rb_f_select(int argc, VALUE *argv, VALUE obj)
|
|||||||
# define NUM2IOCTLREQ(num) NUM2ULONG(num)
|
# define NUM2IOCTLREQ(num) NUM2ULONG(num)
|
||||||
#else
|
#else
|
||||||
typedef int ioctl_req_t;
|
typedef int ioctl_req_t;
|
||||||
# define NUM2IOCTLREQ(num) NUM2INT(num)
|
# define NUM2IOCTLREQ(num) ((int)NUM2LONG(num))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_IOCTL
|
#ifdef HAVE_IOCTL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user