mailing list of musl libc
 help / color / mirror / code / Atom feed
28c5fc23c0a5facf15fd182c3c3cfe74cc1fa352 blob 486 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
#include <limits.h>
#include "syscall.h"

long __syscall_brk(long arg1, ...)
{
  unsigned long newbrk = (unsigned long)arg1;
  unsigned long pages = __builtin_wasm_current_memory();
  if (newbrk % PAGE_SIZE)
    goto end;
  unsigned long new_pages = newbrk / PAGE_SIZE;
  if (new_pages <= pages || new_pages >= (0xffffffffu / PAGE_SIZE))
    goto end;
  if (__builtin_wasm_grow_memory(new_pages - pages) != (unsigned long)-1)
    pages = new_pages;
  end:
  return pages * PAGE_SIZE;
}
debug log:

solving 28c5fc23 ...
found 28c5fc23 in https://inbox.vuxu.org/musl/VI1PR0502MB38851CB41BB1DA99B673004EE73A0@VI1PR0502MB3885.eurprd05.prod.outlook.com/

applying [1/1] https://inbox.vuxu.org/musl/VI1PR0502MB38851CB41BB1DA99B673004EE73A0@VI1PR0502MB3885.eurprd05.prod.outlook.com/
diff --git a/src/internal/wasm/syscall_brk.c b/src/internal/wasm/syscall_brk.c
new file mode 100644
index 00000000..28c5fc23

Checking patch src/internal/wasm/syscall_brk.c...
Applied patch src/internal/wasm/syscall_brk.c cleanly.

index at:
100644 28c5fc23c0a5facf15fd182c3c3cfe74cc1fa352	src/internal/wasm/syscall_brk.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).