[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can a program tell whether its argv[0] is 'ln -s' or a 'ln'




Thank you, all who have answered.

  Ok, so there is no shortcut around stat(). Can one rely on the info for
stat() being cached for long enough at the beginning to have time to parse
other args or must I stat among the 1st things that I do ? (do you know
this, or do I read the source as usual ?).

thx,

Peter

PS: What is an approved way to measure program startup overhead ? Can I
rely on spawn()-ing it and measuring the total time until it comes back,
maybe several times to get around oopses in cache lookups and cache fills 
? Is the info in process accounting structs reliable for this ? gprof ?

PS2: Ariel: There are ppl. out here who do not like to run their machines
at load 2.0 and above if they can help it. I'm one of them ;) Sorry for
the heater (was not a flame).