Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gtty(3) [netbsd man page]

STTY(3) 						   BSD Library Functions Manual 						   STTY(3)

NAME
stty, gtty -- set and get terminal state (defunct) LIBRARY
Compatibility Library (libcompat, -lcompat) SYNOPSIS
#include <sgtty.h> stty(int fd, struct sgttyb *buf); gtty(int fd, struct sgttyb *buf); DESCRIPTION
These interfaces are obsoleted by ioctl(2). They are available from the compatibility library, libcompat. The stty() function sets the state of the terminal associated with fd. The gtty() function retrieves the state of the terminal associated with fd. To set the state of a terminal the call must have write permission. The stty() call is actually 'ioctl(fd, TIOCSETP, buf)', while the gtty() call is 'ioctl(fd, TIOCGETP, buf)'. See ioctl(2) and tty(4) for an explanation. DIAGNOSTICS
If the call is successful 0 is returned, otherwise -1 is returned and the global variable errno contains the reason for the failure. SEE ALSO
ioctl(2), tty(4) HISTORY
The stty() and gtty() functions appeared in 4.2BSD. BSD
June 4, 1993 BSD

Check Out this Related Man Page

IOCTL(2)							System Calls Manual							  IOCTL(2)

NAME
ioctl, stty, gtty - control device SYNOPSIS
#include <sgtty.h> ioctl(fildes, request, argp) struct sgttyb *argp; stty(fildes, argp) struct sgttyb *argp; gtty(fildes, argp) struct sgttyb *argp; DESCRIPTION
Ioctl performs a variety of functions on character special files (devices). The writeups of various devices in section 4 discuss how ioctl applies to them. For certain status setting and status inquiries about terminal devices, the functions stty and gtty are equivalent to ioctl(fildes, TIOCSETP, argp) ioctl(fildes, TIOCGETP, argp) respectively; see tty(4). The following two calls, however, apply to any open file: ioctl(fildes, FIOCLEX, NULL); ioctl(fildes, FIONCLEX, NULL); The first causes the file to be closed automatically during a successful exec operation; the second reverses the effect of the first. SEE ALSO
stty(1), tty(4), exec(2) DIAGNOSTICS
Zero is returned if the call was successful; -1 if the file descriptor does not refer to the kind of file for which it was intended. BUGS
Strictly speaking, since ioctl may be extended in different ways to devices with different properties, argp should have an open-ended dec- laration like union { struct sgttyb ...; ... } *argp; The important thing is that the size is fixed by `struct sgttyb'. ASSEMBLER
(ioctl = 54.) sys ioctl; fildes; request; argp (stty = 31.) (file descriptor in r0) stty; argp (gtty = 32.) (file descriptor in r0) sys gtty; argp IOCTL(2)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cronjob prob

Hi all I am getting the following error when i execute my cronjob : stty: : No such device or address stty: : No such device or address What could be the problem. Thanks Rahul (3 Replies)
Discussion started by: rahul123_libra
3 Replies

2. Shell Programming and Scripting

stty: : No such device or address

I encoutered the error "stty: : No such device or address" in the korn shell script log. I added STTY EARSE ^H in profile. why iam i getting that error in Korn shell Thanks nandinisagar (6 Replies)
Discussion started by: nandinisagar
6 Replies

3. UNIX for Dummies Questions & Answers

stty tcgetattr errors

Hi, I have an app that runs Oracle 8.1.7 residing on a AIX 4.3 ML 10 . preiodically app sends out a status log like the one displayed below. Lately I have noticed this stty:tcgetattr message in the log. Script that writes this output calls sqlplus, gets the required count and writes output to... (8 Replies)
Discussion started by: Student37
8 Replies

4. UNIX for Dummies Questions & Answers

CTRL/C does not work

Hi My CTRL/C does not work thought the STTY setting looks Ok Appreciate your assistance $stty -a speed 38400 baud; rows = 24; columns = 80; ypixels = 0; xpixels = 0; eucw 1:0:0:0, scrw 1:0:0:0 intr = ^c; quit = ^\; erase = ^?; kill = ^u; eof = ^d; eol = <undef>; eol2 = <undef>;... (10 Replies)
Discussion started by: zam
10 Replies

5. UNIX for Advanced & Expert Users

stty: : Not a typewriter -- Help please

Hi All, I have been runing the same set of program using the same auto profile for an year. Now when i run the same set of process , i getting the below error Not a terminal stty: : Not a typewriter stty: : Not a typewriter ksh: jil: not found ksh: sendevent: not found logout... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

6. Programming

How to set stty row and columns of the terminal through C program

Hi, I'm have a big problem with one of the C programs that I'm developping. actually, I'm trying to monitor the users' session in solaris. therefore, I have used the source code of the unix "script" command. but the problem is that, when i run that program, the stty settings are lost: speed... (4 Replies)
Discussion started by: saad26
4 Replies

7. Shell Programming and Scripting

stty error when script is called out of a cronjob

Hello, I'm trying to implement a script to call a third-party tool every so often and write the results to a file. If I run it interactively it works fine, but when it comes to run it out of a cronjob, I keep getting this error: stty: tcgetattr: a specified file does not support the... (3 Replies)
Discussion started by: fabiogilr
3 Replies

8. UNIX for Advanced & Expert Users

stty issues

Copy Paste Issue... Pasted some c**p of a excel...!! Sorry Guys. Please look Below for the issue. (4 Replies)
Discussion started by: grep_me
4 Replies

9. Shell Programming and Scripting

What does this really mean? "tty -s && stty istrip"

I am having hard time understanding what this really do to the environment? I do understand this part "tty -s && stty " but not "istrip" # stty command is executed only if a tty is attached to the process. # stty istrip : Strip input characters to 7 bits tty -s && stty istrip I am... (3 Replies)
Discussion started by: kchinnam
3 Replies

10. Shell Programming and Scripting

minicom works, but stty does not

Hi all, I have some trouble getting stty to talk to some serial/usb converter. Getting minicom to work was however quite simple after I entered the following settings in addition to its standard-setup: pu port /dev/ttyUSB0 pu baudrate 19200 pu bits 8 pu... (3 Replies)
Discussion started by: pa-trick
3 Replies

11. UNIX for Dummies Questions & Answers

STTY Columns Setting Environment Variable?

I am wondering about the following: stty columns 140 I have found that a number of times I need to set my display columns to a high number (such as 140) but I have to do this every time I login to use putty/ssh. Can we set this with an environmental variable so that it is permanent? Also... (4 Replies)
Discussion started by: newbie2010
4 Replies

12. Shell Programming and Scripting

Troubles with pipes, fork, and dup2

I want to execute metasploit by two pipes to communicate with it, but I have troubles with that communication. When I run my program, I get this error: "stty: standard input: Inappropriate ioctl for device" and I don't receive the metasploit promt. just select an exploit. This is my code:... (2 Replies)
Discussion started by: dano88
2 Replies

13. HP-UX

Serial standard communication (stty)

Hello friends, I am trying to communicate with a programmer memory from Unix (HP-UX) via serial port. Well, I have some code ready stty parameters to achieve communicating the device with the computer, but I have my doubts. I would like to know if you have some code fragment where you use the... (5 Replies)
Discussion started by: Monttanna
5 Replies

14. UNIX for Advanced & Expert Users

Stty help in korn shell

We are getting a following stty error when I am running a script. stty: standard input: Inappropriate ioctl for device I have some of following stty settings in my .profile. Tried other options still not able to fix it. stty rows 40 cols 130 erase ^? intr ^C export TERM=xterm stty... (6 Replies)
Discussion started by: srikanth38
6 Replies

15. UNIX for Beginners Questions & Answers

Stty raw mode

Hi, I'm writing a BBS terminal program. And have hit a major roadblock. My terminal works fine for every BBS out there, except Mystic BBSes. I've narrowed down the problem to the usage of the stty() command. The problem is so: I cannot use the arrow keys to select certain things on Mystic... (4 Replies)
Discussion started by: ignatius
4 Replies