Browse Source

make mmap() return void *, add MAP_FAILED

OPENBSD_2_3
deraadt 27 years ago
parent
commit
e8d65e4516
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/lib/libc/stdlib/malloc.c

+ 4
- 4
src/lib/libc/stdlib/malloc.c View File

@ -8,7 +8,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: malloc.c,v 1.29 1997/08/23 10:43:25 pefo Exp $";
static char rcsid[] = "$OpenBSD: malloc.c,v 1.30 1998/01/02 05:32:49 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
/* /*
@ -268,7 +268,7 @@ static char *malloc_func;
/* Macro for mmap */ /* Macro for mmap */
#define MMAP(size) \ #define MMAP(size) \
mmap((caddr_t)0, (size), PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, \
mmap((void *)0, (size), PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, \
MMAP_FD, (off_t)0); MMAP_FD, (off_t)0);
/* /*
@ -391,7 +391,7 @@ malloc_exit()
/* /*
* Allocate a number of pages from the OS * Allocate a number of pages from the OS
*/ */
static caddr_t
static void *
map_pages(pages) map_pages(pages)
int pages; int pages;
{ {
@ -466,7 +466,7 @@ extend_pgdir(index)
page_dir = new; page_dir = new;
/* Now free the old stuff */ /* Now free the old stuff */
munmap((caddr_t)old, oldlen);
munmap(old, oldlen);
return 1; return 1;
} }


Loading…
Cancel
Save