Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: fusl/src/mman/mmap.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/mman/mlockall.c ('k') | fusl/src/mman/mprotect.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <unistd.h>
2 #include <sys/mman.h>
3 #include <errno.h>
4 #include <stdint.h>
5 #include <limits.h>
6 #include "syscall.h"
7 #include "libc.h"
8
9 static void dummy(void) { }
10 weak_alias(dummy, __vm_wait);
11
12 #define UNIT SYSCALL_MMAP2_UNIT
13 #define OFF_MASK ((-0x2000ULL << (8*sizeof(long)-1)) | (UNIT-1))
14
15 void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off)
16 {
17 if (off & OFF_MASK) {
18 errno = EINVAL;
19 return MAP_FAILED;
20 }
21 if (len >= PTRDIFF_MAX) {
22 errno = ENOMEM;
23 return MAP_FAILED;
24 }
25 if (flags & MAP_FIXED) {
26 __vm_wait();
27 }
28 #ifdef SYS_mmap2
29 return (void *)syscall(SYS_mmap2, start, len, prot, flags, fd, off/UNIT) ;
30 #else
31 return (void *)syscall(SYS_mmap, start, len, prot, flags, fd, off);
32 #endif
33 }
34
35 weak_alias(__mmap, mmap);
36
37 LFS64(mmap);
OLDNEW
« no previous file with comments | « fusl/src/mman/mlockall.c ('k') | fusl/src/mman/mprotect.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698