STINNER Victor added the comment:

> The ioctl is blocked for given file type regardless of request argument. As 
> I'm running Python on non-rooted Android updating policy is not really an 
> option.

Oh. Right :-) My intent was to suggest to report the SELinux issue upstream ;-)

> It will always fail for given file type (such as sockets), while it will work 
> for others (such as regular files). I think that remembering that ioctl 
> doesn't work may be okay, though I may be wrong. Either way if we are wrong 
> whenever ioctl works we'll do one extra syscall.

The purpose of using ioctl() is to *reduce* the number of syscalls. If an 
application mostly use sockets, it will do 3 syscalls per socket (ioctl, fcntl 
get, fcntl set) instead of just 2 (fcntl get, fcntl set) :-/ So I like your 
patch ;-)

I applied your fix to Python 3.5 and 3.6. Thanks for your contribution.

You should now sign the PSF Contributor Agreement:
https://www.python.org/psf/contrib/contrib-form/

(Well, in fact it would be better to do that *before* merging your change, but 
well, your change is short enough ;-))

----------
resolution:  -> fixed
status: open -> closed
versions: +Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27057>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to