WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=07a75e639063383e3ae673fb479a4b7d843da719

commit 07a75e639063383e3ae673fb479a4b7d843da719
Author: Raster <ras...@rasterman.com>
Date:   Sun Jun 21 23:17:27 2015 -0700

    Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 8dee97f..0e35c45 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -563,7 +563,35 @@ The difference between ABI and API is that API covers the 
interface in general b
 
 ==== System calls ====
 
-
+System calls are special API calls. They are almost all buried inside libc. 
Function calls here inside libc issue a special interrupt to switch into kernel 
mode and passing in parameters. Once switched into kernel mode, no application 
code is executing anymore. All code is from the kernel, and its job is to 
implement the functionality of the system call. This code runs in "kernel 
space" and basically has full privileges to do anything it likes. Kernels 
though will enforce access and secu [...]
+
+System calls are rather expensive. They can cost hundreds if not thousands of 
CPU cycles. Also once they return, your code will not run at full speed for a 
while, because Kernels will flush and empty caches, so the L1, L2 (and maybe 
L3) caches all need to warm up again. Avoid system calls if you can because 
they are far more expensive than a simple function call within an app or 
between an app and a library. Also be aware that context switches between 2 
processes or a page fault (swappin [...]
+
+A good [[http://man7.org/linux/man-pages/man2/syscalls.2.html|list of system 
calls can be found here]], but a common list of important ones is:
+
+  * open()
+  * close()
+  * read()
+  * write()
+  * lseek()
+  * stat()
+  * mmap()
+  * munmap()
+  * madvise()
+  * mprotect()
+  * fcntl()
+  * ioctl()
+  * connect()
+  * accept()
+  * bind()
+  * access()
+  * select()
+  * getpid()
+  * getuid()
+  * gettimeofday()
+  * clock_gettime/()
+  * time()
+  * mkdir()
 
 ----
 

-- 


Reply via email to