04-23-07 12:19 PM
seema <seema_coma@yahoo.co.in> writes:
>Hi all,
>I have a problem when I started debugging , select () call always
>returns -1. I have made a small sample
>that reproduces the problem, can some body indicate what is the
>problem here,
>#include <sys/time.h>
>int main(int argc, char *argv[])
>{
> fd_set fd_s;
> int lsock,ret;
> struct timeval timeout;
> timeout.tv_sec = 1;
> timeout.tv_usec = 0;
> lsock=3;
> FD_ZERO(&fd_s);
> FD_SET(lsock, &fd_s);
> ret=select(lsock+1,(void *)&fd_s, (void *)0, (void *)0,
>&timeout);
> printf ("%d",ret);
>}
>select() call always returns -1?
errno is probably always EBADF.
File descriptor 3 point to what file?
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
[ Post a follow-up to this message ]
|