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
8ee1a4bd
Kaydet (Commit)
8ee1a4bd
authored
Ock 25, 2001
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Provide a much better (and complete!) description of the lockf()
function, based on an eyeballing of the code.
üst
bd3dc1f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
libfcntl.tex
Doc/lib/libfcntl.tex
+38
-4
No files found.
Doc/lib/libfcntl.tex
Dosyayı görüntüle @
8ee1a4bd
...
...
@@ -53,10 +53,44 @@ See the \UNIX{} manual \manpage{flock}{3} for details. (On some
systems, this function is emulated using
\cfunction
{
fcntl()
}
.)
\end{funcdesc}
\begin{funcdesc}
{
lockf
}{
fd, code,
\optional
{
len,
\optional
{
start,
\optional
{
whence
}}}}
This is a wrapper around the
\constant
{
FCNTL.F
_
SETLK
}
and
\constant
{
FCNTL.F
_
SETLKW
}
\function
{
fcntl()
}
calls. See the
\UNIX
{}
manual for details.
\begin{funcdesc}
{
lockf
}{
fd, operation,
\optional
{
len,
\optional
{
start,
\optional
{
whence
}}}}
This is essentially a wrapper around the
\function
{
fcntl()
}
locking
calls.
\var
{
fd
}
is the file descriptor of the file to lock or unlock,
and
\var
{
operation
}
is one of the following values:
\begin{itemize}
\item
\constant
{
LOCK
_
UN
}
-- unlock
\item
\constant
{
LOCK
_
SH
}
-- acquire a shared lock
\item
\constant
{
LOCK
_
EX
}
-- acquire an exclusive lock
\end{itemize}
When
\var
{
operation
}
is
\constant
{
LOCK
_
SH
}
or
\constant
{
LOCK
_
EX
}
, it
can also be bit-wise OR'd with
\constant
{
LOCK
_
NB
}
to avoid blocking on
lock acquisition. If
\constant
{
LOCK
_
NB
}
is used and the lock cannot
be acquired, an
\exception
{
IOError
}
will be raised and the exception
will have an
\var
{
errno
}
attribute set to
\constant
{
EACCES
}
or
\constant
{
EAGAIN
}
(depending on the operating system; for portability,
check for both values).
\var
{
length
}
is the number of bytes to lock,
\var
{
start
}
is the byte
offset at which the lock starts, relative to
\var
{
whence
}
, and
\var
{
whence
}
is as with
\function
{
fileobj.seek()
}
, specifically:
\begin{itemize}
\item
\constant
{
0
}
-- relative to the start of the file
(
\constant
{
SEEK
_
SET
}
)
\item
\constant
{
1
}
-- relative to the current buffer position
(
\constant
{
SEEK
_
CUR
}
)
\item
\constant
{
2
}
-- relative to the end of the file
(
\constant
{
SEEK
_
END
}
)
\end{itemize}
The default for
\var
{
start
}
is 0, which means to start at the
beginning of the file. The default for
\var
{
length
}
is 0 which means
to lock to the end of the file. The default for
\var
{
whence
}
is also
0.
\end{funcdesc}
If the library modules
\module
{
FCNTL
}
\refstmodindex
{
FCNTL
}
or
...
...
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