Thanks a lot salem. I shall try out the different recommendations you've given. Get back again when I get something, probably next few days.
Cheers!
Type: Posts; User: QuietBoi
Thanks a lot salem. I shall try out the different recommendations you've given. Get back again when I get something, probably next few days.
Cheers!
Yup, indeed 'ps' can print out the PID and Parent PID of every process and I can construct the process hierarchy. Then again, that's input directly into command line terminal. Now I need to know to...
Yes, indeed I could miss some of them. That's why for development purposes, I purposely put busywait to be long, probably around 1 to 3 seconds.
But assuming I have no control over the content of...
I am creating a mini user-mode scheduler. Read in some tasks from a file and runs them.
When the process terminates, I output its command line and the process exit status. During execution, I want...
I've tried fopen /proc/[pid]/cmdline, but it returned me busywait instead.
Busywait actually creates a child process which run the command gcc Test.c in execvp
What I wanted is to capture that...
I have a program which forks out a child and run another program (busywait) using execvp. I hope to get the commands busywait invoked. (May refer to this thread for the program)
Take example,...
I think I should stop here since it is no longer related to readlink, digress off topic already. Post in a separate thread.
Thanks once again Salem!
Thank you very much Salem. Finally got it working. Million thanks!
Now another problem: To get the commands busywait invoked.
Take example, busywait creates a child process with the command...
Thanks a lot Salem, just figured it out during the numerous tryouts just now. Didn't know that it's just that simple. Haha... Guess I'm still very new in C.
But then, readlink still can't get the...
From the above codes, I added in more printf to print the child_pid and here's the result:
Child
In Child: Child pid: 2973
Parent
busywait program finished in 1 secs
Yes, I did. Included my codes at the earlier post, thought could save some space... Copy & paste here agian:
I've tried to execvp in the current child, and do the readlink in the parent after the...
Yes, I do have a function earlier which setenv to a PATH. So I should use execvp(busywait) instead and it would go to the PATH to search for the correct path.
I thought when using execvp, busywait...
This is the one which I have readlink() successfully printed out the path. It does gives me the path from the readlink, and the ./busywait program is executed. My idea is to get the path of the...
Oh I see. But how come the readlink before the execvp couldn't work?
The earlier version too, the "Child finished" also not pritned.
Thank you very much. =)
Thanks a lot Salem. Tried your suggestions, and it worked. So happy... However, the last line "Child Completed" still doesn't printe out. Humm...
Now I try to include the execvp to run ./busywait...
Hello...
I am working on a program and I don't quite understand why my last line "Child completed" is not printed out. My idea is to output for the main process in the task, (i) the executable and...