What does the group identification code and process identification code for the process under Linux mean?
Process Group ID: a process can belong to a process group. You can send a signal to a set of processes.
For the process group ID, in general, a process executes under the shell, which assigns the PID of the process to the process group ID of the process,
A child process derived from this process has the process group ID that the parent process belongs to, unless the parent process sets the owning group ID of the child process to the same as the PID of the child process.
I don't understand what the status value in the Wait function is.
The exit system calls the parameter status with an integer type, and we can use this parameter to pass the state at the end of the process, for example, if the process ends normally or some kind of unexpected end, in general,0 Indicates no unexpected normal end; other values indicate an error occurred and the process was not properly terminated. When we are actually programming, we can use the wait system call to receive the return value of the child process, thus dealing with different situations. We will cover the details of wait in a later space.
what is the value range of the C language rand ?
RAND () has a value range of [0 Rand_max]
Specifically related to the Rand_max size defined under Stdlib.h
Related to compiler implementations
int Randomprio (double from,double to) {//generates a random number between from and to
return 1+ (int) (to) *rand ()/(Rand_max+from));
}
The implementation of this function should be wrong
Some questions about doing the operating system experiment