[PATCH v2] libio: Add test case for fflush

Florian Weimer fweimer@redhat.com
Wed Nov 6 17:10:50 GMT 2024


* Frédéric Bérat:

> I also tested the following:
> 	char s[3] = "";
> 	fgets (s, 2, FILE);
> 	ungetc (s[1], FILE);
> 	fflush (FILE);
> 	pos = lseek (SEEK_CUR);
>
> Which gives a `pos` value of 2.

What's the file contents at this point, and where does fgets start
reading?

Thanks,
Florian



More information about the Libc-alpha mailing list