Update select.c

This commit is contained in:
heyuanjie87 2018-08-13 22:42:09 +08:00 committed by GitHub
parent d948dba42a
commit c90b449dac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,11 @@ static void fdzero(fd_set *set, int nfds)
{
fd_mask *m;
int n;
/*
The 'sizeof(fd_set)' of the system space may differ from user space,
so the actual size of the 'fd_set' is determined here with the parameter 'nfds'
*/
m = (fd_mask*)set;
for (n = 0; n < nfds; n += (sizeof(fd_mask) * 8))
{