This article explains the mechanism to save file using sudo permissions if vim cannot write to it with current user credentials.
What is a System Call and a Library Function? How are they differ? Which of these is efficient? You will find answers for these questions in this post.
What is the difference between a Program, a Process and a Thread?