Find the answer to your Linux question:
Results 1 to 2 of 2
i was wondering..where can i find the files that have the implementation of the linux system calls such as fork() and wait()...where are they implemented?..i know they have a source ...
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Posts
    60

    system function implemetation file?

    i was wondering..where can i find the files that have the implementation of the linux system calls such as fork() and wait()...where are they implemented?..i know they have a source file somewhere in the root directory..but where exactly?

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Depending on just how much you installed of which distribution, you're not likely to see the implementation source code on your hard drive.

    But let's look at this question in more detail.

    The event in your user process which triggers a request to the kernel to do a fork, or a wait, or an open, or a read, or a whole collection of other errands, is what is known as a system call.

    When you include a fork() call in your code, that doesn't compile directly as a system call in your object file. It compiles as a call to a very thin library wrapper function called, um, fork. This wrapper function contains the system call.

    (Side note: there are companies out there who modify these wrapper functions for various useful, benign purposes.)

    Once the system call takes place, the kernel takes over and actually does the work.

    Which one do you want? That's related to just what you mean by "implementation".

    You can get more information about, and the source for, libc (glibc, actually) here.

    You can get more information about, and the source for, the kernel here. There is more information about the Linux kernel here.

    In each case, there will be plenty of documentation to guide you to the particular part of the source you're seeking.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...