title: Why is getpid implemented as a system call?
body: <p>I'm in the middle of taking my first OS class, so hopefully I don't have any big misconceptions here.</p>
  
  <p>I was wondering why getpid() is implemented as a system call in Linux. As I understand it, certain functions are made into system calls because they access or change information that the OS might want to protect, so they are implemented as a system call in order to transfer control to the kernel.</p>
  
  <p>But as I understand it, getpid() is just returning the process id of the calling process. Is there any case where permission for this information wouldn't be granted? Wouldn't it be safe to simply let getpid() be a normal user function?</p>
  
  <p>Thanks for the help. </p>