From owner-freebsd-hackers Fri Aug 3 4:23:35 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mtach2.zurich.com (chmail2.zurich.com [195.28.226.82]) by hub.freebsd.org (Postfix) with ESMTP id A849F37B407 for ; Fri, 3 Aug 2001 04:23:27 -0700 (PDT) (envelope-from ullasan.kottummal@uk.zurich.com) Subject: Select call gives EBADF To: freebsd-hackers@freebsd.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: "Ullasan Kottummal" Date: Fri, 3 Aug 2001 12:21:42 +0100 X-MIMETrack: Serialize by Router on CHKNH021/Zurich-Internet(Release 5.0.8 |June 18, 2001) at 03.08.2001 13:22:06 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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