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
056bad99
Kaydet (Commit)
056bad99
authored
Ock 06, 1999
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Changes for long file support by Steve Clift.
He also fixes thread-related evil that caused core dumps.
üst
94f6f72c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
9 deletions
+33
-9
fcntlmodule.c
Modules/fcntlmodule.c
+33
-9
No files found.
Modules/fcntlmodule.c
Dosyayı görüntüle @
056bad99
...
...
@@ -178,9 +178,10 @@ fcntl_flock(self, args)
if
(
!
PyArg_Parse
(
args
,
"(ii)"
,
&
fd
,
&
code
))
return
NULL
;
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_FLOCK
Py_BEGIN_ALLOW_THREADS
ret
=
flock
(
fd
,
code
);
Py_END_ALLOW_THREADS
#else
#ifndef LOCK_SH
...
...
@@ -203,10 +204,11 @@ fcntl_flock(self, args)
return
NULL
;
}
l
.
l_whence
=
l
.
l_start
=
l
.
l_len
=
0
;
Py_BEGIN_ALLOW_THREADS
ret
=
fcntl
(
fd
,
(
code
&
LOCK_NB
)
?
F_SETLK
:
F_SETLKW
,
&
l
);
Py_END_ALLOW_THREADS
}
#endif
/* HAVE_FLOCK */
Py_END_ALLOW_THREADS
if
(
ret
<
0
)
{
PyErr_SetFromErrno
(
PyExc_IOError
);
return
NULL
;
...
...
@@ -229,13 +231,13 @@ fcntl_lockf(self, args)
PyObject
*
self
;
/* Not used */
PyObject
*
args
;
{
int
fd
,
code
,
len
=
0
,
start
=
0
,
whence
=
0
,
ret
;
int
fd
,
code
,
ret
,
whence
=
0
;
PyObject
*
lenobj
=
NULL
,
*
startobj
=
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"ii|
iii"
,
&
fd
,
&
code
,
&
len
,
&
start
,
&
whence
))
if
(
!
PyArg_ParseTuple
(
args
,
"ii|
OOi"
,
&
fd
,
&
code
,
&
lenobj
,
&
startobj
,
&
whence
))
return
NULL
;
Py_BEGIN_ALLOW_THREADS
#ifndef LOCK_SH
#define LOCK_SH 1
/* shared lock */
#define LOCK_EX 2
/* exclusive lock */
...
...
@@ -255,12 +257,34 @@ fcntl_lockf(self, args)
"unrecognized flock argument"
);
return
NULL
;
}
l
.
l_len
=
len
;
l
.
l_start
=
start
;
l
.
l_start
=
l
.
l_len
=
0
;
if
(
startobj
!=
NULL
)
{
#if !defined(HAVE_LARGEFILE_SUPPORT)
l
.
l_start
=
PyInt_AsLong
(
startobj
);
#else
l
.
l_start
=
PyLong_Check
(
startobj
)
?
PyLong_AsLongLong
(
startobj
)
:
PyInt_AsLong
(
startobj
);
#endif
if
(
PyErr_Occurred
())
return
NULL
;
}
if
(
lenobj
!=
NULL
)
{
#if !defined(HAVE_LARGEFILE_SUPPORT)
l
.
l_len
=
PyInt_AsLong
(
lenobj
);
#else
l
.
l_len
=
PyLong_Check
(
lenobj
)
?
PyLong_AsLongLong
(
lenobj
)
:
PyInt_AsLong
(
lenobj
);
#endif
if
(
PyErr_Occurred
())
return
NULL
;
}
l
.
l_whence
=
whence
;
Py_BEGIN_ALLOW_THREADS
ret
=
fcntl
(
fd
,
(
code
&
LOCK_NB
)
?
F_SETLK
:
F_SETLKW
,
&
l
);
Py_END_ALLOW_THREADS
}
Py_END_ALLOW_THREADS
if
(
ret
<
0
)
{
PyErr_SetFromErrno
(
PyExc_IOError
);
return
NULL
;
...
...
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