0
有沒有辦法將posix_spawn()的結果輸出到iOS的Xcode調試控制檯?iOS/Xcode:Outpot posix_spawn()結果調試控制檯
示例代碼:
int status = 0;
int success = 0;
pid_t pid;
char *argv[] = {
"/usr/bin/pwd",
NULL
};
success = posix_spawn(&pid, argv[0], NULL, NULL, argv, environ);
waitpid(pid, &status, WEXITED);
NSLog(@"Success: %i, Status: %i, PID: %d", success, status, pid);
//LOG RESULT- Success: 1, Status: 0, PID: 1
謝謝。是的,posix_spawn()返回1,這讓我困惑,因爲我忘記0實際上是成功的。 – Zigglzworth