Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-03-27 00:17:07 +0300
committerChristopher Faylor <me@cgf.cx>2004-03-27 00:17:07 +0300
commit359b6e4c49105718a9ff5341172685d98790dd7e (patch)
tree83732cc575cd638c635f99c6faf5826dd8212fa3 /winsup/cygwin/include
parent11a9a1cfbd9eb8f1c3670a253c561915af168407 (diff)
add missing files
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r--winsup/cygwin/include/cygwin/_types.h16
-rw-r--r--winsup/cygwin/include/sys/lock.h40
-rw-r--r--winsup/cygwin/include/sys/stdio.h25
3 files changed, 81 insertions, 0 deletions
diff --git a/winsup/cygwin/include/cygwin/_types.h b/winsup/cygwin/include/cygwin/_types.h
new file mode 100644
index 000000000..b96267622
--- /dev/null
+++ b/winsup/cygwin/include/cygwin/_types.h
@@ -0,0 +1,16 @@
+/* cygwin/_types.h
+
+ Copyright 2004 Red Hat, Inc.
+
+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 _CYGWIN__TYPES_H
+#define _CYGWIN__TYPES_H
+
+typedef void *_flock_t;
+
+#endif /* _CYGWIN__TYPES_H */
diff --git a/winsup/cygwin/include/sys/lock.h b/winsup/cygwin/include/sys/lock.h
new file mode 100644
index 000000000..c0cc6fac7
--- /dev/null
+++ b/winsup/cygwin/include/sys/lock.h
@@ -0,0 +1,40 @@
+/* sys/lock.h
+
+ Copyright 2004 Red Hat, Inc.
+
+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_LOCK_H_
+#define _SYS_LOCK_H_
+
+typedef void *_LOCK_T;
+#define _LOCK_RECURSIVE_T _LOCK_T
+
+/*
+ * This must match cygwins PTHREAD_XXX_MUTEX_INITIALIZER_NP which are
+ * defined in <pthread.h>
+ */
+#define _LOCK_T_RECURSIVE_INITIALIZER ((_LOCK_T)18)
+#define _LOCK_T_INITIALIZER ((_LOCK_T)19)
+
+#define __LOCK_INIT(CLASS,NAME) \
+ CLASS _LOCK_T NAME = _LOCK_T_INITIALIZER;
+#define __LOCK_INIT_RECURSIVE(CLASS,NAME) \
+ CLASS _LOCK_T NAME = _LOCK_T_RECURSIVE_INITIALIZER;
+
+#define __lock_init(__lock) __cygwin_lock_init(&__lock)
+#define __lock_init_recursive(__lock) __cygwin_lock_init_recursive(&__lock)
+#define __lock_close(__lock) __cygwin_lock_fini(&__lock)
+#define __lock_close_recursive(__lock) __cygwin_lock_fini(&__lock)
+#define __lock_acquire(__lock) __cygwin_lock_lock(&__lock)
+#define __lock_acquire_recursive(__lock) __cygwin_lock_lock(&__lock)
+#define __lock_try_acquire(lock) __cygwin_lock_trylock(&__lock)
+#define __lock_try_acquire_recursive(lock) __cygwin_lock_trylock(&__lock)
+#define __lock_release(__lock) __cygwin_lock_unlock(&__lock)
+#define __lock_release_recursive(__lock) __cygwin_lock_unlock(&__lock)
+
+#endif
diff --git a/winsup/cygwin/include/sys/stdio.h b/winsup/cygwin/include/sys/stdio.h
new file mode 100644
index 000000000..04d8ffcaf
--- /dev/null
+++ b/winsup/cygwin/include/sys/stdio.h
@@ -0,0 +1,25 @@
+/* sys/stdio.h
+
+ Copyright 2004 Red Hat, Inc.
+
+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/lock.h>
+
+#if !defined(__SINGLE_THREAD__)
+# if !defined(_flockfile)
+# define _flockfile(fp) __cygwin_lock_lock ((_LOCK_T *)&(fp)->_lock)
+# endif
+# if !defined(_funlockfile)
+# define _funlockfile(fp) __cygwin_lock_unlock ((_LOCK_T *)&(fp)->_lock)
+# endif
+#endif
+
+#endif