对于do_brk()功能的说明:
this is really a simplified "do_mmap". it only handles anonymous maps(只处理匿名映射). eventually we may be able to do some brk-specific accounting here.
应用层使用brk()系统调用的例子:
/* sbrk and brk example */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
void *curr_brk, *tmp_brk = NULL;
printf("Welcome to sbrk example:%d\n", getpid());
/* sbrk(0) gives current program break location */
tmp_brk = curr_brk = sbrk(0);
printf("Program Break Location1:%p\n", curr_brk);
getchar();