Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tcgetsid(3) [linux man page]

TCGETSID(3)						     Linux Programmer's Manual						       TCGETSID(3)

NAME
tcgetsid - get session ID SYNOPSIS
#define _XOPEN_SOURCE 500 /* See feature_test_macros(7) */ #include <termios.h> pid_t tcgetsid(int fd); DESCRIPTION
The function tcgetsid() returns the session ID of the current session that has the terminal associated to fd as controlling terminal. This terminal must be the controlling terminal of the calling process. RETURN VALUE
When fd refers to the controlling terminal of our session, the function tcgetsid() will return the session ID of this session. Otherwise, -1 is returned, and errno is set appropriately. ERRORS
EBADF fd is not a valid file descriptor. ENOTTY The calling process does not have a controlling terminal, or it has one but it is not described by fd. VERSIONS
tcgetsid() is provided in glibc since version 2.1. CONFORMING TO
POSIX.1-2001. NOTES
This function is implemented via the TIOCGSID ioctl(2), present since Linux 2.1.71. SEE ALSO
getsid(2) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2010-09-10 TCGETSID(3)

Check Out this Related Man Page

TCGETSID(3)						     Linux Programmer's Manual						       TCGETSID(3)

NAME
tcgetsid - get session ID SYNOPSIS
#define _XOPEN_SOURCE 500 #include <termios.h> pid_t tcgetsid(int fd); DESCRIPTION
The function tcgetsid() returns the session ID of the current session that has the terminal associated to fd as controlling terminal. This terminal must be the controlling terminal of the calling process. RETURN VALUE
When fd refers to the controlling terminal of our session, the function tcgetsid() will return the session ID of this session. Otherwise, -1 is returned, and errno is set appropriately. ERRORS
EBADF fd is not a valid file descriptor. ENOTTY The calling process does not have a controlling terminal, or it has one but it is not described by fd. VERSIONS
tcgetsid() is provided in glibc since version 2.1. CONFORMING TO
POSIX.1-2001. NOTES
This function is implemented via the TIOCGSID ioctl(2), present since Linux 2.1.71. SEE ALSO
getsid(2) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2008-06-14 TCGETSID(3)
Man Page

13 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

dt terminal

Hi:- Problem: How can I see Solaris CDE (graphic windows) through through Exceed session from my workstation. Any idea, comments or docs... (2 Replies)
Discussion started by: s_aamir
2 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. UNIX for Advanced & Expert Users

terminal 8/ new Xwindows session

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)
Discussion started by: moxxx68
1 Replies

4. UNIX for Dummies Questions & Answers

terminal sessions and certs

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)
Discussion started by: hu$h
2 Replies

5. Linux

Error on my Linux terminal

(2 Replies)
Discussion started by: gsabarinath
2 Replies

6. UNIX for Dummies Questions & Answers

how to run who am i from remote session

I just moved from AIX 4 to AIX 5.3. the command `who am i` is essential to our logon scripts; but it does not work anymore, it says the process is not attached to a terminal. Is it possible to run this command remotely? It works for remote root sessions. If it is not is there another way to... (2 Replies)
Discussion started by: raidzero
2 Replies

7. UNIX for Advanced & Expert Users

Reading putty command line parameters from Linux

I am running Putty 0.60 from Windows XP and I am connecting to a Linux box. I would like to be able to pass a command line parameter to my Linux session so that my Linux session can execute a specific command, depending on the command line parameter. I have looked on the Internet and tried... (1 Reply)
Discussion started by: SFNYC
1 Replies

8. UNIX for Advanced & Expert Users

Send Terminal

Odd question and i am not even sure if it is possible, but if there a way to sned your current terminal session to another worksataion so you or another person can carry on using it, background: Fedora system using kconsole as the terminal any thoughts, not really a massive but it has... (1 Reply)
Discussion started by: ab52
1 Replies

9. OS X (Apple)

Terminal autorunning commands at start

How do I make terminal autorun commands at start up? For example, I have several windows of terminal, I want one to automatically run 'top' and a couple others autorun 'man' pages. Is there any way I can do this? (1 Reply)
Discussion started by: randomtypos
1 Replies

10. 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

11. Red Hat

Alias to Open new terminal?

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)
Discussion started by: Lost in Cyberia
1 Replies

12. AIX

HMC login - Command line and terminal session

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)
Discussion started by: snchaudhari2
3 Replies

13. AIX

[Solved] Find command hangs my terminal session

Hello every one. I know little to nothing about AIX. Recently I have been assigned to an AIX project. For some reason or another the find command is hanging the server. Well it does not hand server per say, it just freezes my terminal session. after running find, I waited up to 40 min and... (3 Replies)
Discussion started by: busi386
3 Replies