2004-03-26 22:17:07 +01:00
|
|
|
/* sys/stdio.h
|
|
|
|
|
2013-01-21 05:38:31 +01:00
|
|
|
Copyright 2004, 2005, 2006, 2007, 2008, 2010 Red Hat, Inc.
|
2004-03-26 22:17:07 +01:00
|
|
|
|
|
|
|
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_
|
|
|
|
|
2005-07-09 10:22:39 +02:00
|
|
|
#include <sys/cdefs.h>
|
2004-03-26 22:17:07 +01:00
|
|
|
#include <sys/lock.h>
|
|
|
|
|
2007-09-06 20:47:44 +02:00
|
|
|
/* These definitions should be kept in sync with those in the newlib
|
|
|
|
header of the same name (newlib/libc/include/sys/stdio.h). */
|
|
|
|
|
2004-03-26 22:17:07 +01:00
|
|
|
#if !defined(__SINGLE_THREAD__)
|
|
|
|
# if !defined(_flockfile)
|
2007-09-06 20:47:44 +02:00
|
|
|
# define _flockfile(fp) ({ if (!((fp)->_flags & __SSTR)) \
|
2008-02-15 18:53:11 +01:00
|
|
|
__cygwin_lock_lock ((_LOCK_T *)&(fp)->_lock); })
|
2004-03-26 22:17:07 +01:00
|
|
|
# endif
|
2004-05-17 18:06:02 +02:00
|
|
|
# if !defined(_ftrylockfile)
|
2007-09-06 20:47:44 +02:00
|
|
|
# define _ftrylockfile(fp) (((fp)->_flags & __SSTR) ? 0 : \
|
2008-02-15 18:53:11 +01:00
|
|
|
__cygwin_lock_trylock ((_LOCK_T *)&(fp)->_lock))
|
2004-05-17 18:06:02 +02:00
|
|
|
# endif
|
2004-03-26 22:17:07 +01:00
|
|
|
# if !defined(_funlockfile)
|
2007-09-06 20:47:44 +02:00
|
|
|
# define _funlockfile(fp) ({ if (!((fp)->_flags & __SSTR)) \
|
2008-02-15 18:53:11 +01:00
|
|
|
__cygwin_lock_unlock ((_LOCK_T *)&(fp)->_lock); })
|
2004-03-26 22:17:07 +01:00
|
|
|
# endif
|
|
|
|
#endif
|
2005-05-02 05:50:11 +02:00
|
|
|
|
2005-07-09 10:22:39 +02:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
ssize_t _EXFUN(getline, (char **, size_t *, FILE *));
|
|
|
|
ssize_t _EXFUN(getdelim, (char **, size_t *, int, FILE *));
|
|
|
|
|
|
|
|
__END_DECLS
|
2005-07-08 10:24:13 +02:00
|
|
|
|
2004-03-26 22:17:07 +01:00
|
|
|
#endif
|