From: Jason Vas Dias Date: Tue, 25 Oct 2005 15:27:28 +0000 (-0700) Subject: [perl #37535] [PATCH] ioctl IOCPARM_LEN(x) should be _IOC_SIZE(x) on Linux, not 256 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61f1c44bcd67853cdd813a8eb42caaa03746dbdb;p=p5sagit%2Fp5-mst-13.2.git [perl #37535] [PATCH] ioctl IOCPARM_LEN(x) should be _IOC_SIZE(x) on Linux, not 256 From: Jason Vas Dias (via RT) Message-ID: p4raw-id: //depot/perl@25852 --- diff --git a/perl.h b/perl.h index 97e8058..001bd69 100644 --- a/perl.h +++ b/perl.h @@ -2959,11 +2959,16 @@ typedef pthread_key_t perl_key; #ifndef IOCPARM_LEN # ifdef IOCPARM_MASK - /* on BSDish systes we're safe */ + /* on BSDish systems we're safe */ # define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) # else +# if defined(_IOC_SIZE) && defined(__GLIBC__) + /* on Linux systems we're safe */ +# define IOCPARM_LEN(x) _IOC_SIZE(x) +# else /* otherwise guess at what's safe */ -# define IOCPARM_LEN(x) 256 +# define IOCPARM_LEN(x) 256 +# endif # endif #endif