summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-05-17 16:06:02 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-05-17 16:06:02 +0000
commit68509b303eb9d091068adf651385c29c41a8f458 (patch)
tree39b0c6a04fe2571166c8a9025bb0973858429e03 /winsup/cygwin/include
parent3271e9f9e38cb9d0e51554680f1f87c3ea3fe5f7 (diff)
downloadcygnal-68509b303eb9d091068adf651385c29c41a8f458.tar.gz
cygnal-68509b303eb9d091068adf651385c29c41a8f458.tar.bz2
cygnal-68509b303eb9d091068adf651385c29c41a8f458.zip
* cygwin.din: Add symbols flockfile, ftrylockfile, funlockfile,
getgrgid_r, getgrnam_r and getlogin_r. * grp.cc (getgrgid_r): New function. (getgrnam_r): Ditto. * syscalls.cc (flockfile): Ditto. (ftrylockfile): Ditto. (funlockfile): Ditto. * sysconf.cc (sysconf): Return LOGIN_NAME_MAX in case of _SC_LOGIN_NAME_MAX. * thread.cc (__cygwin_lock_trylock): Define int. Return value from call to pthread_mutex_trylock. * uinfo.cc (getlogin_r): New function. * include/limits.h: Define LOGIN_NAME_MAX. * include/cygwin/version.h: Bump API minor number. * include/sys/lock.h: Add declarations for __cygwin_lock_xxx functions. * include/sys/stdio.h: Add define for _ftrylockfile.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r--winsup/cygwin/include/cygwin/version.h4
-rw-r--r--winsup/cygwin/include/limits.h4
-rw-r--r--winsup/cygwin/include/sys/lock.h14
-rw-r--r--winsup/cygwin/include/sys/stdio.h3
4 files changed, 24 insertions, 1 deletions
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index b63fcc15b..cc669604d 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -241,12 +241,14 @@ details. */
113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as
on Linux.
114: Export rand_r, ttyname_r.
+ 115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r,
+ getlogin_r.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 114
+#define CYGWIN_VERSION_API_MINOR 115
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h
index 579dc9c38..25136acdf 100644
--- a/winsup/cygwin/include/limits.h
+++ b/winsup/cygwin/include/limits.h
@@ -151,6 +151,10 @@ details. */
#undef TIMER_MAX
#define TIMER_MAX 32
+/* Maximum number of characters in a login name. */
+#undef LOGIN_NAME_MAX
+#define LOGIN_NAME_MAX 256 /* equal to UNLEN defined in w32api/lmcons.h */
+
/* Maximum number of characters in a tty name. */
#undef TTY_NAME_MAX
#define TTY_NAME_MAX 12
diff --git a/winsup/cygwin/include/sys/lock.h b/winsup/cygwin/include/sys/lock.h
index c0cc6fac7..ad0980ab0 100644
--- a/winsup/cygwin/include/sys/lock.h
+++ b/winsup/cygwin/include/sys/lock.h
@@ -37,4 +37,18 @@ typedef void *_LOCK_T;
#define __lock_release(__lock) __cygwin_lock_unlock(&__lock)
#define __lock_release_recursive(__lock) __cygwin_lock_unlock(&__lock)
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+void __cygwin_lock_init(_LOCK_T *);
+void __cygwin_lock_init_recursive(_LOCK_T *);
+void __cygwin_lock_fini(_LOCK_T *);
+void __cygwin_lock_lock(_LOCK_T *);
+int __cygwin_lock_trylock(_LOCK_T *);
+void __cygwin_lock_unlock(_LOCK_T *);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/winsup/cygwin/include/sys/stdio.h b/winsup/cygwin/include/sys/stdio.h
index 04d8ffcaf..686ad534f 100644
--- a/winsup/cygwin/include/sys/stdio.h
+++ b/winsup/cygwin/include/sys/stdio.h
@@ -17,6 +17,9 @@ details. */
# if !defined(_flockfile)
# define _flockfile(fp) __cygwin_lock_lock ((_LOCK_T *)&(fp)->_lock)
# endif
+# if !defined(_ftrylockfile)
+# define _ftrylockfile(fp) __cygwin_lock_trylock ((_LOCK_T *)&(fp)->_lock)
+# endif
# if !defined(_funlockfile)
# define _funlockfile(fp) __cygwin_lock_unlock ((_LOCK_T *)&(fp)->_lock)
# endif