WikiPendium

(beta)

Pterm()

WikiPendium :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-13-59-236-219.us-east-2.compute.amazonaws.com

Pterm()

(Process TERMination)

VOID Pterm( retcode )

WORD retcode;

Pterm() terminates an application returning the specified error code.

Opcode

76 (0x4C)

Availability

All GEMDOS versions.

Parameters

retcode indicates the error status upon termination. Some recommended return values are:

Name retcode Meaning
TERM_OK 0 Program completion without errors
TERM_ERROR 1 Generic Error
TERM_BADPARAMS 2 Bad parameters
TERM_CRASH -1 Process crashed (returned by GEMDOS versions from 0.15.)
TERM_CTRLC -32 Process terminated by Control-C

Binding

	move.w	retcode,-(sp)
	move.w	#$4C,-(sp)
	trap	#1
	addq.l	#4,sp


Return Value

Pterm() never returns.

Comments

GEMDOS jumps through the etv_term (0x102) vector when this call is made prior to process termination to allow the process one last chance to clean up. In addition, all files opened by the process are closed and all memory blocks allocated by the process are freed.

See Also

Pexec(), Pterm0()

Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]