about summary refs log tree commit diff
path: root/nptl/semaphoreP.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-05-17 20:53:32 +0000
committerUlrich Drepper <drepper@redhat.com>2003-05-17 20:53:32 +0000
commitfddfebbd1064dec313891ad91dd9ca6e92e622ec (patch)
treeed231a996e804653468ac2916a0d4b32628c0093 /nptl/semaphoreP.h
parent68a396e83a8e1e50d0dfde8ffb090a8df311453f (diff)
downloadglibc-fddfebbd1064dec313891ad91dd9ca6e92e622ec.tar.gz
glibc-fddfebbd1064dec313891ad91dd9ca6e92e622ec.tar.xz
glibc-fddfebbd1064dec313891ad91dd9ca6e92e622ec.zip
Update.
2003-05-17  Ulrich Drepper  <drepper@redhat.com>

	* sem_open.c: Fix one endless loop.  Implement correct semantics
	wrt opening the same semaphore more then once.
	* sem_close.c: Adjust for sem_open change.
	* semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
	Declare __sem_mappings, __sem_mappings_lock, __sem_search.
	* Makefile (tests): Add tst-sem7.
	* tst-sem7.c: New file.
Diffstat (limited to 'nptl/semaphoreP.h')
-rw-r--r--nptl/semaphoreP.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/nptl/semaphoreP.h b/nptl/semaphoreP.h
index 0d3f6e53a0..d14ea92c74 100644
--- a/nptl/semaphoreP.h
+++ b/nptl/semaphoreP.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -17,8 +17,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <semaphore.h>
 #include "pthreadP.h"
 
+
 /* Mount point of the shared memory filesystem.  */
 struct mountpoint_info
 {
@@ -26,16 +28,35 @@ struct mountpoint_info
   size_t dirlen;
 };
 
+/* Keeping track of currently used mappings.  */
+struct inuse_sem
+{
+  dev_t dev;
+  ino_t ino;
+  int refcnt;
+  sem_t *sem;
+  char name[0];
+};
+
 
 /* Variables used in multiple interfaces.  */
 extern struct mountpoint_info mountpoint attribute_hidden;
 
 extern pthread_once_t __namedsem_once attribute_hidden;
 
+/* The search tree for existing mappings.  */
+extern void *__sem_mappings attribute_hidden;
+
+/* Lock to protect the search tree.  */
+extern lll_lock_t __sem_mappings_lock;
+
 
 /* Initializer for mountpoint.  */
 extern void __where_is_shmfs (void) attribute_hidden;
 
+/* Comparison function for search in tree with existing mappings.  */
+extern int __sem_search (const void *a, const void *b) attribute_hidden;
+
 
 /* Prototypes of functions with multiple interfaces.  */
 extern int __new_sem_init (sem_t *sem, int pshared, unsigned int value);