Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tcsetpgrp(3) [freebsd man page]

TCSETPGRP(3)						   BSD Library Functions Manual 					      TCSETPGRP(3)

NAME
tcsetpgrp -- set foreground process group ID LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #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. RETURN VALUES
The tcsetpgrp() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi- cate the error. ERRORS
The tcsetpgrp() function will fail if: [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 tcsetpgrp() function is expected to be compliant with the IEEE Std 1003.1-1988 (``POSIX.1'') specification. BSD
June 4, 1993 BSD

Check Out this Related Man Page

tcsetpgrp(3)						     Library Functions Manual						      tcsetpgrp(3)

NAME
tcsetpgrp - Sets foreground process group ID LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <unistd.h> int tcsetpgrp( int filedes, pid_t pgrp_id ); Application developers may want to specify an #include statement for <sys/types.h> before the one for <unistd.h> if programs are being developed for multiple platforms. The additional #include statement is not required on Tru64 UNIX systems or by ISO or X/Open standards, but may be required on other vendors' systems that conform to these standards. PARAMETERS
Specifies an open file descriptor. Specifies the process group identifier. DESCRIPTION
If the process has a controlling terminal, the tcsetpgrp() function sets the foreground process group ID associated with the terminal to the value of the pgrp_id parameter. The file associated with the filedes parameter 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 the pgrp_id parameter must match a process group ID of a process in the same session as the calling process. RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
The tcsetpgrp() function sets errno to the specified values for the following conditions: The filedes parameter is not a valid file descriptor. The pgrp_id parameter is invalid. The calling process does not have a controlling terminal, the file is not the controlling terminal, or the controlling terminal is no longer associated with the session of the calling process. The value of the pgrp_id parameter does not match the process group ID of a process in the same session as the calling process. RELATED INFORMATION
Functions: tcgetpgrp (3) Standards: standards(5) delim off tcsetpgrp(3)
Man Page

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Start process in shellscript at other terminal

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)
Discussion started by: benschell
4 Replies

2. Programming

controlling terminal

What is controlling terminal in the case of daemon process? (2 Replies)
Discussion started by: Madhu Babu
2 Replies

3. Programming

Cannot catch SIGINT while serial break condition occurs

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)
Discussion started by: gzz
13 Replies

4. Programming

Use of tcsetpgrp

Dear friends, kindly some one explain me the use of tcsetpgrp() function. I didn't understand it by reading man page. (1 Reply)
Discussion started by: nagalenoj
1 Replies

5. UNIX for Dummies Questions & Answers

A terminal controlling a terminal...

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)
Discussion started by: wisecracker
4 Replies

6. Shell Programming and Scripting

Multiple runtime arguments

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)
Discussion started by: Prashanth B
7 Replies