mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Apply some touchups
This commit is contained in:
parent
9f149e1de3
commit
2f3bd90216
139 changed files with 1188 additions and 1154 deletions
|
@ -28,14 +28,22 @@
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
int fork(void) {
|
||||
int rc;
|
||||
axdx_t ad;
|
||||
int ax, dx;
|
||||
if (!IsWindows()) {
|
||||
rc = sys_fork();
|
||||
ad = sys_fork();
|
||||
ax = ad.ax;
|
||||
dx = ad.dx;
|
||||
if (IsXnu() && ax != -1) {
|
||||
/* eax always returned with childs pid */
|
||||
/* edx is 0 for parent and 1 for child */
|
||||
ax &= dx - 1;
|
||||
}
|
||||
} else {
|
||||
rc = sys_fork_nt();
|
||||
ax = sys_fork_nt();
|
||||
}
|
||||
if (rc == 0) {
|
||||
if (!ax) {
|
||||
__onfork();
|
||||
}
|
||||
return rc;
|
||||
return ax;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue