title: Difference between process group id and job id in UNIX
body: <p>Please tell me the difference between a process group ID and a jobid. Is jobid a builtin of a shell program or is it related to the kernel? What are the uses of each of them? When a process is run in background, is only jobid set or is the pgid set as well?
  What are the uses of the setpgid() function?</p>
  
  <p>When a process is run in background, is the kernel also involved or does the shell take care of which is background or foreground?</p>