Was browsing the source code for sudo as provided on this site, and came across this super weird type signature (Bonus question: is there a more C-like term for "type signature"?) for main:
int main(argc, argv, envp) int argc; char **argv; char **envp; { I understand that the style itself is the oldskool K&R. What I'm really interested in is the fact that main is taking a bonus argument, char **envp. Why? sudo is a fairly standard command line tool and is invoked as such. How does the operating system know what to do when it comes across a main function that isn't defined with the usual (int argc, char *argv[])?
Many a time I myself have been lazy and just left off the arguments completely and whatever program I was writing would appear to work just fine (most dangerous thing that can happen with C, I know :p)
Another part of my question is, what cool stuff does all this allow you to do? I have a hunch it helps a heap with embedded programming, but I've sadly had minimal exposure to that and can't really say. I would love to see some concrete examples