如何使子进程在后台运行到前台 [英] How to bring a child process running in the background to the foreground

查看:426
本文介绍了如何使子进程在后台运行到前台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用fork()和execv()生成几个子进程在后台运行,我想把它们中的一个到前台,我该怎么办?

If I used fork() and execv() to spawn several child processes running in the background and I wanted to bring one of them to the foreground, how could I do that?

我试图写一个shell,可以在前台或后台启动进程。

I am trying to write a shell that can start processes either in the foreground or background.

推荐答案

和foreground不是一般用于进程的术语,而只适用于可以按需等待作业的shell。

"Background" and "foreground" are not terms used generically for processes, but rather only apply to shells which can wait for jobs on demand.

这篇关于如何使子进程在后台运行到前台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆