您的位置:首页 > 移动开发

What's the difference and connection between API(Application Programming Interface) and SC(System Call)?

2011-05-17 15:46 429 查看
Q1.Why user program cannot access the services provided by kernel directly?

A1: For in linux, the space of program operating is divided by two.the one is kernel space,the other is user space.This two spaces are isolate in logic.So user program cannot access the kernel directly.

Q2. What is SC?

A2: SC is a special kind of interface. Through it, user can access the kernel.The System Call decided the position that user accesses.

Q3. What is API?

A3: API is application programming interface that make up by some predefined functions.There is no necessary connection between API and kernel.

Q4: Difference and connection between each other?

A4: Difference: SC needs to contact with kernel,but API don not.

Connection: An API may be needed one or more SCs to finish the specified function,or maybe do not. Simply speaking, when an api needs to access the kernel, system call is needed. or else not.

Above is reference to the blog of http://mwtx.blog.163.com/blog/static/389391292009102510154927/

Thanks a lot to the author.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: