ddfabf89bb
2004-10-12 Frank Ch. Eigler <fche@redhat.com> * configure.ac: Check for more headers, functions. * mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for tracking overridden FILE buffers. (fopen, setvbuf): New/revised hook functions for buffer overriding. (setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto. (fflush): Accept given NULL stream (means "all streams"). * mf-runtime.h.in: * mf-runtime.c (__mfu_check): Accept accesses that span adjacent HEAP/GUESS objects. (LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively. (__mf_adapt_cache): Use them all. * testsuite/libmudflap.c/pass35-frag.c: Update warning message. * testsuite/libmudflap.c++/ctors.exp: Ditto. * testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests. * configure, config.h.in: Regenerated. From-SVN: r88996
37 lines
542 B
C
37 lines
542 B
C
#include <stdio.h>
|
|
|
|
|
|
void writestuff (FILE *f)
|
|
{
|
|
fprintf (f, "hello world\n");
|
|
fputc ('y', f);
|
|
putc ('e', f);
|
|
}
|
|
|
|
void readstuff (FILE *f)
|
|
{
|
|
int c, d;
|
|
char stuff[100], *s;
|
|
c = fgetc (f);
|
|
ungetc (c, f);
|
|
d = fgetc (f);
|
|
s = fgets (stuff, sizeof(stuff), f);
|
|
}
|
|
|
|
int main ()
|
|
{
|
|
FILE *f;
|
|
writestuff (stdout);
|
|
writestuff (stderr);
|
|
f = fopen ("/dev/null", "w");
|
|
writestuff (f);
|
|
fclose (f);
|
|
f = fopen ("/dev/zero", "r");
|
|
readstuff (f);
|
|
f = freopen ("/dev/null", "w", f);
|
|
writestuff (f);
|
|
fclose (f);
|
|
|
|
return 0;
|
|
}
|