Path: blob/master/waterbox/libc/functions/_PDCLIB/emulibc.c
2 views
#include <stdint.h>1#include <stddef.h>2#include "_PDCLIB_glue.h"3#include <errno.h>4#include <emulibc.h>56ECL_EXPORT ECL_ENTRY __attribute__((noreturn)) void (*_ecl_trap)(void); // something very unexpected happened. should not return7ECL_EXPORT ECL_ENTRY void *(*_ecl_sbrk)(size_t n); // sbrk. won't return if the request can't be satisfied8ECL_EXPORT ECL_ENTRY void (*_ecl_debug_puts)(const char *); // low level debug write, doesn't involve STDIO910ECL_EXPORT ECL_ENTRY void *(*_ecl_sbrk_sealed)(size_t n); // allocate memory; see emulibc.h11ECL_EXPORT ECL_ENTRY void *(*_ecl_sbrk_invisible)(size_t n); // allocate memory; see emulibc.h1213void *alloc_sealed(size_t size)14{15return _ecl_sbrk_sealed(size);16}1718void *alloc_invisible(size_t size)19{20return _ecl_sbrk_invisible(size);21}2223void _debug_puts(const char *s)24{25_ecl_debug_puts(s);26}2728void *_PDCLIB_sbrk(size_t n)29{30void *ret = _ecl_sbrk(n);31return ret;32}3334void _PDCLIB_Exit( int status )35{36_ecl_trap();37}38394041