Bug in b18?: lseek( 0, 0, SEEK_CUR ) returns EBADF

Peter F. Caswell pfc@maker.com
Thu Jan 22 16:37:00 GMT 1998


I'm trying to use tcl v8.0 to get timers and interactive I/O working at the
same time. To do that, I'm stealing a trick from tk and setting up a
channel handler for stdin.

Well, when you call Tcl_GetDefaultStdChannel( TCL_STDIN ), the file
tclUnixChan.c calls "lseek(0, (off_t)0, SEEK_CUR)" and checks for a failure
with EBADF. I assume that this is there to check if stdin (fileno 0) really
is open.

Well, lseek is returning -1, and errno is set to EBADF. Yet, if I call
fstat(0,...), this works fine. Obviously the file is there, but lseek is
getting confused. Is it simply setting the wrong errno.

I haven't pulled the sources for the library across, so I don't know what
the lseek code is doing.


I'm also having some problems getting further stuff to work with the
background processing. It seems like select is swallowing the first
character typed. But I haven't tracked this down yet.

-pfc


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list