]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/mach/hurd/malloc-machine.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / mach / hurd / malloc-machine.h
index f04947fe9865ce55ebd3aa3b273ecf9833752a8c..87ef2a80ffe3e3a44686a33e1094758692b033c2 100644 (file)
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    thread-specific data and parameters for malloc.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef _MALLOC_MACHINE_H
 #define _MALLOC_MACHINE_H
 
-#undef thread_atfork_static
-
 #include <atomic.h>
-#include <bits/libc-lock.h>
-
-/* Assume hurd, with cthreads */
-
-/* Cthreads `mutex_t' is a pointer to a mutex, and malloc wants just the
-   mutex itself.  */
-#undef mutex_t
-#define mutex_t struct mutex
-
-#undef mutex_init
-#define mutex_init(m) (__mutex_init(m), 0)
-
-#undef mutex_lock
-#define mutex_lock(m) (__mutex_lock(m), 0)
-
-#undef mutex_unlock
-#define mutex_unlock(m) (__mutex_unlock(m), 0)
+#include <libc-lock.h>
 
-#define mutex_trylock(m) (!__mutex_trylock(m))
+/* madvise is a stub on Hurd, so don't bother calling it.  */
 
-#define thread_atfork(prepare, parent, child) do {} while(0)
-#define thread_atfork_static(prepare, parent, child) \
- text_set_element(_hurd_fork_prepare_hook, prepare); \
- text_set_element(_hurd_fork_parent_hook, parent); \
- text_set_element(_hurd_fork_child_hook, child);
+#include <sys/mman.h>
 
-/* No we're *not* using pthreads.  */
-#define __pthread_initialize ((void (*)(void))0)
+#undef __madvise
+#define __madvise(addr, len, advice)   \
+  ((void) (addr), (void) (len), (void) (advice))
 
 #include <sysdeps/generic/malloc-machine.h>