In Unix, when a child process in background terminates, it sends a SIGCHLD
signal to the parent to inform it that it terminated.
Does the same happen even if the process was in foreground? If so, this means the parent will just ignore it.
Is this right? Or if it is in foreground, then no signal is sent at all?
background and foreground are job control concepts, and are part of the the shell. They are applied to processes and do not affect which process spawned (exec-ed) another process.
A child process is the result of a fork()-exec() call. The child gets a parent pid of the process that executed the fork() call. This is the context of the SIGCHLD signal, the parent pid receives the SIGCHLD signal. It does not matter whether the child process is "foreground" or "background", only the ppid matters on exit of the process.