Sponsored Content
Full Discussion: Serial Lines Explained
Top Forums UNIX for Dummies Questions & Answers Serial Lines Explained Post 302912183 by Corona688 on Wednesday 6th of August 2014 11:56:56 AM
Old 08-06-2014
That's only half the story though. Serial ports in UNIX aren't just telecommunications, they're session control, job control, raw interaction.

I believe this all stems from the way terminals used to be used... You would login through a terminal, and that terminal would belong to you. Any processes you created would know what your terminal was(it would be your "controlling termina"). The kernel would know which processes were allowed to control it(foreground processes) or not allowed (background processes). Hitting ctrl-C would send SIGINT to processes belonging to your terminal. When you logged out, the group of processes belonging to that terminal would be killed.

Logging in through a remote teletype was almost the same, since it was an extension of the serial port. Modems had a few more signals, UNIX would know when a modem hung up for instance.

Having a "controlling terminal" does several things. For one thing, it means that all programs you run will be able to find out what your terminal is(they inherit their controlling terminal from you), and get direct access to it if they want it (by opening /dev/tty). This means that, even when you bury ssh in a 9-deep pipe chain, it can still go directly to the source and ask for your password. Or if /dev/tty can't be opened, they know there's no human there to ask for a password and just give up. If you ever see an error like "No tty present and no askpass program specified", that's what it means.

Last edited by Corona688; 08-06-2014 at 01:08 PM..
 

We Also Found This Discussion For You

1. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies
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)
All times are GMT -4. The time now is 10:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy