public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: ur bridge <urbridge@outlook.com>
To: Florian Weimer <fweimer@redhat.com>,
	" libc-help@sourceware.org" <libc-help@sourceware.org>
Subject: Re: Where could I find the definition of __vm_deallocate() called by __munmap()?
Date: Sun, 1 Aug 2021 13:05:58 +0000	[thread overview]
Message-ID: <BN8PR18MB26437AB07696F5FC8F637CD2C4EE9@BN8PR18MB2643.namprd18.prod.outlook.com> (raw)
In-Reply-To: <87fsvuv0bi.fsf@oldenburg.str.redhat.com>

Thank you, Florian,

I tried to locate __vm_deallocate()’s definition in glibc by grep, and found only a hidden_proto in sysdeps/mach/include/mach-shortcuts-hidden, with no actual implementation.

Is its code included in glibc? If not, how could glibc be built from the source?

Given that __mmap() will call the syscall mmap(), I can understand only if __munmap() is a thin wrapper for syscall munmap(), but it calls __vm_deallocate(). How does this mismatch work? How could Hurd’s code touch the necessary structures (e.g. vma, managed by Linux kernel) to handle the unmapping?


Re: Where could I find the definition of __vm_deallocate() called by __munmap()?

* ur bridge via Libc-help:

> I’m reading the malloc.c code, and find that when __munmap() is called
> to free a mmapped chunk, the control flow will fall into
> sysdeps/mach/munmap.c, where __vm_deallocate() will be
> called. However, I cannot find its definition. Where could it be?

This is Hurd code.  For Linux, __munmap is indeed a thin system call
wrapper.

Thanks,
Florian


      reply	other threads:[~2021-08-01 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-31 17:37 ur bridge
2021-07-31 17:51 ` Florian Weimer
2021-08-01 13:05   ` ur bridge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN8PR18MB26437AB07696F5FC8F637CD2C4EE9@BN8PR18MB2643.namprd18.prod.outlook.com \
    --to=urbridge@outlook.com \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).