Instructions for using EXEC () to perform file series functions in Linux

Source: Internet
Author: User

Function Prototypes:

Describe:
The EXEC () series function replaces the current process image with a new process image.
There is no difference in how things work, only the way the parameters are passed.

Description
1. These 6 functions can be divided into two main categories: the Execl () series and the Execv () series.
2. ' l ' means that all parameters passed to the program are listed in sequence (list).
' V ' means putting all the parameters into a container (array, vector) and then passing in once.
Whether the list comes out or the vector them all, the last of the arguments must be a null pointer ((char*) 0).
3. EXECL () and EXECV () that do not end in P/E use the absolute Path (path) to execute the file given by the 1th parameter.
3. ' P ' means that the 1th parameter is located in the default environment variable path , and only the file name is indicated by the filename.
' E ' means that the 1th parameter is in the given ENVP environment variable . The pending file is given with an absolute path (path) .
4. Note arg0: should always be the file name to be executed, remember the main () function of the argv[0] is what?

Example:

Example code: HTTP://ALIOSS.TWOFEI.COM/LINUX/BEGIN/EXEC.C

Instructions for using EXEC () to perform file series functions in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.