Once more so that we understand what you mean, please.
Once more so that we understand what you mean, please.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
i just want to find out where i can put a printf to print the system call name that i just used.When i execute ls before see ls results i want to print am gonna execute :ls.what function starts when i type ls?
Are you confusing system calls with core utilities?
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
maybe i just want to know what happens when i press ls
Type
which ls
and it will tell you exactly which executable will be called.
Then look at the source for it.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee one last thing
how can i print the executable's name every time something is being executed?
I fail to see how that would be useful, but I suppose you'd have to look into the CRT implementation of the exec* family, track it down to the lowest common function and modify that to do what you want.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
is there any possibility to know exactly what function i have to modify?
You don't mean something like this, by any chance?how can i print the executable's name every time something is being executed?
[edit] Never mind, I obviously didn't read the thread properly. [/edit]Code:#include <stdio.h> int main(int argc, char *argv[]) { printf("%s\n", argv[0]); return 0; }
[edit=2] Maybe this will be useful: http://www.raspberryginger.com/jbail...8c-source.html [/edit]
Last edited by dwks; 04-02-2008 at 05:46 PM.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.