Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use system function

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "how to use the system function", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use the system function" this article.

System function is a function closely related to the operating system, and users can use it to call various commands provided by the system in their own programs. The function prototype is as follows:

# include int system (const char * cmdstring)

System calls fork to produce a child process, and the child process calls / bin/sh-cmdstring to execute the command represented by the parameter cmdstring string, which returns to the called process immediately after the execution of this command. During the call to system, SIGCHLD signals are temporarily shelved, while SIGINT and SIGQUIT signals are ignored.

If the parameter cmdstring is a null pointer NULL, system returns a non-zero value only if the command processor is available, a feature that determines whether the system function is supported on a given operating system, and when 0 is returned, system is invalid.

For example:

# include#includevoid main () {int status; if ((status=system (NULL)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report