c - How do I know which exec command to use for a specific program? -


My question is about the ADF family of C system calls. How do I guess what type of program I am implementing, since then, the exec family has a different way between arg1, arg2, arg3 ... and its 2d char array for its parameters I see. Can most Linux command line programs handle both forms of input?

For example:

  int execl (const char * path, const char * arg0, ... / *, (four *) 0 * /); Intimate Exec (Constant Charles * Path, Four * Cost Agg []);   

What will happen if I execute the LS:

  execl ('/ bin / ls', 'ls', NULL);   

versus:

  execv ('/ bin / ls', lsArgsArray); Probably LS can handle both forms of input, but my actual question is generally general about other utilities, it is safe to believe that you can tell them in any way? If it is not safe to invoke any method, how does it happen, as if it is different to use besesh?   

The program executed, or the kernel, does not matter to whatever you say: both of them Has changed from your C library to the same system call. There is an extra step behind the executed program Kernel, there is also a less chance to see any difference in this way.

For precise kernel interface, look in the sources of the kernel or your platform C library.

Shell (Bash / Ash / CST / SH / ...) is not priviliged in any way, however, going directly into the API call you must give the name of a fake program.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -