Handle process arguments
This commit is contained in:
@ -30,10 +30,12 @@ void main(void) {
|
||||
|
||||
uprintf("Hello world using uprintf\n");
|
||||
|
||||
int32_t tb = processctl(-1, PCTL_SPAWN, (uint64_t)"base:/bin/tb");
|
||||
ipcpipe(tb, IPCPIPE_OUT, IPCPIPE_REPLACE, (uint8_t *)(uint64_t)processctl(-1, PCTL_GETPID, 0), IPCPIPE_OUT);
|
||||
processctl(tb, PCTL_RUN, 0);
|
||||
while(processctl(tb, PCTL_POLLSTATE, 0) != 2);
|
||||
const char *tbargs[] = { "-i" };
|
||||
int32_t tb = processctl(-1, PCTL_SPAWN, (uint64_t)"base:/bin/tb", (uint64_t)tbargs, 1);
|
||||
uint64_t selfpid = (uint64_t)processctl(-1, PCTL_GETPID, 0, 0, 0);
|
||||
ipcpipe(tb, IPCPIPE_OUT, IPCPIPE_REPLACE, (uint8_t *)selfpid, IPCPIPE_OUT);
|
||||
processctl(tb, PCTL_RUN, 0, 0, 0);
|
||||
while(processctl(tb, PCTL_POLLSTATE, 0, 0, 0) != 2);
|
||||
|
||||
if (ipcpipe(IPCPIPE_SELFPID, 10, IPCPIPE_MAKE, NULL, 0) < 0) {
|
||||
uprintf("failed to create 10th pipe\n");
|
||||
|
Reference in New Issue
Block a user