This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A libio patch


> 
> > This is needed by VSX-PCT. It is how TET used by VSX-PCT works.
> 
> With a subtle change like this, please always describe the specific
> behavior that you consider erroneous and are attempting to fix.  POSIX.1

It is in the comments of my patch. Consider


	FILE *fp = fopen ("foo", "a+");

	if (fork () == 0)
	  {
	    fprintf (fp, "hello world");
	    fclose (fp);
	  }
	else
	  {
	     wait for child to exit.
	     fseek (fp, 0, SEEK_SET);
	     fgets (buf, len, fp);
	     printf ("%s\n", buf);
	     fclose (fp);
	  }

What should the parent get from "fp"?

> gives a precise set of rules for when streams and fds must be in synch, and
> it can be a grave performance hit to force them into synch at other times
> when it is not strictly required.  An fseek or fsetpos call is indeed
> required to synch the stream with its fd, but not ftell or fgetpos, and
> only a specific set of other situations.
> 

I think Ulrich has fixed it.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]