Skip to content

Instantly share code, notes, and snippets.

@ha7ilm ha7ilm/test3.c
Last active Dec 2, 2015

Embed
What would you like to do?
stdin behaviour test
#include <stdio.h>
#include <unistd.h>
int main()
{
pid_t p;
int stat;
int i;
if(!(p = fork()))
{
execl("/bin/bash","bash", "-c","csdr through >/dev/null",NULL);
fprintf(stderr, "child failed to execl, now exits...\n"); return;
}
fprintf(stderr, "parent wait\n");
while(1) wait(&stat);
fprintf(stderr, "parent exited\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.