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

CreateProc

Create a new process

Declaration

Source position: amigados.pas line 2448

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