Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 04-05-2012, 04:51 AM   #1
LQ Newbie
Registered: Aug 2011
Location: Shanghai,China
Posts: 9

Rep: Reputation: Disabled
how did a system call invoke kernel call,ie: fwrite->sys_write

I have already been told the procedure of a system call,like this: in glibc,fopen->use the sysenter instruction to enter privilege level,and then call the function with prefix such as sys_,and waiting until job was done,and then it return to userspace.
I really don't like the description above,is there any one who can give me a more detail description.I'd appreciate if you describe the procedure in real source code,not the pseudo code.the following is the best,A() call B() ,B() call C(),C() call D() and so on.
Old 04-05-2012, 03:04 PM   #2
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,095
Blog Entries: 4

Rep: Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660Reputation: 3660
There are several ways that the system call can occur: the options are processor-specific but also may vary within a particular type of processor.

The user program's request, made through some kind of shared userspace library like glibc, will result in one or more system calls to request OS services. The kernel-side (filesystem driver) code will validate the request and break it down into one or more asynchronous request blocks which will track the progress of the approved request. The user process is flagged as "not runnable" so that the dispatcher will ignore it: the process therefore "stops running." Eventually, the process will be flagged as "runnable" again so that it once again becomes eligible to receive slices of processor time.
1 members found this post helpful.


glibc, kernel, system

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to write a system call which returns current system time using call by reference mukul2kul4 Debian 2 09-26-2011 12:17 AM
How to call system call from usb driver's code Mr.J Linux - Kernel 4 09-29-2008 04:47 AM
How can i make centos 4.5's system call using vDSO(call *%gs:0x10) instead of int80 tclwp Red Hat 3 08-06-2007 01:07 AM
problem in intercepting sys_write system call appas Programming 7 09-03-2004 01:33 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration