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
c71585e0
Kaydet (Commit)
c71585e0
authored
Mar 12, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Logical markup.
Markup consistency. Removed incorrect \setindexsubitem{}.
üst
38d3fe01
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
60 deletions
+62
-60
libfcntl.tex
Doc/lib/libfcntl.tex
+31
-30
libfcntl.tex
Doc/libfcntl.tex
+31
-30
No files found.
Doc/lib/libfcntl.tex
Dosyayı görüntüle @
c71585e0
...
@@ -6,54 +6,55 @@
...
@@ -6,54 +6,55 @@
\indexii
{
UNIX@
\UNIX
{}}{
I/O control
}
\indexii
{
UNIX@
\UNIX
{}}{
I/O control
}
This module performs file control and I/O control on file descriptors.
This module performs file control and I/O control on file descriptors.
It is an interface to the
\
dfn
{
fcntl()
}
and
\dfn
{
ioctl()
}
\UNIX
{}
routines.
It is an interface to the
\
cfunction
{
fcntl()
}
and
\cfunction
{
ioctl()
}
File descriptors can be obtained with the
\dfn
{
fileno()
}
method of a
\UNIX
{}
routines. File descriptors can be obtained with the
file or socket object.
\method
{
fileno()
}
method of a
file or socket object.
The module defines the following functions:
The module defines the following functions:
\setindexsubitem
{
(in module struct)
}
\begin{funcdesc}
{
fcntl
}{
fd
\,
op
\optional
{
\
,
arg
}}
\begin{funcdesc}
{
fcntl
}{
fd
, op
\optional
{
, arg
}}
Perform the requested operation on file descriptor
\
code
{
\var
{
fd
}
}
.
Perform the requested operation on file descriptor
\
var
{
fd
}
.
The operation is defined by
\
code
{
\var
{
op
}
}
and is operating system
The operation is defined by
\
var
{
op
}
and is operating system
dependent. Typically these codes can be retrieved from the library
dependent. Typically these codes can be retrieved from the library
module
\
code
{
FCNTL
}
. The argument
\code
{
\var
{
arg
}
}
is optional, and
module
\
module
{
FCNTL
}
. The argument
\var
{
arg
}
is optional, and
defaults to the integer value
\code
{
0
}
. When
defaults to the integer value
\code
{
0
}
. When
it is present, it can either be an integer value, or a string. With
it is present, it can either be an integer value, or a string. With
the argument missing or an integer value, the return value of this
the argument missing or an integer value, the return value of this
function is the integer return value of the
real
\code
{
fcntl()
}
function is the integer return value of the
\C
{}
\cfunction
{
fcntl()
}
call. When the argument is a string it represents a binary
call. When the argument is a string it represents a binary
structure, e.g.
\
created by
\code
{
struct.pack()
}
. The binary data is
structure, e.g.
\
created by
\function
{
struct.pack()
}
. The binary
copied to a buffer whose address is passed to the real
\code
{
fcntl()
}
data is copied to a buffer whose address is passed to the
\C
{}
call. The return value after a successful call is the contents of
\cfunction
{
fcntl()
}
call. The return value after a successful call
the buffer, converted to a string object. In case the
is the contents of the buffer, converted to a string object. In
\code
{
fcntl()
}
fails, an
\code
{
IOError
}
will be raised.
case the
\cfunction
{
fcntl()
}
fails, an
\exception
{
IOError
}
is
raised.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
ioctl
}{
fd
\,
op
\
,
arg
}
\begin{funcdesc}
{
ioctl
}{
fd
, op
, arg
}
This function is identical to the
\
code
{
fcntl()
}
function, except
This function is identical to the
\
function
{
fcntl()
}
function, except
that the operations are typically defined in the library module
that the operations are typically defined in the library module
\
cod
e
{
IOCTL
}
.
\
modul
e
{
IOCTL
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
flock
}{
fd
\
,
op
}
\begin{funcdesc}
{
flock
}{
fd, op
}
Perform the lock operation
\var
{
op
}
on file descriptor
\var
{
fd
}
.
Perform the lock operation
\var
{
op
}
on file descriptor
\var
{
fd
}
.
See the
\UNIX
{}
manual for details. (On some systems, this function is
See the
\UNIX
{}
manual for details. (On some systems, this function is
emulated using
\
code
{
fcntl()
}
.)
emulated using
\
function
{
fcntl()
}
.)
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
lockf
}{
fd
\,
code
\,
\optional
{
len
\,
\optional
{
start
\,
\optional
{
whence
}}}}
\begin{funcdesc}
{
lockf
}{
fd, code,
\optional
{
len,
\optional
{
start,
\optional
{
whence
}}}}
This is a wrapper around the
\code
{
F
_
SETLK
}
and
\code
{
F
_
SETLKW
}
This is a wrapper around the
\constant
{
FCNTL.F
_
SETLK
}
and
\code
{
fcntl()
}
calls. See the
\UNIX
{}
manual for details.
\constant
{
FCNTL.F
_
SETLKW
}
\function
{
fcntl()
}
calls. See the
\UNIX
{}
manual for details.
\end{funcdesc}
\end{funcdesc}
If the library modules
\
code
{
FCNTL
}
or
\code
{
IOCTL
}
are missing, you
If the library modules
\
module
{
FCNTL
}
\refstmodindex
{
FCNTL
}
or
can find the opcodes in the C include files
\file
{
sys/fcntl.h
}
and
\module
{
IOCTL
}
\refstmodindex
{
IOCTL
}
are missing, you can find the
\file
{
sys/ioctl.h
}
. You can create the modules yourself with the h2py
opcodes in the
\C
{}
include files
\code
{
<sys/fcntl.h>
}
and
script, found in the
\file
{
Tools/scripts
}
directory.
\code
{
<sys/ioctl.h>
}
. You can create the modules yourself with the
\
refstmodindex
{
FCNTL
}
\
program
{
h2py
}
script, found in the
\file
{
Tools/scripts/
}
directory.
\refstmodindex
{
IOCTL
}
Examples (all on a SVR4 compliant system):
Examples (all on a SVR4 compliant system):
...
@@ -66,9 +67,9 @@ rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
...
@@ -66,9 +67,9 @@ rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
lockdata = struct.pack('hhllhh', FCNTL.F
_
WRLCK, 0, 0, 0, 0, 0)
lockdata = struct.pack('hhllhh', FCNTL.F
_
WRLCK, 0, 0, 0, 0, 0)
rv = fcntl(file.fileno(), FCNTL.F
_
SETLKW, lockdata)
rv = fcntl(file.fileno(), FCNTL.F
_
SETLKW, lockdata)
\end{verbatim}
\end{verbatim}
%
Note that in the first example the return value variable
\code
{
rv
}
will
Note that in the first example the return value variable
\code
{
rv
}
will
hold an integer value; in the second example it will hold a string
hold an integer value; in the second example it will hold a string
value. The structure lay-out for the
\var
{
lockadata
}
variable is
value. The structure lay-out for the
\var
{
lockadata
}
variable is
system dependent --
therefore using the
\code
{
flock()
}
call may be
system dependent --
- therefore using the
\function
{
flock()
}
call may be
better.
better.
Doc/libfcntl.tex
Dosyayı görüntüle @
c71585e0
...
@@ -6,54 +6,55 @@
...
@@ -6,54 +6,55 @@
\indexii
{
UNIX@
\UNIX
{}}{
I/O control
}
\indexii
{
UNIX@
\UNIX
{}}{
I/O control
}
This module performs file control and I/O control on file descriptors.
This module performs file control and I/O control on file descriptors.
It is an interface to the
\
dfn
{
fcntl()
}
and
\dfn
{
ioctl()
}
\UNIX
{}
routines.
It is an interface to the
\
cfunction
{
fcntl()
}
and
\cfunction
{
ioctl()
}
File descriptors can be obtained with the
\dfn
{
fileno()
}
method of a
\UNIX
{}
routines. File descriptors can be obtained with the
file or socket object.
\method
{
fileno()
}
method of a
file or socket object.
The module defines the following functions:
The module defines the following functions:
\setindexsubitem
{
(in module struct)
}
\begin{funcdesc}
{
fcntl
}{
fd
\,
op
\optional
{
\
,
arg
}}
\begin{funcdesc}
{
fcntl
}{
fd
, op
\optional
{
, arg
}}
Perform the requested operation on file descriptor
\
code
{
\var
{
fd
}
}
.
Perform the requested operation on file descriptor
\
var
{
fd
}
.
The operation is defined by
\
code
{
\var
{
op
}
}
and is operating system
The operation is defined by
\
var
{
op
}
and is operating system
dependent. Typically these codes can be retrieved from the library
dependent. Typically these codes can be retrieved from the library
module
\
code
{
FCNTL
}
. The argument
\code
{
\var
{
arg
}
}
is optional, and
module
\
module
{
FCNTL
}
. The argument
\var
{
arg
}
is optional, and
defaults to the integer value
\code
{
0
}
. When
defaults to the integer value
\code
{
0
}
. When
it is present, it can either be an integer value, or a string. With
it is present, it can either be an integer value, or a string. With
the argument missing or an integer value, the return value of this
the argument missing or an integer value, the return value of this
function is the integer return value of the
real
\code
{
fcntl()
}
function is the integer return value of the
\C
{}
\cfunction
{
fcntl()
}
call. When the argument is a string it represents a binary
call. When the argument is a string it represents a binary
structure, e.g.
\
created by
\code
{
struct.pack()
}
. The binary data is
structure, e.g.
\
created by
\function
{
struct.pack()
}
. The binary
copied to a buffer whose address is passed to the real
\code
{
fcntl()
}
data is copied to a buffer whose address is passed to the
\C
{}
call. The return value after a successful call is the contents of
\cfunction
{
fcntl()
}
call. The return value after a successful call
the buffer, converted to a string object. In case the
is the contents of the buffer, converted to a string object. In
\code
{
fcntl()
}
fails, an
\code
{
IOError
}
will be raised.
case the
\cfunction
{
fcntl()
}
fails, an
\exception
{
IOError
}
is
raised.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
ioctl
}{
fd
\,
op
\
,
arg
}
\begin{funcdesc}
{
ioctl
}{
fd
, op
, arg
}
This function is identical to the
\
code
{
fcntl()
}
function, except
This function is identical to the
\
function
{
fcntl()
}
function, except
that the operations are typically defined in the library module
that the operations are typically defined in the library module
\
cod
e
{
IOCTL
}
.
\
modul
e
{
IOCTL
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
flock
}{
fd
\
,
op
}
\begin{funcdesc}
{
flock
}{
fd, op
}
Perform the lock operation
\var
{
op
}
on file descriptor
\var
{
fd
}
.
Perform the lock operation
\var
{
op
}
on file descriptor
\var
{
fd
}
.
See the
\UNIX
{}
manual for details. (On some systems, this function is
See the
\UNIX
{}
manual for details. (On some systems, this function is
emulated using
\
code
{
fcntl()
}
.)
emulated using
\
function
{
fcntl()
}
.)
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
lockf
}{
fd
\,
code
\,
\optional
{
len
\,
\optional
{
start
\,
\optional
{
whence
}}}}
\begin{funcdesc}
{
lockf
}{
fd, code,
\optional
{
len,
\optional
{
start,
\optional
{
whence
}}}}
This is a wrapper around the
\code
{
F
_
SETLK
}
and
\code
{
F
_
SETLKW
}
This is a wrapper around the
\constant
{
FCNTL.F
_
SETLK
}
and
\code
{
fcntl()
}
calls. See the
\UNIX
{}
manual for details.
\constant
{
FCNTL.F
_
SETLKW
}
\function
{
fcntl()
}
calls. See the
\UNIX
{}
manual for details.
\end{funcdesc}
\end{funcdesc}
If the library modules
\
code
{
FCNTL
}
or
\code
{
IOCTL
}
are missing, you
If the library modules
\
module
{
FCNTL
}
\refstmodindex
{
FCNTL
}
or
can find the opcodes in the C include files
\file
{
sys/fcntl.h
}
and
\module
{
IOCTL
}
\refstmodindex
{
IOCTL
}
are missing, you can find the
\file
{
sys/ioctl.h
}
. You can create the modules yourself with the h2py
opcodes in the
\C
{}
include files
\code
{
<sys/fcntl.h>
}
and
script, found in the
\file
{
Tools/scripts
}
directory.
\code
{
<sys/ioctl.h>
}
. You can create the modules yourself with the
\
refstmodindex
{
FCNTL
}
\
program
{
h2py
}
script, found in the
\file
{
Tools/scripts/
}
directory.
\refstmodindex
{
IOCTL
}
Examples (all on a SVR4 compliant system):
Examples (all on a SVR4 compliant system):
...
@@ -66,9 +67,9 @@ rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
...
@@ -66,9 +67,9 @@ rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
lockdata = struct.pack('hhllhh', FCNTL.F
_
WRLCK, 0, 0, 0, 0, 0)
lockdata = struct.pack('hhllhh', FCNTL.F
_
WRLCK, 0, 0, 0, 0, 0)
rv = fcntl(file.fileno(), FCNTL.F
_
SETLKW, lockdata)
rv = fcntl(file.fileno(), FCNTL.F
_
SETLKW, lockdata)
\end{verbatim}
\end{verbatim}
%
Note that in the first example the return value variable
\code
{
rv
}
will
Note that in the first example the return value variable
\code
{
rv
}
will
hold an integer value; in the second example it will hold a string
hold an integer value; in the second example it will hold a string
value. The structure lay-out for the
\var
{
lockadata
}
variable is
value. The structure lay-out for the
\var
{
lockadata
}
variable is
system dependent --
therefore using the
\code
{
flock()
}
call may be
system dependent --
- therefore using the
\function
{
flock()
}
call may be
better.
better.
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