* sysdeps/unix/sysv/linux/x86_64/sysconf.c: Move cache information
[glibc.git] / nptl / semaphoreP.h
blob754609a1a82fbbe8a2096df7032bdfdaeeae5ffa
1 /* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #include <semaphore.h>
21 #include "pthreadP.h"
24 /* Mount point of the shared memory filesystem. */
25 struct mountpoint_info
27 char *dir;
28 size_t dirlen;
31 /* Keeping track of currently used mappings. */
32 struct inuse_sem
34 dev_t dev;
35 ino_t ino;
36 int refcnt;
37 sem_t *sem;
38 char name[0];
42 /* Variables used in multiple interfaces. */
43 extern struct mountpoint_info mountpoint attribute_hidden;
45 extern pthread_once_t __namedsem_once attribute_hidden;
47 /* The search tree for existing mappings. */
48 extern void *__sem_mappings attribute_hidden;
50 /* Lock to protect the search tree. */
51 extern lll_lock_t __sem_mappings_lock attribute_hidden;
54 /* Initializer for mountpoint. */
55 extern void __where_is_shmfs (void) attribute_hidden;
57 /* Comparison function for search in tree with existing mappings. */
58 extern int __sem_search (const void *a, const void *b) attribute_hidden;
61 /* Prototypes of functions with multiple interfaces. */
62 extern int __new_sem_init (sem_t *sem, int pshared, unsigned int value);
63 extern int __new_sem_destroy (sem_t *sem);
64 extern int __new_sem_post (sem_t *sem);
65 extern int __new_sem_wait (sem_t *sem);
66 extern int __new_sem_trywait (sem_t *sem);
67 extern int __new_sem_getvalue (sem_t *sem, int *sval);