TCSETPGRP(3) BSD Library Functions Manual TCSETPGRP(3)NAME
tcsetpgrp -- set foreground process group ID
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
tcsetpgrp(int fd, pid_t pgrp_id);
DESCRIPTION
If the process has a controlling terminal, the tcsetpgrp function sets the foreground process group ID associated with the terminal device to
pgrp_id. The terminal device associated with fd must be the controlling terminal of the calling process and the controlling terminal must be
currently associated with the session of the calling process. The value of pgrp_id must be the same as the process group ID of a process in
the same session as the calling process.
Upon successful completion, tcsetpgrp returns a value of zero.
ERRORS
If an error occurs, tcgetpgrp returns -1 and the global variable errno is set to indicate the error, as follows:
[EBADF] The fd argument is not a valid file descriptor.
[EINVAL] An invalid value of pgrp_id was specified.
[ENOTTY] The calling process does not have a controlling terminal, or the file represented by fd is not the controlling terminal,
or the controlling terminal is no longer associated with the session of the calling process.
[EPERM] The pgrp_id argument does not match the process group ID of a process in the same session as the calling process.
SEE ALSO setpgid(2), setsid(2), tcgetpgrp(3)STANDARDS
The tcsetpgprp function conforms to ISO/IEC 9945-1:1990 (``POSIX.1'').
BSD June 4, 1993 BSD
Check Out this Related Man Page
tcsetpgrp(3C) Standard C Library Functions tcsetpgrp(3C)NAME
tcsetpgrp - set foreground process group ID
SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
int tcsetpgrp(int fildes, pid_t pgid_id);
DESCRIPTION
If the process has a controlling terminal, tcsetpgrp() will set the foreground process group ID associated with the terminal to pgid_id.
The file associated with fildes must be the controlling terminal of the calling process and the controlling terminal must be currently
associated with the session of the calling process. The value of pgid_id must match a process group ID of a process in the same session as
the calling process.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The tcsetpgrp() function will fail if:
EBADF The fildes argument is not a valid file descriptor.
EINVAL This implementation does not support the value in the pgid_id argument.
ENOTTY The calling process does not have a controlling terminal, or the file is not the controlling terminal, or the controlling
terminal is no longer associated with the session of the calling process.
EIO The process is not ignoring or holding SIGTTOU and is a member of an orphaned process group.
EPERM The value of pgid_id does not match the process group ID of a process in the same session as the calling process.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-------------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-------------------------------+
|Interface Stability |Standard |
+-----------------------------+-------------------------------+
|MT-Level |MT-Safe, and Async-Signal-Safe |
+-----------------------------+-------------------------------+
SEE ALSO tcgetpgrp(3C), attributes(5), standards(5), termio(7I)SunOS 5.10 14 Aug 2002 tcsetpgrp(3C)
A programming running in tty0 crashes.
In a second terminal I kill all the processes.
Can i start the program again from this terminal?
Yes, I can, but it starts in tty1, and when i close the terminal, the program closes.
Now I want to start the program from tty1 in tty0, so i can close... (4 Replies)
hi everyone...
simple question,,,
if I open a new Xwindows session on terminal 8 would it be possible to hook my laptop to a desktop computer platformed with linux and run an alternate session from the desktop on my laptop (on terminal 8 ) ......?
is this impossible, impractical or too far... (1 Reply)
I setup termios structure with IGNBRK is not set and BRKINT is set.
To allow the process to receive signals I call: fcntl(fd, F_SETOWN, getpid());
I have made a signal handler to catch all signals. I can catch SIGINT when pressing ctrl+c but when I send break signal over serial then it cannot... (13 Replies)
Any one know the below means :
ps: no controlling terminal
I had run a script in background :
nohup ./benchmark.sh &
and shutdown my windows system from where i connected through SSH
I am using bash:
The above script perfoms various tasks of Benchmarking Repositories
Today the... (3 Replies)
Our Aix Unix has one issue.
If I type xedit &
after 30 minutes, xedit auto shut down.
If I type xedit
xedit will run forward.
I feel this & doesn't perform as it should be.
When I use &, system consider this process as idle.
How to fix this issue?
Does this mean unix env... (12 Replies)
Is there a general way I can use so as to process paths/files from your terminal without the need to backslash things?
Till recently I used to use
touch "file_here"
but it does not work if file_here contains any of the characters ` and ", I still need to backslash them if I want to make the... (1 Reply)
Hi all...
Consider me a dummy here...
I do not want any code or for anyone to show me how to do it at this time, but here is the question:-
I have had this brainstorm to be able to control the AudioScope.sh program in the "Shell Scripting And Programming" forum...
Is it possible, by... (4 Replies)
I am passing 3 runtime arguments to a shell script
$path crtl1 crtl2
the crtl files contains data(filename|date|count)
filename.txt|02/05/2010|10
The path contains the original data file,the code should fetch (filename|date|count) from original data file and it should match... (7 Replies)