The FreeBSD Python Team warmly welcomes Python 3.4 to the Ports tree: - Add lang/python34 - Add devel/py-setuptools34 - Add Python 3.4.0 docs to lang/python-doc Release Announcement and Major Features: https://www.python.org/download/releases/3.4.0/ This also marks the next stage of a cleaner, much-closer-to-upstream approach to Python on FreeBSD, that builds upon the hard work of the entire FreeBSD Python team over the last year. This port is built "entirely" from scratch, retiring as much of the legacy, workarounds, patches and hacks from the existing Python ports as possible. Of particular note: static + shared dual-build is gone, as it was flaky at best, grossly untested upstream and caused more issues than it solved. It is replaced by a shared build by default. The static python library remains installed and usable. Major changes in this structure are: - Replace dual static and shared in-tree build with shared-only. - Use options helpers - Replace plat-freebsd* hacks with a lighter weight alternative - Strip all libraries and shared extensions - Only retain patches that are absolutely necessary - Replace static disabled_module_list with one from upstream - Retain NIS and sparc64 workarounds from python33 - Deprecate SEM option, no longer optional. - Deprecate PTH option, no longer maintained or supported upstream - Deprecate FPECTL option, no longer maintained or supported upstream - Add upstream issue references & breadcrumb annotations where possible Tested by: many (Special thanks to Andrew Berg) Reviewed by: xmj, nemysis, antoine
53 lines
2 KiB
C
53 lines
2 KiB
C
--- ./Modules/fcntlmodule.c.orig 2014-03-04 20:15:17.641117835 +1100
|
|
+++ ./Modules/fcntlmodule.c 2014-03-04 20:19:36.141145958 +1100
|
|
@@ -98,20 +98,15 @@
|
|
{
|
|
#define IOCTL_BUFSZ 1024
|
|
int fd;
|
|
- /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
|
|
+ /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
|
|
format for the 'code' parameter because Python turns 0x8000000
|
|
into either a large positive number (PyLong or PyInt on 64-bit
|
|
platforms) or a negative number on others (32-bit PyInt)
|
|
whereas the system expects it to be a 32bit bit field value
|
|
regardless of it being passed as an int or unsigned long on
|
|
- various platforms. See the termios.TIOCSWINSZ constant across
|
|
- platforms for an example of this.
|
|
-
|
|
- If any of the 64bit platforms ever decide to use more than 32bits
|
|
- in their unsigned long ioctl codes this will break and need
|
|
- special casing based on the platform being built on.
|
|
+ various platforms.
|
|
*/
|
|
- unsigned int code;
|
|
+ unsigned long code;
|
|
int arg;
|
|
int ret;
|
|
Py_buffer pstr;
|
|
@@ -120,7 +115,7 @@
|
|
int mutate_arg = 1;
|
|
char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */
|
|
|
|
- if (PyArg_ParseTuple(args, "O&Iw*|i:ioctl",
|
|
+ if (PyArg_ParseTuple(args, "O&kw*|i:ioctl",
|
|
conv_descriptor, &fd, &code,
|
|
&pstr, &mutate_arg)) {
|
|
char *arg;
|
|
@@ -175,7 +170,7 @@
|
|
}
|
|
|
|
PyErr_Clear();
|
|
- if (PyArg_ParseTuple(args, "O&Is*:ioctl",
|
|
+ if (PyArg_ParseTuple(args, "O&ks*:ioctl",
|
|
conv_descriptor, &fd, &code, &pstr)) {
|
|
str = pstr.buf;
|
|
len = pstr.len;
|
|
@@ -202,7 +197,7 @@
|
|
PyErr_Clear();
|
|
arg = 0;
|
|
if (!PyArg_ParseTuple(args,
|
|
- "O&I|i;ioctl requires a file or file descriptor,"
|
|
+ "O&k|i;ioctl requires a file or file descriptor,"
|
|
" an integer and optionally an integer or buffer argument",
|
|
conv_descriptor, &fd, &code, &arg)) {
|
|
return NULL;
|