location of header file definitions

This is a discussion on location of header file definitions within the C Programming forums, part of the General Programming Boards category; I am trying to modify the getpid() system call definition file for an assignment, however I am having trouble locating ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    96

    location of header file definitions

    I am trying to modify the getpid() system call definition file for an assignment, however I am having trouble locating where this file is. Could someone be able to tell me where the location of the headers are (always wondered that) and where I can find the actual definitions in the kernel. Thanks!

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,628
    Search the Web for "man getpid".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    399
    Try
    Code:
    locate unistd.h

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    96
    I ran the "locate unistd.h" command but all I am able to find after running that is the function declarations. what should I run with "locate" to find the definitions file?

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    399
    You'll have to download your systems C lib, which most likely is GLIBC: Index of /gnu/glibc

    cd into the main source code dir, and use:
    Code:
    find ./ -iname getpid.c

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 04:02 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21