2021-01-27 19:34:02 -08:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_STDIO_FFLUSH_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_STDIO_FFLUSH_H_
|
|
|
|
#include "libc/stdio/stdio.h"
|
2022-10-03 13:43:52 -07:00
|
|
|
#include "libc/thread/thread.h"
|
|
|
|
#include "libc/thread/tls.h"
|
2021-01-27 19:34:02 -08:00
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
struct StdioFlushHandles {
|
|
|
|
size_t i, n;
|
|
|
|
FILE **p;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StdioFlush {
|
|
|
|
struct StdioFlushHandles handles;
|
|
|
|
FILE *handles_initmem[8];
|
|
|
|
};
|
|
|
|
|
2023-07-24 08:31:54 -07:00
|
|
|
extern struct StdioFlush __fflush;
|
|
|
|
extern pthread_mutex_t __fflush_lock_obj;
|
2021-01-27 19:34:02 -08:00
|
|
|
|
2022-06-12 11:47:20 -07:00
|
|
|
void __fflush_lock(void);
|
|
|
|
void __fflush_unlock(void);
|
2022-06-12 19:33:42 -07:00
|
|
|
|
2021-01-27 19:34:02 -08:00
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_STDIO_FFLUSH_H_ */
|