2001-03-26  Ben Collins  <bcollins@debian.org>

	* sysdeps/unix/sysv/linux/mips/bits/mman.h: Add MAP_* and MADV_*
	defines to match other architectures.
This commit is contained in:
Ulrich Drepper 2001-03-27 03:20:20 +00:00
parent 0a04075ed9
commit 93a4b7cac4
5 changed files with 30 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2001-03-26 Ben Collins <bcollins@debian.org>
* sysdeps/unix/sysv/linux/mips/bits/mman.h: Add MAP_* and MADV_*
defines to match other architectures.
2001-03-26 Ulrich Drepper <drepper@redhat.com>
* libio/Makefile (tests): Add tst-ext.

View file

@ -1,3 +1,10 @@
2001-03-26 Ulrich Drepper <drepper@redhat.com>
* attr.c (pthread_getattr_np): Correct computation of stack size
for machiens with register stack.
* Examples/ex17.c (main): Correct detection of failed mmap call.
2001-03-21 Jakub Jelinek <jakub@redhat.com>
* pthread.c (__pthread_initialize_manager): Fix a typo.

View file

@ -28,7 +28,7 @@ main (void)
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (stack == (void *)-1)
if (stack == MAP_FAILED)
{
perror ("mmap failed");
return 1;

View file

@ -288,7 +288,8 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
attr->__guardsize = descr->p_guardsize;
attr->__stackaddr_set = descr->p_userstack;
#ifdef NEED_SEPARATE_REGISTER_STACK
attr->__stacksize *= 2;
if (descr->p_userstack == 0)
attr->__stacksize *= 2;
/* XXX This is awkward. The guard pages are in the middle of the
two stacks. We must count the guard size in the stack size since
otherwise the range of the stack area cannot be computed. */
@ -297,7 +298,7 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
#ifndef _STACK_GROWS_UP
attr->__stackaddr = (char *)(descr + 1);
#else
#error __stackaddr not handled
# error __stackaddr not handled
#endif
return 0;

View file

@ -53,10 +53,12 @@
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x1000 /* Stack-like segment. */
# define MAP_NORESERVE 0x0400 /* don't check for reservations */
# define MAP_ANONYMOUS 0x0800 /* don't use a file */
# define MAP_GROWSDOWN 0x1000 /* stack-like segment */
# define MAP_DENYWRITE 0x2000 /* ETXTBSY */
# define MAP_EXECUTABLE 0x4000 /* Mark it as an executable. */
# define MAP_NORESERVE 0x0400 /* Don't check for reservations. */
# define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
# define MAP_LOCKED 0x8000 /* pages are locked */
#endif
/* Flags to `msync'. */
@ -69,6 +71,15 @@
#define MCL_FUTURE 2 /* Lock all additions to address
space. */
/* Advice to `madvise'. */
#ifdef __USE_BSD
#define MADV_NORMAL 0 /* default page-in behavior */
#define MADV_RANDOM 1 /* page-in minimum required */
#define MADV_SEQUENTIAL 2 /* read-ahead aggressively */
#define MADV_WILLNEED 3 /* pre-fault pages */
#define MADV_DONTNEED 4 /* discard these pages */
#endif
/* Flags for `mremap'. */
#ifdef __USE_GNU
# define MREMAP_MAYMOVE 1