cpython: ddf6da99b3cd (original) (raw)

--- a/Doc/library/fcntl.rst +++ b/Doc/library/fcntl.rst @@ -30,11 +30,11 @@ The module defines the following functio .. function:: fcntl(fd, op[, arg])

--- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -27,7 +27,7 @@ conv_descriptor(PyObject *object, int t } -/ fcntl(fd, opt, [arg]) / +/ fcntl(fd, op, [arg]) */ static PyObject * fcntl_fcntl(PyObject *self, PyObject *args) @@ -77,11 +77,12 @@ fcntl_fcntl(PyObject *self, PyObject ar } PyDoc_STRVAR(fcntl_doc, -"fcntl(fd, opt, [arg])\n[](#l2.16) +"fcntl(fd, op, [arg])\n[](#l2.17) \n[](#l2.18) -Perform the requested operation on file descriptor fd. The operation\n[](#l2.19) -is defined by op and is operating system dependent. These constants are\n[](#l2.20) -available from the fcntl module. The argument arg is optional, and\n[](#l2.21) +Perform the operation op on file descriptor fd. The values used\n[](#l2.22) +for op are operating system dependent, and are available\n[](#l2.23) +as constants in the fcntl module, using the same names as used in\n[](#l2.24) +the relevant C header files. The argument arg is optional, and\n[](#l2.25) defaults to 0; it may be an int or a string. If arg is given as a string,\n[](#l2.26) the return value of fcntl is a string of that length, containing the\n[](#l2.27) resulting value put in the arg buffer by the operating system. The length\n[](#l2.28) @@ -90,7 +91,7 @@ is an integer or if none is specified, t corresponding to the return value of the fcntl call in the C code."); -/ ioctl(fd, opt, [arg]) / +/ ioctl(fd, op, [arg]) */ static PyObject * fcntl_ioctl(PyObject *self, PyObject *args) @@ -104,7 +105,7 @@ fcntl_ioctl(PyObject *self, PyObject *ar 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

If any of the 64bit platforms ever decide to use more than 32bits in their unsigned long ioctl codes this will break and need @@ -222,11 +223,12 @@ fcntl_ioctl(PyObject *self, PyObject *ar } PyDoc_STRVAR(ioctl_doc, -"ioctl(fd, opt[, arg[, mutate_flag]])\n[](#l2.51) +"ioctl(fd, op[, arg[, mutate_flag]])\n[](#l2.52) \n[](#l2.53) -Perform the requested operation on file descriptor fd. The operation is\n[](#l2.54) -defined by opt and is operating system dependent. Typically these codes are\n[](#l2.55) -retrieved from the fcntl or termios library modules.\n[](#l2.56) +Perform the operation op on file descriptor fd. The values used for op\n[](#l2.57) +are operating system dependent, and are available as constants in the\n[](#l2.58) +fcntl or termios library modules, using the same names as used in the\n[](#l2.59) +relevant C header files.\n[](#l2.60) \n[](#l2.61) The argument arg is optional, and defaults to 0; it may be an int or a\n[](#l2.62) buffer containing character data (most likely a string or an array). \n[](#l2.63)