• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 297,  comments - 15,  trackbacks - 0

            NAME
                   brk, sbrk - change data segment size

            SYNOPSIS
                   #include <unistd.h>

                   int brk(void *end_data_segment);

                   void *sbrk(intptr_t increment);

            DESCRIPTION
                   brk()  sets the end of the data segment to the value specified by end_data_segment,
                   when that value is reasonable, the system does have enough memory and  the  process
                   does not exceed its max data size (see setrlimit(2)).

                   sbrk() increments the program's data space by increment bytes.  sbrk() isn't a sys-
                   tem call, it is just a C library wrapper.  Calling sbrk() with an  increment  of  0
                   can be used to find the current location of the program break.

            RETURN VALUE
                   On  success,  brk()  returns zero, and sbrk() returns a pointer to the start of the
                   new area.  On error, -1 is returned, and errno is set to ENOMEM.

            CONFORMING TO
                   4.3BSD

                   brk() and sbrk() are not defined in the C Standard and  are  deliberately  excluded
                   from the POSIX.1 standard (see paragraphs B.1.1.1.3 and B.8.3.3).

            NOTES
                   Various  systems  use  various  types for the parameter of sbrk().  Common are int,
                   ssize_t, ptrdiff_t, intptr_t.  XPGv6 obsoletes this function.

            SEE ALSO
                   execve(2), getrlimit(2), malloc(3)

                The brk() and sbrk() functions are used to change the amount of memory
                allocated in a process's data segment. They do this by moving the loca-
                tion of the ``break''. The break is the first address after the end of  
                the process's uninitialized data segment (also known as the ``BSS'').


            brk and sbrk設(shè)置的是BSS里的邊界,具體什么是BSS呢
            bss = "Block Started by Symbol" (由符號(hào)啟始的區(qū)塊)

            Dennis Ritchie 曾說(shuō)過(guò):
            這個(gè)縮寫(xiě)也許有其它說(shuō)法,但事實(shí)上我們采用這個(gè)縮寫(xiě)的本意是
            "Block Started by Symbol"。它是 FAP 上的偽指令,F(xiàn)AP
            (Fortran Assembly [-er?] Program) 是指 IBM 704-709-7090-7094
            這種機(jī)型的組譯器。這個(gè)指令可定義自己的標(biāo)號(hào),并且預(yù)留一定數(shù)目
            的字組空間。還有另一個(gè)偽指令 BES,是 "Block Ended by
            Symbol",跟 BSS 指令幾乎一樣,不同點(diǎn)在于標(biāo)號(hào)是定義在預(yù)留字組
            空間尾端的地址 + 1 的地方。在這些機(jī)器上,F(xiàn)ortran 的數(shù)組是以反
            方向儲(chǔ)存,而且數(shù)組的索引是從 1 算起。

            這種用法是合理的,因?yàn)檫@跟 UNIX 上標(biāo)準(zhǔn)的程序加載器一樣,程序
            碼當(dāng)中并非真的放入這一整塊預(yù)留空間,而是先用一個(gè)數(shù)目表示,在
            加載時(shí)才真的把所需的預(yù)留空間定出來(lái)。
            from:
            Linux man page and
            http://www.linuxforum.net/forum/gshowflat.php?Cat=&Board=linuxK&Number=300677&page=16&view=collapsed&sb=5&o=all&fpart=

            posted on 2010-02-18 19:23 chatler 閱讀(665) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): Linux_Coding
            <2025年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            常用鏈接

            留言簿(10)

            隨筆分類(lèi)(307)

            隨筆檔案(297)

            algorithm

            Books_Free_Online

            C++

            database

            Linux

            Linux shell

            linux socket

            misce

            • cloudward
            • 感覺(jué)這個(gè)博客還是不錯(cuò),雖然做的東西和我不大相關(guān),覺(jué)得看看還是有好處的

            network

            OSS

            • Google Android
            • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
            • os161 file list

            overall

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            久久人人爽爽爽人久久久| 久久精品18| 久久99久久99小草精品免视看| 久久天天婷婷五月俺也去 | 久久精品国产精品亚洲精品| 亚洲∧v久久久无码精品| 国产精品99久久久久久宅男 | 久久久免费精品re6| 成人国内精品久久久久影院| 色诱久久av| 99久久国产主播综合精品 | 久久精品这里热有精品| 综合久久给合久久狠狠狠97色| 久久天天躁狠狠躁夜夜网站| 久久久WWW成人免费毛片| 国产精品美女久久久m| 久久天天婷婷五月俺也去| 亚洲国产精品久久久久婷婷老年| 久久久一本精品99久久精品88| 国产精品一区二区久久| 久久婷婷国产综合精品| 久久午夜免费视频| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 区亚洲欧美一级久久精品亚洲精品成人网久久久久| 久久免费看黄a级毛片| 久久男人中文字幕资源站| 国内精品久久久久久不卡影院| 久久婷婷五月综合国产尤物app| 久久久无码精品亚洲日韩蜜臀浪潮| 久久国产精品无码网站| 精品水蜜桃久久久久久久| 26uuu久久五月天| 99久久精品免费看国产| 国产L精品国产亚洲区久久| 嫩草影院久久国产精品| 99久久国产亚洲高清观看2024| 国产成人精品久久一区二区三区av| 99久久99久久| 91久久精品无码一区二区毛片| 国产精品美女久久久网AV| 久久99国产精品成人欧美|