deletehfs (BPX1DEL, BPX4DEL) — Delete a program from storage

Function

The deletehfs service deletes a previously loaded program from the storage of the caller's process.

Requirements

Operation Environment
Authorization: Supervisor or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1DEL): 31-bit
AMODE (BPX4DEL): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1DEL,(Entrypt_address,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4DEL with the same parameters. The Entrypt_address parameter is a doubleword.

Parameters

Entrypt_address
Supplied parameter
Type:
Integer
Length:
Fullword (doubleword)

A fullword (doubleword) pointer field that contains an entry point address that was returned by the loadhfs service for a z/OS UNIX program that was loaded into the caller's process.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the deletehfs service returns -1 if it is not successful. If it is successful, the deletehfs service returns zero.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the deletehfs service stores the return code. The deletehfs service returns Return_code only if Return_value is -1. For a complete list of possible return code values, see z/OS UNIX System Services Messages and Codes. The deletehfs service can return one of the following values in the Return_code parameter:
Return_code Explanation
EINVAL The entrypt_address parameter contains an entry point address that is not valid. The entry point address does not represent a currently loaded program in the caller's process.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the deletehfs service stores the reason code. The deletehfs service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

  1. A call to BPX1DEL (BPX4DEL) to delete a program from storage may not actually cause the program to be removed from storage. If the program has been loaded more than once, the program remains in storage until BPX1DEL (BPX4DEL) has been called the same number of times that the program was loaded.
  2. If a program that is loaded into storage with the loadhfs service is not deleted from storage, the program remains in storage until the calling task terminates, if it is not a pthread. If the caller is a pthread, the program remains in storage until the Initial Pthread Creating Task (IPT) terminates,
  3. When the calling process is being debugged via the Ptrace service, a call to the deletehfs service generates a WastStopFlagDelete Ptrace event to the debugger process.

Related services

Characteristics and restrictions

None.

Examples

For an example using this callable service, see BPX1DEL (deleteHFS) example.