Once more so that we understand what you mean, please.
Printable View
Once more so that we understand what you mean, please.
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?
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.
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.
is there any possibility to know exactly what function i have to modify?
You don't mean something like this, by any chance?Quote:
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]