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