Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-06-2004, 11:35 PM   #1
LQ Newbie
Registered: May 2004
Posts: 3

Rep: Reputation: 0
Unix Job Control in C [typo fixed]

I'm getting quite frustrated. I need help- and quick.

How do you move a background process to a foreground process? Basically, I am writing a shell. I want to implement built-in job control commands like bash's fg and bg. Can anyone help?

Last edited by apydia; 05-07-2004 at 07:33 AM.
Old 05-07-2004, 07:34 AM   #2
LQ Newbie
Registered: May 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Old 05-07-2004, 08:05 AM   #3
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
This is done by sending these signals to the processes:
SIGSTOP (stop)
SIGTSTP (keyboard stop)
SIGCONT (continue stopped process)

See "man bash" (search for "job control"), "man sigaction" and "man 7 signal" for more info.
Old 05-08-2004, 12:29 PM   #4
LQ Newbie
Registered: May 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Issuing these three signals to a background process does nothing. The process simply remains running in the background. I am looking to move a background process to the foreground.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
control job turned off greythorne SUSE / openSUSE 0 08-14-2005 03:58 AM
What is the most suitable job for LINUX/Unix my-unix-dream General 9 05-08-2005 09:36 PM
College Degree and UNIX/Linux admin job bru General 9 04-05-2005 07:25 PM
Job control King4lex Linux - Newbie 3 08-16-2004 01:50 PM
Just got a linux/unix job offer! trey85stang General 13 03-19-2004 08:46 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:10 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration