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
255bf5b9
Kaydet (Commit)
255bf5b9
authored
Mar 03, 2013
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16962: Use getdents64 instead of the obsolete getdents syscall in
the subprocess module on Linux.
üst
bce9a5d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
17 deletions
+11
-17
NEWS
Misc/NEWS
+3
-3
_posixsubprocess.c
Modules/_posixsubprocess.c
+8
-14
No files found.
Misc/NEWS
Dosyayı görüntüle @
255bf5b9
...
...
@@ -191,6 +191,9 @@ Core and Builtins
Library
-------
- Issue #16962: Use getdents64 instead of the obsolete getdents syscall
in the subprocess module on Linux.
- Issue #17018: Make Process.join() retry if os.waitpid() fails with EINTR.
- Issue #14720: sqlite3: Convert datetime microseconds correctly.
...
...
@@ -626,9 +629,6 @@ Library
- Issue #15906: Fix a regression in `argparse` caused by the preceding change,
when ``action='
append
'``, ``type='
str
'`` and ``default=[]``.
Extension Modules
-----------------
- Issue #12268: The io module file object write methods no longer abort early
when one of its write system calls is interrupted (EINTR).
...
...
Modules/_posixsubprocess.c
Dosyayı görüntüle @
255bf5b9
...
...
@@ -176,17 +176,11 @@ _close_fds_by_brute_force(int start_fd, int end_fd, PyObject *py_fds_to_keep)
* This structure is very old and stable: It will not change unless the kernel
* chooses to break compatibility with all existing binaries. Highly Unlikely.
*/
struct
linux_dirent
{
#if defined(__x86_64__) && defined(__ILP32__)
/* Support the wacky x32 ABI (fake 32-bit userspace speaking to x86_64
* kernel interfaces) - https://sites.google.com/site/x32abi/ */
struct
linux_dirent64
{
unsigned
long
long
d_ino
;
unsigned
long
long
d_off
;
#else
unsigned
long
d_ino
;
/* Inode number */
unsigned
long
d_off
;
/* Offset to next linux_dirent */
#endif
long
long
d_off
;
unsigned
short
d_reclen
;
/* Length of this linux_dirent */
unsigned
char
d_type
;
char
d_name
[
256
];
/* Filename (null-terminated) */
};
...
...
@@ -228,16 +222,16 @@ _close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep)
_close_fds_by_brute_force
(
start_fd
,
end_fd
,
py_fds_to_keep
);
return
;
}
else
{
char
buffer
[
sizeof
(
struct
linux_dirent
)];
char
buffer
[
sizeof
(
struct
linux_dirent
64
)];
int
bytes
;
while
((
bytes
=
syscall
(
SYS_getdents
,
fd_dir_fd
,
(
struct
linux_dirent
*
)
buffer
,
while
((
bytes
=
syscall
(
SYS_getdents
64
,
fd_dir_fd
,
(
struct
linux_dirent
64
*
)
buffer
,
sizeof
(
buffer
)))
>
0
)
{
struct
linux_dirent
*
entry
;
struct
linux_dirent
64
*
entry
;
int
offset
;
for
(
offset
=
0
;
offset
<
bytes
;
offset
+=
entry
->
d_reclen
)
{
int
fd
;
entry
=
(
struct
linux_dirent
*
)(
buffer
+
offset
);
entry
=
(
struct
linux_dirent
64
*
)(
buffer
+
offset
);
if
((
fd
=
_pos_int_from_ascii
(
entry
->
d_name
))
<
0
)
continue
;
/* Not a number. */
if
(
fd
!=
fd_dir_fd
&&
fd
>=
start_fd
&&
fd
<
end_fd
&&
...
...
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