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
4fbf798f
Kaydet (Commit)
4fbf798f
authored
Agu 04, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* myselect.h: bzero -> memset
* select.c: bzero -> memset; removed global variable
üst
f16eda5f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
myselect.h
Include/myselect.h
+1
-1
selectmodule.c
Modules/selectmodule.c
+12
-12
No files found.
Include/myselect.h
Dosyayı görüntüle @
4fbf798f
...
...
@@ -75,6 +75,6 @@ typedef struct fd_set {
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p)
bzero((char *)(p)
, sizeof(*(p)))
#define FD_ZERO(p)
memset((char *)(p), '\0'
, sizeof(*(p)))
#endif
/* FD_SET */
Modules/selectmodule.c
Dosyayı görüntüle @
4fbf798f
...
...
@@ -33,13 +33,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
static
object
*
SelectError
;
/* XXX This module should be re-entrant! */
static
object
*
fd2obj
[
FD_SETSIZE
];
static
list2set
(
list
,
set
)
list2set
(
list
,
set
,
fd2obj
)
object
*
list
;
fd_set
*
set
;
object
*
fd2obj
[
FD_SETSIZE
];
{
int
i
,
len
,
v
,
max
=-
1
;
object
*
o
,
*
filenomethod
,
*
fno
;
...
...
@@ -76,9 +74,10 @@ list2set(list, set)
}
static
object
*
set2list
(
set
,
max
)
set2list
(
set
,
max
,
fd2obj
)
fd_set
*
set
;
int
max
;
object
*
fd2obj
[
FD_SETSIZE
];
{
int
i
,
num
=
0
;
object
*
list
,
*
o
;
...
...
@@ -112,6 +111,7 @@ select_select(self, args)
object
*
self
;
object
*
args
;
{
object
*
fd2obj
[
FD_SETSIZE
];
object
*
ifdlist
,
*
ofdlist
,
*
efdlist
;
fd_set
ifdset
,
ofdset
,
efdset
;
double
timeout
;
...
...
@@ -141,14 +141,14 @@ select_select(self, args)
return
0
;
}
bzero
((
char
*
)
fd2obj
,
sizeof
(
fd2obj
));
/* Not really needed */
memset
((
char
*
)
fd2obj
,
'\0'
,
sizeof
(
fd2obj
));
/* Convert lists to fd_sets, and get maximum fd number */
if
(
(
imax
=
list2set
(
ifdlist
,
&
ifdset
))
<
0
)
if
(
(
imax
=
list2set
(
ifdlist
,
&
ifdset
,
fd2obj
))
<
0
)
return
0
;
if
(
(
omax
=
list2set
(
ofdlist
,
&
ofdset
))
<
0
)
if
(
(
omax
=
list2set
(
ofdlist
,
&
ofdset
,
fd2obj
))
<
0
)
return
0
;
if
(
(
emax
=
list2set
(
efdlist
,
&
efdset
))
<
0
)
if
(
(
emax
=
list2set
(
efdlist
,
&
efdset
,
fd2obj
))
<
0
)
return
0
;
max
=
imax
;
if
(
omax
>
max
)
max
=
omax
;
...
...
@@ -164,9 +164,9 @@ select_select(self, args)
if
(
n
==
0
)
imax
=
omax
=
emax
=
0
;
/* Speedup hack */
ifdlist
=
set2list
(
&
ifdset
,
imax
);
ofdlist
=
set2list
(
&
ofdset
,
omax
);
efdlist
=
set2list
(
&
efdset
,
emax
);
ifdlist
=
set2list
(
&
ifdset
,
imax
,
fd2obj
);
ofdlist
=
set2list
(
&
ofdset
,
omax
,
fd2obj
);
efdlist
=
set2list
(
&
efdset
,
emax
,
fd2obj
);
return
mkvalue
(
"OOO"
,
ifdlist
,
ofdlist
,
efdlist
);
}
...
...
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