glibc庫函數,系統調用API
阿新 • • 發佈:2018-07-26
系統 mon 庫函數 get ces success glib bsp ret
glibc封裝了大部分系統API,我們一般都是使用glibc封裝的接口進行系統調用,碰到一些沒有封裝的接口,可以通過這個
函數syscall 進行系統調用。
1 /* Invoke `system call‘ number SYSNO, passing it the remaining arguments. 2 This is completely system-dependent, and not often useful. 3 4 In Unix, `syscall‘ sets `errno‘ for all errors and most calls return -15 for errors; in many systems you cannot pass arguments or get return 6 values for all system calls (`pipe‘, `fork‘, and `getppid‘ typically 7 among them). 8 9 In Mach, all system calls take normal arguments and always return an 10 error code (zero for success). */ 11 extern longint syscall (long int __sysno, ...) __THROW;
glibc庫函數,系統調用API