Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#amunits]

CreateProc

Create a new process

Declaration

Source position: amigados.pas line 1600

function CreateProc(

  const name: pCHAR;

  pri: LongInt;

  segList: LongInt;

  stackSize: LongInt

):pMsgPort;

Arguments

name

  

Name of Process

pri

  

Priority for the process

segList

  

Pointer to a seglist to run

stackSize

  

Initial Stacksize for the process

Function result

Pointer to the new Process messageport or nil

Description

CreateProc() creates a new process of name 'name'. Processes are a superset of exec tasks.

A seglist, as returned by LoadSeg(), is passed as 'seglist'. This represents a section of code which is to be run as a new process. The code is entered at the first hunk in the segment list, which should contain suitable initialization code or a jump to such. A process control structure is allocated from memory and initialized.

The size of the root stack upon activation is passed as 'stackSize'. 'pri' specifies the required priority of the new process. The result will be the process msgport address of the new process, or nil if the routine failed. The argument 'name' specifies the new process name. A nil return code indicates error.

The seglist passed to CreateProc() is not freed when it exits; it is up to the parent process to free it, or for the code to unload itself.

See also

CreateNewProc

  

Create a new process from taglist

LoadSeg

  

Scatterload a loadable file into memory

UnLoadSeg

  

Unload a seglist previously loaded by LoadSeg()


Documentation generated on: 2021-07-30