Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File5.12.11 Pgetpid TOS Name: »Pgetpid« - Get current process ID. Opcode: 267 (0x010b) Syntax: int16_t Pgetpid ( void ); Description: The function Pgetpid returns the PID of the currently active (calling) process, i.e. the one that currently 'owns' the CPU; this is the filetype under which the current process is administered in the directory U:\PROC. A PID is dynamically assigned to a process when it is created. You should make no assumption on the PID a process may have. For the kernel, the PID is a WORD but when you program in C, you should use the pid_t type, which complies with the POSIX standard. The FreeMiNT kernel's PID is always 0. The PID is useful when it is important to identify a process among others in the system. Knowing the PID of a program, it is possible to do a lot of things: send it a signal with Psignal(), look for its name in /proc by searching with a "*.xxx" mask (xxx is the PID of the program which name we wanna know), etc. Return value: PID of the active processes. Availability: The function is available in MagiC from Version 3.0 on and under MiNT. Group: Process functions See also: Binding Pgetpgrp Pgetppid