declaring a function as static..
- From: nass <athanasios.silis@xxxxxxxxx>
- Date: Thu, 27 Sep 2007 22:09:58 -0000
hello everyone,
i am using a hacked version of the utilities df and du to get the disk
free space and folder size respectively..
when i say hacked i mean i just got the df.c and du.c from core-utils
renamed their main() function to dfmain() and dumain(), commented out
all the printf statements (since i only wanted the numbers ) and i
compiled them along with my code....
problem is df and du as designed for one-off operation, that is the
program runs once, ends and its resources are freed by the OS (cause
it has alot of static declarations as i see in the sources)
on the contrary my program is running in a loop (its a processing
algorithm) so it appears that running the dfmain() or the dumain()
function from my code again and again consumes resources that do not
get freed..
is there a way to sort of declare the whole df.c and du.c as static?
so that they wont be loaded each time in the loop? i mean should i
make each variable and function static in those 2 files? would this
suffice? or is there smth additional / different needed... this is
obviously a non-neat solution... so i am open to suggestions about
acquiring the disk remaining free space and the folder size for my
program...
thank you in advance for your help
nass
.
- Follow-Ups:
- Re: declaring a function as static..
- From: fjblurt
- Re: declaring a function as static..
- From: Giorgos Keramidas
- Re: declaring a function as static..
- Prev by Date: Re: using fork and pipe
- Next by Date: Re: declaring a function as static..
- Previous by thread: What is the best way to program socket staticstics?
- Next by thread: Re: declaring a function as static..
- Index(es):
Relevant Pages
|