Overview
The process API provides functions for managing processes, retrieving process information, and controlling process execution on the PlayStation 3.Process Information
sysProcessGetPid
Get the current process ID.Current process ID
sysProcessGetPpid
Get the parent process ID.Parent process ID
sysProcessGetNumberOfObject
Get the number of objects of a specific type.Object type constant:
SYS_OBJECT_MEM- Memory objectsSYS_OBJECT_MUTEX- MutexesSYS_OBJECT_COND- Condition variablesSYS_OBJECT_EVENT_QUEUE- Event queuesSYS_OBJECT_SEMAPHORE- SemaphoresSYS_OBJECT_FS_FD- File descriptors- And others (see constants below)
Pointer to storage for object count
Zero on success, error code otherwise
sysProcessGetPpuGuid
Get PPU GUID information from the ELF.Address of PPU GUID information
Process Control
sysProcessExit
Terminate the current process.Exit status code
sysProcessExitSpawn2
Terminate the current process and execute another program.Path to the new program to execute
Argument vector for the new program (NULL-terminated)
Environment variables (may be NULL)
Additional data to pass (may be NULL)
Size of additional data
Priority for the new process (1000 = normal)
Stack size flags (OR combination):
SYS_PROCESS_SPAWN_STACK_SIZE_32KSYS_PROCESS_SPAWN_STACK_SIZE_64KSYS_PROCESS_SPAWN_STACK_SIZE_96KSYS_PROCESS_SPAWN_STACK_SIZE_128KSYS_PROCESS_SPAWN_STACK_SIZE_256KSYS_PROCESS_SPAWN_STACK_SIZE_512KSYS_PROCESS_SPAWN_STACK_SIZE_1M
Process Parameters
Define process priority and stack size using theSYS_PROCESS_PARAM macro in your code.
SYS_PROCESS_PARAM
Define process parameters (must be used outside functions).Process priority (1000 = normal)
Main thread stack size constant:
SYS_PROCESS_SPAWN_STACK_SIZE_32K(0x10)SYS_PROCESS_SPAWN_STACK_SIZE_64K(0x20)SYS_PROCESS_SPAWN_STACK_SIZE_96K(0x30)SYS_PROCESS_SPAWN_STACK_SIZE_128K(0x40)SYS_PROCESS_SPAWN_STACK_SIZE_256K(0x50)SYS_PROCESS_SPAWN_STACK_SIZE_512K(0x60)SYS_PROCESS_SPAWN_STACK_SIZE_1M(0x70)
Object Type Constants
Constants for use withsysProcessGetNumberOfObject():
Process Object Types
Process Object Types
| Constant | Value | Description |
|---|---|---|
SYS_OBJECT_MEM | 0x08 | Memory objects |
SYS_OBJECT_MUTEX | 0x85 | Mutexes |
SYS_OBJECT_COND | 0x86 | Condition variables |
SYS_OBJECT_RWLOCK | 0x88 | Read-write locks |
SYS_OBJECT_INTR_TAG | 0x0A | Interrupt tags |
SYS_OBJECT_INTR_SERVICE_HANDLE | 0x0B | Interrupt service handles |
SYS_OBJECT_EVENT_QUEUE | 0x8D | Event queues |
SYS_OBJECT_EVENT_PORT | 0x0E | Event ports |
SYS_OBJECT_TRACE | 0x21 | Trace objects |
SYS_OBJECT_SPUIMAGE | 0x22 | SPU images |
SYS_OBJECT_PRX | 0x23 | PRX modules |
SYS_OBJECT_SPUPORT | 0x24 | SPU ports |
SYS_OBJECT_LWMUTEX | 0x95 | Lightweight mutexes |
SYS_OBJECT_TIMER | 0x11 | Timers |
SYS_OBJECT_SEMAPHORE | 0x96 | Semaphores |
SYS_OBJECT_FS_FD | 0x73 | File descriptors |
SYS_OBJECT_LWCOND | 0x97 | Lightweight condition variables |
SYS_OBJECT_EVENT_FLAG | 0x98 | Event flags |
Stack Size Constants
Stack Size Values
Stack Size Values
| Constant | Value | Size |
|---|---|---|
SYS_PROCESS_SPAWN_STACK_SIZE_32K | 0x10 | 32 KB |
SYS_PROCESS_SPAWN_STACK_SIZE_64K | 0x20 | 64 KB |
SYS_PROCESS_SPAWN_STACK_SIZE_96K | 0x30 | 96 KB |
SYS_PROCESS_SPAWN_STACK_SIZE_128K | 0x40 | 128 KB |
SYS_PROCESS_SPAWN_STACK_SIZE_256K | 0x50 | 256 KB |
SYS_PROCESS_SPAWN_STACK_SIZE_512K | 0x60 | 512 KB |
SYS_PROCESS_SPAWN_STACK_SIZE_1M | 0x70 | 1 MB |