用STM32F103C8点亮32x64双色点阵屏:HUB08接口驱动保姆级教程(附完整Keil工程)
2026/5/11 16:36:19
在 Linux 环境中,进程是构建各类应用的基础。下面我们先来看一个使用waitpid函数的示例:
program waitpidExample; {$APPTYPE CONSOLE} uses Libc; var ClonedProcess: integer; ChildStatus: integer; WaitResult: integer; begin writeln('About to fork the process.'); ClonedProcess := fork; if ClonedProcess = 0 then begin //We are the child. Let's sleep on it writeln('The child process is about to sleep'); __sleep(5); writeln('The child process is awake.'); end else if ClonedProcess > 0 then begin writeln('The fork was successful.'); writeln('Waiting on the child process to exit.'); WaitResult := waitpid(ClonedProcess, @ChildStatus, 0); if WaitResult <> –1 then