These last 3 patches are really unrelated - I just generated and sent them
with one format-patch command. My mistake.

On Tue, May 25, 2021 at 1:03 AM Waldemar Kozaczuk <[email protected]>
wrote:

> Some applications like keydb that use jmalloc, call sbrk()
> on startup even though later fall back to mmap().
>
> So this patch provides simple stubs of those 2 functions
> that set errno to ENOMEM and return error.
>
> Signed-off-by: Waldemar Kozaczuk <[email protected]>
> ---
>  libc/mman.cc | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/libc/mman.cc b/libc/mman.cc
> index add8ef15..895b9b28 100644
> --- a/libc/mman.cc
> +++ b/libc/mman.cc
> @@ -13,6 +13,7 @@
>  #include "osv/trace.hh"
>  #include "osv/dentry.h"
>  #include "osv/mount.h"
> +#include <osv/stubbing.hh>
>  #include "libc/libc.hh"
>  #include <safe-ptr.hh>
>
> @@ -234,3 +235,17 @@ int madvise(void *addr, size_t length, int advice)
>      auto err = mmu::advise(addr, length, libc_madvise_to_advise(advice));
>      return err.to_libc();
>  }
> +
> +int brk(void *addr)
> +{
> +    WARN_STUBBED();
> +    errno = ENOMEM;
> +    return -1;
> +}
> +
> +void *sbrk(intptr_t increment)
> +{
> +    WARN_STUBBED();
> +    errno = ENOMEM;
> +    return (void *)-1;
> +}
> --
> 2.30.2
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CAL9cFfPghOtM%2B1Om8O7JARFsPVNG1L%3D2CYnnofNnt%3D-Tj3XavQ%40mail.gmail.com.

Reply via email to