get_process_zero_session_group(unsigned int *, int)
so that
a process can use it to get the global PIDs of all processes that are in the same login session of process 0.
If the number of processes in this login session
is larger than the value of the second parameter, such as SIZE, you only need to store the PIDs of the first SIZE processes.
The return value of this system call is either 0 or a positive value.
0 means that an error occurs when executing this system call. A positive value means the number of processes in this login session.
The first argument of this system call is used to store the result of this system call.
//prototype of the new system call is as follows:
int get_process_zero_session_group(unsigned int *, int)
#define SIZE 100
:
unsigned int results[SIZE];
int j,k;
:
k= get_process_zero_session_group(results, SIZE);
if(k)
{
printf("What follows are the PIDs of the processes that are in the same login sesson of process 0\n");
for(j=0; j<k && j<SIZE; j++)
printf("[%d] %u ",j,results[j]);
printf("\n");
}
else
printf("There is an error when executing this system call.\n");
:
get_process_session_group(unsigned int *, int)
so that a process
can use it to get the
local PIDs of all processes that are in the same login session as the process. If the number of processes in this login session
is larger than the value of the second parameter, such as SIZE, you only need to store the PIDs of the first SIZE processes.
The return value of this system call is either 0 or a positive value.
0 means that an error occurs when executing this system call. A positive value means the number of processes in this login session.
The first argument of this system call is used to store the result of this system call.
//prototype of the new system call is as follows:
int get_process_session_group(unsigned int *, int)
#define SIZE 100
:
unsigned int results[SIZE];
int j,k;
:
k= get_process_ession_group(results, SIZE);
if(k)
{
printf("What follows are the local PIDs of the processes that are in the same login sesson of this process.\n");
for(j=0; j<k && j<SIZE; j++)
printf("[%d] %u ",j,results[j]);
printf("\n");
}
else
printf("There is an error when executing this system call.\n");
:
copy_to_user()
to copy data to a user address buffer.