summaryrefslogtreecommitdiffstats
path: root/Modules/fcntlmodule.c
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-11-07 15:51:41 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-11-07 15:51:41 (GMT)
commit589327ea7a723de32c858d258f91c7a625a052c0 (patch)
tree46a08d826b7ae4d49757c264053cd25bdecf3a78 /Modules/fcntlmodule.c
parentefa7a0e155e508f21dd7ace708b311066637538f (diff)
parentd5a2f0b3a13974e4a62d088aee6f920262c37add (diff)
downloadcpython-589327ea7a723de32c858d258f91c7a625a052c0.zip
cpython-589327ea7a723de32c858d258f91c7a625a052c0.tar.gz
cpython-589327ea7a723de32c858d258f91c7a625a052c0.tar.bz2
Merge #18985: Improve fcntl documentation.
Diffstat (limited to 'Modules/fcntlmodule.c')
-rw-r--r--Modules/fcntlmodule.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 0ce1235..e54c8e0 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -27,7 +27,7 @@ conv_descriptor(PyObject *object, int *target)
}
-/* 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 *args)
}
PyDoc_STRVAR(fcntl_doc,
-"fcntl(fd, opt, [arg])\n\
+"fcntl(fd, op, [arg])\n\
\n\
-Perform the requested operation on file descriptor fd. The operation\n\
-is defined by op and is operating system dependent. These constants are\n\
-available from the fcntl module. The argument arg is optional, and\n\
+Perform the operation op on file descriptor fd. The values used\n\
+for op are operating system dependent, and are available\n\
+as constants in the fcntl module, using the same names as used in\n\
+the relevant C header files. The argument arg is optional, and\n\
defaults to 0; it may be an int or a string. If arg is given as a string,\n\
the return value of fcntl is a string of that length, containing the\n\
resulting value put in the arg buffer by the operating system. The length\n\
@@ -90,7 +91,7 @@ is an integer or if none is specified, the result value is an integer\n\
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 *args)
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 thise.
+ 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
@@ -222,11 +223,12 @@ fcntl_ioctl(PyObject *self, PyObject *args)
}
PyDoc_STRVAR(ioctl_doc,
-"ioctl(fd, opt[, arg[, mutate_flag]])\n\
+"ioctl(fd, op[, arg[, mutate_flag]])\n\
\n\
-Perform the requested operation on file descriptor fd. The operation is\n\
-defined by opt and is operating system dependent. Typically these codes are\n\
-retrieved from the fcntl or termios library modules.\n\
+Perform the operation op on file descriptor fd. The values used for op\n\
+are operating system dependent, and are available as constants in the\n\
+fcntl or termios library modules, using the same names as used in the\n\
+relevant C header files.\n\
\n\
The argument arg is optional, and defaults to 0; it may be an int or a\n\
buffer containing character data (most likely a string or an array). \n\