Simple C Language Question

Charles Steinkuehler charles at steinkuehler.net
Tue Nov 19 15:27:16 CST 2002


Scott Bowling wrote:
> Sorry if this is off topic but I figured it would be a simple question to
> answer.  My justification is because I have had the darnedest time trying to
> find a google answer
> 
> I am fairly new to C Language and have picked up a few books.  I'm also
> using plenty of examples to do with what I'd like to do.  However there is
> one thing I cannot find an answer for.  I've seen source code that use the
> "current" structure.  For example, current->pid returns the current PID.
> 
> I cannot find where this is defined anywhere.  I'd like to know what all the
> possible values I can call with this.
> 
> If anyone can recommend a good C site, I'd love it.  I've current got "The
> Programming Language" 2nd Edition as my starting point.

Hmm...I don't do that much application programming on linux, but since I 
didn't see any other answers, I'll take a stab at it.

It's hard to say exactly where the current structure comes from without 
seeing the code, but if it's not something directly defined and filled 
out by the application itself, it's probably part of the "standard" 
application environment provided by the C library/linker/loader, kind of 
like argc/argv.  To get details, start crawling backwards through the 
include files, looking for a structure definintion.

-- 
Charles Steinkuehler
charles at steinkuehler.net




More information about the Kclug mailing list