#define UNGET 8
-#define FLOCK(f) ((libc.threads_minus_1 && (f)->lock>=0) ? (__lockfile((f)),0) : 0)
-#define FUNLOCK(f) ((f)->lockcount && (--(f)->lockcount || ((f)->lock=0)))
+#define FLOCK(f) int __need_unlock = ((f)->lock>=0 ? __lockfile((f)) : 0)
+#define FUNLOCK(f) if (__need_unlock) __unlockfile((f)); else
#define F_PERM 1
#define F_NORD 4
FILE *prev, *next;
int fd;
int pipe_pid;
- long dummy2;
+ long lockcount;
short dummy3;
signed char mode;
signed char lbf;
int lock;
- int lockcount;
+ int waiters;
void *cookie;
off_t off;
int (*flush)(FILE *);
void *mustbezero_2;
+ unsigned char *shend;
+ off_t shlim, shcnt;
};
size_t __stdio_read(FILE *, unsigned char *, size_t);
#define OFLLOCK() LOCK(&libc.ofl_lock)
#define OFLUNLOCK() UNLOCK(&libc.ofl_lock)
-#define ofl_head (libc.ofl_head)
#define feof(f) ((f)->flags & F_EOF)
#define ferror(f) ((f)->flags & F_ERR)