tcgetsid(3) Library Functions Manual tcgetsid(3)NAME
tcgetsid - Returns the session ID of the terminal
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <termios.h>
pid_t tcgetsid( pid_t fildes);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
tcgetsid(): XSH4.2
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Specifies a terminal.
DESCRIPTION
The tcgetsid routine is a part of the general terminal interface. This routine obtains the session ID of the terminal as specified by the
fildes parameter.
RETURN VALUE
On success, the tcgetsid returns the session ID that is associated with the terminal specified. If the session ID of the terminal cannot
be obtained, a value of (pid_t)-1 is returned and errno is set to indicate error.
ERRORS
The tcgetsid() function sets errno to the specified values for the following conditions: The descriptor fildes is not associated with a
controlling terminal. The descriptor fildes is not valid. The file associated with fildes is not a terminal.
[Tru64 UNIX] The descriptor fildes is not associated with a character special device or the specified request does not apply to the
kind of object that fildes references.
RELATED INFORMATION
Standards: standards(5) delim off
tcgetsid(3)
Check Out this Related Man Page
tcgetsid(3C)tcgetsid(3C)NAME
tcgetsid() - get terminal session ID
SYNOPSIS DESCRIPTION
The function returns the value of the session ID of the foreground process associated with the terminal referenced by fildes. is allowed
from a process that is a member of a background process group (see termio(7)).
RETURN VALUE
Upon successful completion, returns the value of the session ID of the foreground process associated with the terminal referenced by
fildes. Otherwise, returns a value of and sets to indicate the error.
ERRORS
If the function fails, it sets (see errno(2)) to one of the following values:
[EACCES] The file associated with fildes is the controlling terminal of the calling process; however, there is no foreground
process group defined for the controlling terminal.
[EBADF] fildes is not a valid file descriptor.
[ENOTTY] The file associated with fildes is not the controlling terminal or the calling process does not have a controlling
terminal.
SEE ALSO getsid(2), setsid(2), tcgetpgrp(3C), thread_safety(5).
tcgetsid(3C)
Hi there,
Does anyone know what exactly is the different between a terminal and a console ?
My understanding is a console is normally a local session while a terminal can be a remote as well.
What do you think guys?
Thanks (1 Reply)
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)
Hello
a few Q's that if anyone knows the answer to i would be grateful:
:confused: when exiting a terminal session run through a windows environment i can either type exit or use ctrl +D. I was wondering if one way was a 'cleaner' method to exit then the other or whether it is executed the... (2 Replies)
I have put the file descriptor 1 to file, using command exec 1>>out.txt
Then I could not see any output on the screen, how could I restore the default output to terminal? :mad: Thanks (3 Replies)
Hello everyone. I want to create an alias of vi, so that everytime I use vi to edit something, it will open up a new terminal session, with the vi file that I want to edit. So for example if I enter:
sudo vi /etc/bashrc
This will open up a brand new terminal window, with the /etc/bashrc file... (1 Reply)
Hi Admins,
Just a small question - Can we have multiple session for single user on HMC.
e.g. Can I have a terminal session (via IE ) and command line (ssh) at same time ??
I am not sure whether it will impact HMC system or not. So want to make sure.
let me know folks.
Thanks (3 Replies)
Newbie with UNIX here.
Currently troubleshooting a UNIX terminal we have.
I determined it to be bad and swapped it out with a known good terminal. I went in and changed the IP address and host name to reflect the old terminal. Although now there is no connectivity.
I swapped out the NIC... (1 Reply)
Hi,
I'm trying to prompt twice on the same line but can't make it so far. I can prompt only once per line.
i.e.
read -p "Enter the two digits of your sum: " NUM1; read -p "+" NUM2
the result of above is:Enter the two digits of your sum: 5
+ 7
But I would like it to look something... (8 Replies)