Simple C Language Question

SABowling at dstsystems.com SABowling at dstsystems.com
Tue Nov 19 17:26:29 CST 2002


The only messing I want to do is really read from it.  However, would it
make sense that for whatever data I can pull from there I can get using
system calls?

Where I am getting all this from is the acct.c source for the BSD Process
Accounting.  I'm working on a kernel module that is similar to the BSD
Process Accounting function but I'd like to try and 'improve' upon it.

 In terms of effeciency, would doing a system call to _getpid be more
effecient than either current->pid and getpid(). Remember this is for a
kernel module.

Thanks for all your help.  It sounds like I didn't do enough research in
looking through the header files.

Thanks,
Scott

--------------------------------------------------------------------------------

Scott Bowling
Analyst Programmer
DST Systems
816.435.4447
SABowling at dstsystems.com

                                                                                        
                    "Jeremy                                                             
                    Fowler"              To:     "Scott Bowling"                        
                    <jfowler at westr        <sbowling at bowlingkyler.com>, "Kansas City     
                    ope.com>              Linux Users Group Mailing List"               
                                          <kclug at kclug.org>                             
                    11/19/2002           cc:                                            
                    10:06 AM             Subject:     RE: Simple C Language Question    
                                                                                        
                                                                                        

Also, you shouldn't mess with the task table unless you really know what
your
doing. If all you want is to get the current pid, use the getpid function
defined in the unistd.h file. See the getpid man file for more info.

> -----Original Message-----
> From: owner-kclug at marauder.illiana.net
> [mailto:owner-kclug at marauder.illiana.net]On Behalf Of Scott Bowling
> Sent: Monday, November 18, 2002 10:31 PM
> To: Kansas City Linux Users Group Mailing List
> Subject: Simple C Language Question
>
>
> 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.
>
> Thanks in advanced.
>
> Scott
>
>
>




More information about the Kclug mailing list