Mail Archives: djgpp/1997/07/01/23:19:07
Michael Mauch wrote:
>
> Hi!
>
> fseek() in DJGPP v2.01 seems to have a bug: it returns 0 for success
> when it should not:
>
> #include <stdio.h>
>
> int main(void)
> {
> FILE* f = fopen("fseekt.c","rb");
>
> if(f)
> {
> printf("fseek(f,-4096L,SEEK_END)=%d\n",fseek(f,-4096L,SEEK_END));
> fclose(f);
> }
>
> return 0;
> }
this is what the ANSI standard says (according to an excerpt on p.249 of
Plauger's "The Standard C Library")
7.9.9.2
...
A binary stream need not meaningfully support fseek calls with a whence
value of SEEK_END.
...
Returns:
The fseek function returns nonzero only for a request that cannot be
satisfied.
compare the first line of your post with this information.
--
Sinan
*******************************************************************
A. Sinan Unur WWWWWW
|--O+O
mailto:sinan DOT unur AT cornell DOT edu C ^
http://www.people.cornell.edu/pages/asu1/ \ ~/
Unsolicited e-mail is _not_ welcome, and will be billed for.
*******************************************************************
- Raw text -