Comparison of Win32 API and UNIX system calls

Below given is a comparison of corresponding Win32 API and UNIX system calls:


Win32 API


System call

1. CreateProcess fork For creating a new process.
2. WaitForSingleObject waitpid For waiting a process to exit.
3. ExitProcess exit For terminating execution of a process.
4. CreateFile open For creating a file or for opening an already existing file.
5. CloseHandle close For closing a file.
6. ReadFile read For reading data from a file.
7. WriteFile write For writing data to a file.
8. SetFilePointer lseek For moving the file pointer.
9. GetFileAttributesEx stat For retrieving the file attributes.
10. CreateDirectory mkdir For creating a new directory.
11. RemoveDirectory rmdir For removing an empty directory.
12. DeleteFile unlink For deleting an existing file.
13. SetCurrentDirectory chdir For changing the current working directory
14. GetlocaiTime time For retrieving the current time

Leave a Reply