diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-03-05 18:24:24 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-03-05 18:24:24 +0000 |
commit | 07e9194eecf9d0db9856bc7405f5030d83eccadc (patch) | |
tree | 6a7b4889ea01bfd15afdc3fbbc3140acf0e78e5c /cpukit/libcsupport/src/sync.c | |
parent | 2004-03-05 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-07e9194eecf9d0db9856bc7405f5030d83eccadc.tar.bz2 |
2004-03-05 Joel Sherrill <joel@OARcorp.com>
* libcsupport/src/newlibc.c, libcsupport/src/sync.c: Eliminate
warnings. Explicitly defeat __STRICT_ANSI__ since both
legitimately use routines beyond ANSI.
Diffstat (limited to '')
-rw-r--r-- | cpukit/libcsupport/src/sync.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c index 4d317ce0b1..8d1f52e725 100644 --- a/cpukit/libcsupport/src/sync.c +++ b/cpukit/libcsupport/src/sync.c @@ -21,6 +21,13 @@ #include "config.h" #endif +/* Since we compile with strict ANSI we need to undef it to get + * prototypes for extensions + */ +#undef __STRICT_ANSI__ +int fdatasync(int); /* still not always prototyped */ + + #include <unistd.h> #include <stdio.h> @@ -35,6 +42,7 @@ /* XXX check standards -- Linux version appears to be void */ void _fwalk(struct _reent *, void *); + static void sync_wrapper(FILE *f) { int fn = fileno(f); @@ -60,6 +68,22 @@ static void sync_per_thread(Thread_Control *t) int sync(void) { + extern struct _reent libc_global_reent; + + /* + * Walk the one used initially by RTEMS. + */ + _fwalk(&libc_global_reent, sync_wrapper); + + /* + * XXX Do we walk the one used globally by newlib? + * XXX Do we need the RTEMS global one? + */ + + /* + * Now walk all the per-thread reentrancy structures. + */ rtems_iterate_over_all_threads(sync_per_thread); + return 0; } |