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

Side by Side Diff: fusl/src/mman/mremap.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/mprotect.c ('k') | fusl/src/mman/msync.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 #define _GNU_SOURCE
2 #include <unistd.h>
3 #include <sys/mman.h>
4 #include <errno.h>
5 #include <stdint.h>
6 #include <stdarg.h>
7 #include "syscall.h"
8 #include "libc.h"
9
10 static void dummy(void) { }
11 weak_alias(dummy, __vm_wait);
12
13 void *__mremap(void *old_addr, size_t old_len, size_t new_len, int flags, ...)
14 {
15 va_list ap;
16 void *new_addr = 0;
17
18 if (new_len >= PTRDIFF_MAX) {
19 errno = ENOMEM;
20 return MAP_FAILED;
21 }
22
23 if (flags & MREMAP_FIXED) {
24 __vm_wait();
25 va_start(ap, flags);
26 new_addr = va_arg(ap, void *);
27 va_end(ap);
28 }
29
30 return (void *)syscall(SYS_mremap, old_addr, old_len, new_len, flags, ne w_addr);
31 }
32
33 weak_alias(__mremap, mremap);
OLDNEW
« no previous file with comments | « fusl/src/mman/mprotect.c ('k') | fusl/src/mman/msync.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698