Unix Man ( )


EXECSEG(3)


EXECSEG(3)
XENIX System V (21 1987)


execseg - eae yaco ax oeo popao

#include

excode_t execseg (oldaddr, size) exdata_t oldaddr; unsigned size;

int unexecseg (addr) excode_t addr;


execseg oyae eye apec paep yaca a, oop oe oe, opaae capo apec yaca, oopo, o pae epe, size ao oopoy oo epea ypaee. B cyae poeccopo Intel 8086 80286 cee pecp CS accopyec c ceeo ax, oopo pacooe yaco oldaddr. o oaae, o cee o peyex ao oeo ceee ceee ax coaa, o ceeop y x pae.

B cyae 8086 80286 "excode_t" "exdata_t" c (far) yaae. B cyae apxeyp, e cpa pax ceeo aac o e/ac/oe, opaae apec ee apyey, epeaaeoy execseg.

Peoeyec, o p cooa o y popa 8086 80286 e oy oe a; ae popac oe xopoo opepoac ceax oex x yaaex.

p oapye o execseg opaae ((excode_t)-1) aoc errno o o ENONEM. Oo caec eoppe apec ax size, a ae eoooc paec o ceeop ax.

unexecseg apeae cooa addr, opae coe pe execseg, a apec oeo popa. B cyae 8086 80286 o o po ocooe ceeopa, cooaoo oeoo yaca. y opaae 0 cyae yceoo aepe -1 p oe. Hapep, ec addr e ec apeco, opae paee ye execseg, opaaec -1 o apec e oe pe cy apeco oeo popa.


excode_t funcp; char far *datap; ... datap=brkctl(BR_NEWSEG,1000L,0L); load_with_code(datap,1000); /* apyae popay yaco datap */ funcp=execseg(datap,1000); (*funcp)(); /* o popa */ if(unexecseg(funcp)==-1) { printf("unexecseg failed0); exit(1); }