blob: 354146f8e8438ce73260e382eec18b853fb9da96 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef _STDIO_EXT_H
2
3# include <stdio-common/stdio_ext.h>
4
5libc_hidden_proto (__fsetlocking)
6
7#define __fsetlocking(fp, type) \
8 ({ int __result = ((fp->_flags & _IO_USER_LOCK) \
9 ? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL); \
10 \
11 if (type != FSETLOCKING_QUERY) \
12 { \
13 fp->_flags &= ~_IO_USER_LOCK; \
14 if (type == FSETLOCKING_BYCALLER) \
15 fp->_flags |= _IO_USER_LOCK; \
16 } \
17 \
18 __result; \
19 })
20
21
22#endif