You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/01/16 09:56:48 UTC
[GitHub] [incubator-nuttx] Donny9 opened a new pull request #2690: vfork: support sim vfork
Donny9 opened a new pull request #2690:
URL: https://github.com/apache/incubator-nuttx/pull/2690
## Summary
support vfork.
## Impact
vfork
## Testing
int global = 100;
int main(int argc, FAR char *argv[])
{
pid_t pid = 0;
int stack = 0;
pid = vfork();
if (pid < 0) {
printf("error pid generate\n");
}
if (pid == 0) {
stack += 2;
global += 3;
printf("in child process:%d, stack:%d, global:%d\n", getpid(), stack, global);
exit(0);
} else {
stack += 10;
printf("in parent process:%d,%d, stack:%d, global:%d\n", getpid(), pid, stack, global);
}
}
output:
in child process:11, stack:2, global:103
in parent process:10,11, stack:10, global:103
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2690: vfork: support sim vfork
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2690:
URL: https://github.com/apache/incubator-nuttx/pull/2690
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org