Questions about IPC

Hello and thanks in advance for any help anyone can offer to help me understand this

I'm curious about a 30.000 ft view on how IPC works in Linux between parent-child processes...I understand there's multiple types of IPC's... But I'm currently trying to figure out if parent-child process IPC communications go thru the API on the way to the kernel

For example... if the bash shell forks a ps command process... I'm assuming the ps process uses IPC to communicate the results back the the bash shell... If this is how it works I'm trying to figure out if it goes thru the API... I'm guessing it does but I can't find anything that specifically states that

Once again... thanks for any help anyone can offer me

You have assumptions you may not realize that you have.

When a parent creates a child

  1. if the child "stays" as a child it can communicate to the parent via pipes, shared memory - ipc in general is possible. Sometimes the child stdout is the parent's same stdout (shared) with the parent. There no requirement that it be done one way or another. The parent should call wait() on the child process and then take correct action depending on the return from the child (exit()).

  2. The child calls setsid() and becomes the head of its very own process. It can still talk to the parent if it is coded to do that, but when the process ends, the parent has gone on to do other things and had not called wait() on the child.

  3. a daemon is a special version of #2. The child turns off connections to stdin, stdout, stderr. These processes are often called services. Normally they do not engage in IPC with the parent.

  4. Sometimes a child can be #1, #2, or #3 but it uses signals to/from the parent to interoperate.

Shells mostly use #1 - you type the ls command, it does it's thing, writes to stdout, then calls exit. The status of the child is available to the parent shell in the $? variable.

I've simplified this for understanding. Someone else may not feel my choices were the best. In any event - You should really consider learning what https://www.tldp.org/LDP/tlk/ipc/ipc.html has to say. And learn it reasonably well.