[New-bugs-announce] [issue25026] (FreeBSD/OSX) Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).

koobs report at bugs.python.org
Tue Sep 8 08:35:17 CEST 2015


New submission from koobs:

In my current attempt to create a FreeBSD port for python35, I've come across a patch rejection for the fcntlmodule.c for a local port patch we've been carrying since Python 2.6:

https://svnweb.freebsd.org/ports/head/lang/python27/files/patch-Modules__fcntlmodule.c?revision=391238&view=markup

The original commit log for this change is:

====================================

  Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).
  
  Although POSIX says the type is 'int', all BSD variants (including Mac OS X)
  have been using 'unsigned long' type for very long time and its use predates
  the standard long enough.  For certain commands (e.g., TIOCSWINSZ, FIONBIO),
  the Python value may get sign-extended on 64-bit platforms (by implicit type
  promotion) and it causes annoying warnings from kernel such as this:
  
  WARNING pid 24509 (python2.6): ioctl sign-extension ioctl ffffffff8004667e

====================================

I'm not sure how this should be fixed upstream, nor clear on how to re-patch it given recent changes to  fcntlmodule.c

----------
components: Interpreter Core
keywords: easy
messages: 250163
nosy: koobs
priority: normal
severity: normal
status: open
title: (FreeBSD/OSX) Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25026>
_______________________________________


More information about the New-bugs-announce mailing list