Server for Information Technologies

(095) 932-9212, 932-9213, 939-0783
E-mail: info@citforum.ru
(!) CIT Forum CD-ROM

SBRK(3)
XENIX System V (21 1987)


sbrk, brk - pacpeee a ceee ax

          char *sbrk (incr)
          int incr;

          int brk (addr)
          char *addr;


Sbrk brk coyc aecoo ee paepa ceea ax eyeo poecca; c. exec(3). eee paepa eaec ye ycao eyeo poecca pa ceea ax, .e. apeca epo e a, axoec a oo ceea ax poecca. Paep ceea yeaec, ec paa opacae.

Sbrk oae incr ao ae pa ceea cooecy opao ee eeoe ceey eco. Incr oe opaee, o yeae aee pa paep ceea.

B cyae oo oe a 286 poeccopa, ec incr oe ca ao, ocaxc o oa ceea, sbrk aoaec paeae peyee a oo ceee ax. Te ca apapyec paeoc apoex ao ooy ceey. Ec incr opaee eo acooe aee pao e eyeo ceea ax, cee aoaec ocooaec. Ec incr opaee eo acooe aee oe eyeo ceea, cee ocooaec ooee a yac peyeo ceea ax. pey ec cee, coepa ae, eee oce oo sbrk, e oocc aoy ceey.

Sbrk aapo aepaec paep ceea e eec, ec oec xo oo ceyx yco:

[ENOMEM]
apoeo oe a, e oycae ccea (c. ulimit(3)).

oa ocoo a oe, e ee o y poecca.

oa ycao pay ceea ee epoaao. epoaaa paa o paa oe capa poecca c a paeex ax, oope ee oce oo.

Brk ycaaae pay ceea pao ae addr cooecy opao ee eeoe ceey eco. Brk aepaec c oo, ec yaa apec aae ecyecy cee peae oyc cceo pee.

BOPAAEOE AEE
B cyae yceoo aepe sbrk opaae yaae a aao eeoo eca, a brk opaae 0. ae opaaec aee -1 errno aocc o o. B cyae oo oe a sbrk coae o cee ax opaae eo capo apec.

.
exec(3)

AEA
B cyae oo oe a 286 poeccopa o "sbrk(0)" e oaeo opaae capo apec ceyeo oa sbrk. B acoc, a ye, ec cey o coae o cee ax. Bopaaeoe oo "sbrk(0)" aee ceye cooa opee cxoo pa ceea ax.
Comments: info@citmgu.ru
Designed by Andrey Novikov
Copyright © CIT