mailing list of musl libc
 help / color / mirror / code / Atom feed
2391eb708486b9a1a635e6c37b4e56e208772566 blob 770 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
#include <unistd.h>
#include <sys/mman.h>
#include <errno.h>
#include <limits.h>
#include "syscall.h"
#include "libc.h"

WEAK_PROVIDE_INT;
WEAK_PROVIDE_VOID;
weak_alias(__weak_dummy_int, __vm_lock);
weak_alias(__weak_dummy_void, __vm_unlock);

#define OFF_MASK ((-0x2000ULL << (8*sizeof(long)-1)) | 0xfff)

void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off)
{
	void *ret;

	if (off & OFF_MASK) {
		errno = EINVAL;
		return MAP_FAILED;
	}
	if (flags & MAP_FIXED) __vm_lock(-1);
#ifdef SYS_mmap2
	ret = (void *)syscall(SYS_mmap2, start, len, prot, flags, fd, off>>12);
#else
	ret = (void *)syscall(SYS_mmap, start, len, prot, flags, fd, off);
#endif
	if (flags & MAP_FIXED) __vm_unlock();
	return ret;
}

weak_alias(__mmap, mmap);

LFS64(mmap);
debug log:

solving 2391eb7 ...
found 2391eb7 in https://inbox.vuxu.org/musl/fef8bbf759787cabc4ffd61c4e3357bc11112f8b.1360968989.git.Jens.Gustedt@inria.fr/
found e99271f in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 e99271f7e5dd7092cf5b84201906527425151ed9	src/mman/mmap.c

applying [1/1] https://inbox.vuxu.org/musl/fef8bbf759787cabc4ffd61c4e3357bc11112f8b.1360968989.git.Jens.Gustedt@inria.fr/
diff --git a/src/mman/mmap.c b/src/mman/mmap.c
index e99271f..2391eb7 100644

Checking patch src/mman/mmap.c...
Applied patch src/mman/mmap.c cleanly.

index at:
100644 2391eb708486b9a1a635e6c37b4e56e208772566	src/mman/mmap.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).