python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
grep never terminates in this code (using fork, fd)
When I execute this function with "ls -a | grep test",
it prints test testing testing.c correctly
but it never terminates until I press ctrl+c to exit.
void executeCMD(char *cmdline)
{
c...
be-student
Votes: 0
Answers: 0
Issue with dup2
I am trying a simple program where the STDOUT from Child process is directed to the Parent process. The program works if I don't fork multiple times and call the child_process and parent_process in a ...
Tushar
Votes: 0
Answers: 1
How to change stdio of a given process (i.e. not current process)?
Here is a way to change stdio of a given process by external tools such as gdb:
https://www.baeldung.com/linux/redirect-output-of-running-process
My question is, how can I do this programatically? I ...
xrfang
Votes: 0
Answers: 1
Can't redirect printf to pipe
I want to redirect the output of printf to a pipe, but for some reason it doesn't seem to work. What does work is using write instead.
This is my program
#include <stdio.h>
#include <stdlib.h...
Paul
Votes: 0
Answers: 1