summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include/sys/stdio.h
blob: ac22a39400779e4330b89f3d73bdae6280ac58e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* sys/stdio.h

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#ifndef _SYS_STDIO_H_
#define _SYS_STDIO_H_

#include <sys/cdefs.h>
#include <sys/lock.h>

/* These definitions should be kept in sync with those in the newlib
   header of the same name (newlib/libc/include/sys/stdio.h).  */

#if !defined(__SINGLE_THREAD__)
#  if !defined(_flockfile)
#    define _flockfile(fp) ({ if (!((fp)->_flags & __SSTR)) \
		  __cygwin_lock_lock ((_LOCK_T *)&(fp)->_lock); })
#  endif
#  if !defined(_ftrylockfile)
#    define _ftrylockfile(fp) (((fp)->_flags & __SSTR) ? 0 : \
		  __cygwin_lock_trylock ((_LOCK_T *)&(fp)->_lock))
#  endif
#  if !defined(_funlockfile)
#    define _funlockfile(fp) ({ if (!((fp)->_flags & __SSTR)) \
		  __cygwin_lock_unlock ((_LOCK_T *)&(fp)->_lock); })
#  endif
#endif

__BEGIN_DECLS

ssize_t	_EXFUN(getline, (char **, size_t *, FILE *));
ssize_t	_EXFUN(getdelim, (char **, size_t *, int, FILE *));

__END_DECLS

#endif