I was told that the dprintf () function can be useful when writing data to pipes. The problem is that I cannot find examples to explain how to use them. I read everything in this link, but still do not quite understand.
Just a very simple example will help me understand a lot. For example, if I had a pipe:
int fd[2]; pipe(fd);
and a few pids
pid_t ID1, ID2, ID3;
How could I use dprintf () to write these pids to a pipe?
source share