![]() Topic awaiting preservation: C++ help (Page 1 of 1) |
|
---|---|
Neurotic (0) Inmate Newly admitted From: |
![]() where would I post questions regarding some C++ code? |
Paranoid (IV) Inmate From: beyond the gray sky |
![]() first and foremost, welcome to the asylum. A nurse will be by shortly to administer your pills and make sure your straight jacket is nice and snug. |
Nervous Wreck (II) Inmate From: mn |
![]() I would guess the forum "Server-Side Scripting - Oh my! " would be the most apropriate, because it's the closest one I can see to c++ programming, and I believe cgi can be c++ programs. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() yeah, that would do it. And I'll move it there now. You'll be able to use the moved notice to go there. |
Maniac (V) Inmate From: Lebanon |
![]() Welcome Mister, |
Obsessive-Compulsive (I) Inmate From: |
![]() Thanks for the welcome. |
Obsessive-Compulsive (I) Inmate From: |
![]() After thinking about it a bit more, I think I can just fork() off a child process (the command to be sent to the background) and not wait for it to finish. I was thinking of maintaining a stack/array of processes sent to the background so that I can bring the most recent process sent to the background to the foreground via fg. |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
![]() Your idea to fork a child is going in the correct direction. After the fork, use one of the exec commands to execute the processes you want to run in the background. After the fork, both the parent and the child will continue to run more or less independently. On successful creation of the child, 'fork' will return the child's pid to the parent process and will return 0 to the child process. If not successful, the return value (to the parent only) is -1 and errno is set. |
Nervous Wreck (II) Inmate From: |
![]() I am writing a basic shell for a class, but the professor and TA are intentionally vague so I am looking for other places to garner the needed knowledge to write the shell. |