What is a system call in windows written in c? Cannot find an explanation on what it is in Google.
开发者_如何学CThat is what we are asked to do: Your assignment is to implement Windows utility named HeadTail that receives a file name and an integer N as its parameters, and output to the console (standard output) N first lines of the file followed by N last lines reversed.
All of the core windows APIs exported from kernel32.dll and advapi32.dll are typically considered system calls (there are others and there are lower level APIs but this will probably meet your requirements (the lower level APIs are undocumented and much harder to use)).
To use them in your C application, if you're using visual studio or the Windows SDK build environment, you simply have to add:
#include <windows.h>
to your source file. You can then make any of the API calls from your C program.
You might have to add kernel32.lib when linking your application.
http://en.wikipedia.org/wiki/System_call
In computing, a system call is how a program requests a service from an operating system's kernel that it does not normally have permission to run. System calls provide the interface between a process and the operating system. Most operations interacting with the system require permissions not available to a user level process, e.g. I/O performed with a device present on the system, or any form of communication with other processes requires the use of system calls.
For example fopen
is not a system call, and ReadFile
is .
Or more info at System call vs Function call
精彩评论