Date: Fri, 3 Aug 2001 12:21:42 +0100 From: "Ullasan Kottummal" <ullasan.kottummal@uk.zurich.com> To: freebsd-hackers@freebsd.org Subject: Select call gives EBADF Message-ID: <OF7573D16B.3BCF5B08-ON80256A9D.003E5851@zurich.com>
index | next in thread | raw e-mail
Hi,
I am using select() call under HP-UX 10.20 for timing on socket. It throws
the error EBADF. I don't understand why it happens.
The socket is opened successfully before calling the select and the
descriptor is valid.
I will give the relevant code below.
int mask;
struct fd_set readmask ;
readmask.fds_bits[0] = 0;
struct fd_set readfds;
int nfound, i;
struct timeval timeout;
mask = MASK(m_iSocket);
readmask.fds_bits[0] |= mask;
readfds.fds_bits[0] = readmask.fds_bits[0];
timeout.tv_sec = m_iSelectTimeout;
timeout.tv_usec = 0;
FD_ZERO(&readfds);
if ((nfound = select (SOCKETS, &readfds, 0, 0, &timeout)) == -1)
{
cerr << "==>Select call failed : " << endl;
//Errror checking done
.......
........
}
Thanks in advance
Regards
Ullasan
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OF7573D16B.3BCF5B08-ON80256A9D.003E5851>
