PxTrapGetTaskProtection()
Get the protection set of a task.
- APPLIES TO
 - 
8.2.0
 - SYNOPSIS
 - 
PxDataProtectSet_T *PxTrapGetTaskProtection(PxTask_t tId); - ARGUMENTS
 
  | 
- RETURN VALUES
 - 
- 
Pointer to the protection set
 - 
0 in case of error
 
 - 
 - ERROR CODES
 - 
PXERR_TASK_ILLTASKtask ID
tIdis not validPXERR_REQUEST_INVALID_PARAMETERcalled in an illegal context
 - DESCRIPTION
 - 
Returns a pointer to the actual protection set of the requested task. It may only be used in supervisor context with protection set
PRS_TSK_KERNEL. This context is valid inside an application defined trap handler. 
- IMPLEMENTATION GUIDELINES
 - 
- Before call
 - 
- 
The parameter
tIdmust be a valid task object id. - 
This id may be:
- 
the calling task’s own id read by calling
PxGetId()(V) - 
the return value of a
PxTaskCreate()call (V) - 
the result of a
nameserverquery (V) - 
part of a message sent by another task (V)
 
 - 
 - 
Additionally the task id may be checked with
PxTaskCheck()(F). 
 - 
 
- After call
 - 
- 
The function returns a pointer to the task’s protection set or a null pointer if
tIdis not a valid task object (C). 
 - 
 
- Best Practice
 - 
- 
The caller must be in supervisor mode.
 
 - 
 
 
- SEE ALSO
 - USAGE
 - 
#include "pxdef.h" PxDataProtectSet_T *pset = PxTrapGetTaskProtection(tId); if (pset != 0) { // Handle Trap context } else { // Report error }