Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
589327ea
Kaydet (Commit)
589327ea
authored
Kas 07, 2013
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge #18985: Improve fcntl documentation.
üst
efa7a0e1
d5a2f0b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
fcntl.rst
Doc/library/fcntl.rst
+8
-5
fcntlmodule.c
Modules/fcntlmodule.c
+13
-11
No files found.
Doc/library/fcntl.rst
Dosyayı görüntüle @
589327ea
...
@@ -30,11 +30,11 @@ The module defines the following functions:
...
@@ -30,11 +30,11 @@ The module defines the following functions:
.. function:: fcntl(fd, op[, arg])
.. function:: fcntl(fd, op[, arg])
Perform the
requested operation
on file descriptor *fd* (file objects providing
Perform the
operation *op*
on file descriptor *fd* (file objects providing
a :meth:`~io.IOBase.fileno` method are accepted as well).
The operation is
a :meth:`~io.IOBase.fileno` method are accepted as well).
The values used
defined by *op*
for *op* are operating system dependent, and are available as constants
and is operating system dependent. These codes are also found in the
in the :mod:`fcntl` module, using the same names as used in the relevant C
:mod:`fcntl` module.
The argument *arg* is optional, and defaults to the integer
header files.
The argument *arg* is optional, and defaults to the integer
value ``0``. When present, it can either be an integer value, or a string.
value ``0``. When present, it can either be an integer value, or a string.
With the argument missing or an integer value, the return value of this function
With the argument missing or an integer value, the return value of this function
is the integer return value of the C :c:func:`fcntl` call. When the argument is
is the integer return value of the C :c:func:`fcntl` call. When the argument is
...
@@ -56,6 +56,9 @@ The module defines the following functions:
...
@@ -56,6 +56,9 @@ The module defines the following functions:
that the argument handling is even more complicated.
that the argument handling is even more complicated.
The op parameter is limited to values that can fit in 32-bits.
The op parameter is limited to values that can fit in 32-bits.
Additional constants of interest for use as the *op* argument can be
found in the :mod:`termios` module, under the same names as used in
the relevant C header files.
The parameter *arg* can be one of an integer, absent (treated identically to the
The parameter *arg* can be one of an integer, absent (treated identically to the
integer ``0``), an object supporting the read-only buffer interface (most likely
integer ``0``), an object supporting the read-only buffer interface (most likely
...
...
Modules/fcntlmodule.c
Dosyayı görüntüle @
589327ea
...
@@ -27,7 +27,7 @@ conv_descriptor(PyObject *object, int *target)
...
@@ -27,7 +27,7 @@ conv_descriptor(PyObject *object, int *target)
}
}
/* fcntl(fd, op
t
, [arg]) */
/* fcntl(fd, op, [arg]) */
static
PyObject
*
static
PyObject
*
fcntl_fcntl
(
PyObject
*
self
,
PyObject
*
args
)
fcntl_fcntl
(
PyObject
*
self
,
PyObject
*
args
)
...
@@ -77,11 +77,12 @@ fcntl_fcntl(PyObject *self, PyObject *args)
...
@@ -77,11 +77,12 @@ fcntl_fcntl(PyObject *self, PyObject *args)
}
}
PyDoc_STRVAR
(
fcntl_doc
,
PyDoc_STRVAR
(
fcntl_doc
,
"fcntl(fd, op
t
, [arg])
\n
\
"fcntl(fd, op, [arg])
\n
\
\n
\
\n
\
Perform the requested operation on file descriptor fd. The operation
\n
\
Perform the operation op on file descriptor fd. The values used
\n
\
is defined by op and is operating system dependent. These constants are
\n
\
for op are operating system dependent, and are available
\n
\
available from the fcntl module. The argument arg is optional, and
\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
\
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
\
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
\
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\
...
@@ -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."
);
corresponding to the return value of the fcntl call in the C code."
);
/* ioctl(fd, op
t
, [arg]) */
/* ioctl(fd, op, [arg]) */
static
PyObject
*
static
PyObject
*
fcntl_ioctl
(
PyObject
*
self
,
PyObject
*
args
)
fcntl_ioctl
(
PyObject
*
self
,
PyObject
*
args
)
...
@@ -104,7 +105,7 @@ 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
whereas the system expects it to be a 32bit bit field value
regardless of it being passed as an int or unsigned long on
regardless of it being passed as an int or unsigned long on
various platforms. See the termios.TIOCSWINSZ constant across
various platforms. See the termios.TIOCSWINSZ constant across
platforms for an example of this
e
.
platforms for an example of this.
If any of the 64bit platforms ever decide to use more than 32bits
If any of the 64bit platforms ever decide to use more than 32bits
in their unsigned long ioctl codes this will break and need
in their unsigned long ioctl codes this will break and need
...
@@ -222,11 +223,12 @@ fcntl_ioctl(PyObject *self, PyObject *args)
...
@@ -222,11 +223,12 @@ fcntl_ioctl(PyObject *self, PyObject *args)
}
}
PyDoc_STRVAR
(
ioctl_doc
,
PyDoc_STRVAR
(
ioctl_doc
,
"ioctl(fd, op
t
[, arg[, mutate_flag]])
\n
\
"ioctl(fd, op[, arg[, mutate_flag]])
\n
\
\n
\
\n
\
Perform the requested operation on file descriptor fd. The operation is
\n
\
Perform the operation op on file descriptor fd. The values used for op
\n
\
defined by opt and is operating system dependent. Typically these codes are
\n
\
are operating system dependent, and are available as constants in the
\n
\
retrieved from the fcntl or termios library modules.
\n
\
fcntl or termios library modules, using the same names as used in the
\n
\
relevant C header files.
\n
\
\n
\
\n
\
The argument arg is optional, and defaults to 0; it may be an int or a
\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
\
buffer containing character data (most likely a string or an array).
\n
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment