什么是之间和QUOT的区别;空调系统调用"和"的C库函数"? [英] What's the difference between "C system calls" and "C library routines"?

查看:134
本文介绍了什么是之间和QUOT的区别;空调系统调用"和"的C库函数"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有在联机手册多个部分。其中两个是:

There are multiple sections in the manpages. Two of them are:


2     Unix and C system calls
3     C Library routines for C programs

例如有<一个href=\"http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/getmntinfo.3.html\"><$c$c>getmntinfo(3)和<一个href=\"http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/getfsstat.2.html\"><$c$c>getfsstat(2),这两个看起来像他们做同样的事情。当一个人应该使用和的区别是什么?

For example there is getmntinfo(3) and getfsstat(2), both look like they do the same thing. When should one use which and what is the difference?

推荐答案

系统调用操作系统的功能,如在UNIX中,的 的malloc() 功能是建立在顶部 SBRK() 系统调用(用于调整进程的内存空间)。

System calls are operating system functions, like on UNIX, the malloc() function is built on top of the sbrk() system call (for resizing process memory space).

图书馆只应用code,这不是操作系统的一部分,往往会提供一个以上的操作系统。他们是基本相同的功能自己的程序中调用。

Libraries are just application code that's not part of the operating system and will often be available on more than one OS. They're basically the same as function calls within your own program.

该行可能会有点模糊,但只是查看系统调用内核级的功能。

The line can be a little blurry but just view system calls as kernel-level functionality.

这篇关于什么是之间和QUOT的区别;空调系统调用&QUOT;和&QUOT;的C库函数&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆