get_ns_level()
so that a process can use it to get the
level of its PID name space. The return value of this system is the level of the PID name space of the process executing
this system call.
//prototype of the new system call is as follows:
int get_ns_level()
int get_pdps_of_pid_at_ancestor_ns(struct pdps_with_pid_at_ancestor_ns * , long)
with the following properties.
struct pdps_with_pid_at_ancestor_ns
{
long process_descriptor_pointer; //used to store the process descriptor pointer of a process with local PID specified as
//the second parameter of this system call
};
//prototype of the new system call is as follows:
int get_pdps_of_pid_at_ancestor_ns(struct pdps_with_pid_at_ancestor_ns * , long)
:
struct pdps_with_pid_at_ancestor_ns twenty_results[20];
long pid;
int result,k;
:
result = get_pdps_of_pid_at_ancestor_ns(twenty_results, pid);
if(k!=-1)
for(k=0; k<result; k++)
printf("At level %d, process descriptor pointer %u has local PID %d\n", k, twenty_results[k], pid);
printf("\n");
else
printf("No Ancestor PID name has a process with local PID %d\n", pid);
:
struct pdps_with_pid_at_ancestor_ns *
which is described in the above code excerpt.
i
and is an ancestor name space of the
PID name space of the process executing this system call, at element [i]
of the
first parameter, store the process descriptor pointer of the process in this PID name space and with local PID specified
as the second parameter of this system call.
j
does not have a process with
local PID specified as the second parameter of this system call, store 0 at
element [j]
of the first parameter.
copy_to_user()
to copy data to a user address buffer.