I am trying to pass the address of an int[] to a system call. However messages only have fields for char pointers.
I have tried converting the int pointer to a char pointer and back again but the results in the array are not correct.
int pidarray[j];
m.m1_p3 = (char*)pidarray;
Also I tried to store the address of the array as an integer and pass it through a message integer field.
int pidarray[j];
m.m1_i3 = &pidarray;
EDIT:
This will be a system call of my creation, aimed at filling an array with pids and copying the data back to the process hence why I need to pass the address of the array. I call the system call a so,
_syscall(PM_PROC_NR, GETCHILDPIDS, &m);
It fills an array and attempts to copy it back to memory space owned by the calling process. This is done as:
sys_vircopy(SELF, (vir_bytes) &test, who_e,(vir_bytes) m_in.m1_i3, sizeof(test));
where test is a int[].
How can I send the address of a int[] in this format?