The code in the Resetstd method in work.php in Workerman is as follows Public Static functionresetstd () {if(!Static::$daemonize||Static::$_os!== ' Linux ') { return; } Global $STDOUT,$STDERR; $handle=fopen(Static::$stdoutFile, "a")
Now we can analyze the source code of Linux kernel.Ii. inheritance between fork () and stderr and stdio. stdout in execve ()In fact, it seems that the word "inherit" is not accurate. To be more accurate, replication may be more appropriate.First,
File descriptor abbreviation Description0 STDIN Standard Input1 STDOUT Standard output2 STDERR standard Error1. STDINcan come from the keyboard and can be entered from a redirected file.1 Cat 2 a #从键盘输入 3a #输出 4b #从键盘输入 5b #输出 6
Stdout and stderr are both built-in files in Unix/Linux systems. Together with stdin, they are automatically generated after each process is started. The numbers are 0, 1, and 2.
It should be noted that for stdout, This is a file stream with a
Preface
In Linux, all devices are regarded as files. Each time a file is opened, there is a file descriptor that represents the file to be opened. When the program starts, three I/O device files are opened by default: stdin, stdout, and stderr. The
Transplantation of Linux-2.6.32.2 Kernel on mini2440 (18th) --- converting uart2 into a common serial port driver
Port Environment (Bold font in redIs the modified content,Blue bold ChineseFor special attention)
1. host environment: centos 5.5 and 1
Article Title: Linux redirection details. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I/O redirection
> and when it comes to I/O redirection, let's get to know file descriptor (FD) first. The operation of the program, in most cases, is the processing of data (data), which is read from where? And where to send it? This is the function of file
Introduction to Linux programming-Message Management-Linux general technology-Linux programming and kernel information. For details, see the following. Process Communication (IPC) in Linux)
Process Communication (IPC) in Linux)
POSIX unknown
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.