gpt4 book ai didi

linux - Kernel Source -- 在哪个文件中定义了 brk()

转载 作者:太空宇宙 更新时间:2023-11-04 11:32:21 28 4
gpt4 key购买 nike

我想知道在内核源代码版本 >= 2.6 中定义了 brk。那是哪个c文件包含它的定义? grep 并没有透露太多。另外 sbrk 是在 glibc 中实现的吗?

最佳答案

它在 mmap.c 中。寻找:

SYSCALL_DEFINE1(brk, unsigned long, brk)

手册页说:

On Linux, sbrk() is implemented as a library function that uses the brk() system call, and does some internal bookkeeping so that it can return the old break value.

关于linux - Kernel Source -- 在哪个文件中定义了 brk(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10313078/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com