Linux 进程通信与 POSIX 线程技术解析
1. 信号与超时相关结构体
在 Linux 开发中,信号处理和超时设置是常见的操作。以下是相关的结构体和变量定义:
si_errno: Integer; // Error Code si_code: Integer; // Signal code. case Integer of 0: (_pad: _si_pad); 1: (_kill: _si_kill); 2: (_timer: _si_timer); 3: (_rt: _si_rt); 4: (_sigchld: _si_sigchld); 5: (_sigfault: _si_sigfault); 6: (_sigpoll: _si_sigpoll); end; siginfo_t = siginfo; TSigInfo = siginfo; PSigInfo = TSigInfo; Timeout: The Timeout parameter is a pointer to a TTimeSpec record that specifies the num- ber of seconds and nanoseconds the process should wait. type timespec = record tv_sec: Longint; // Seconds tv_nsec: Longint; // Nanoseconds end; TTimeSpec = TimeSpec; PTimeSpec = ^TTimeSpec;这些结构体和变量用于处理信号相关的错误码、信号码以及超时