ioctl() fails to get window size from console login


 
Thread Tools Search this Thread
Operating Systems Solaris ioctl() fails to get window size from console login
# 1  
Old 12-01-2004
Question ioctl() fails to get window size from console login

Hi,

I need to get the console window size for an application, for which I used ioctl() by passing the TIOCGWINSZ parameter. The ioctl() function does not fail (returns non zero), but it could not get the window size (gets 0x0). When I tried to verify the window size by the stty -a command, the entry for the cols and lines shows 0. I guess the tty sub-system is not giving the correct window size. The behaviour is only in Solaris and from console login only. From xterm it works fine. In AIX also the program works fine. If anybody can help, kindly get back to me.

Regards,
Diganta
# 2  
Old 12-01-2004
The console uses a real tty driver, not a pseudo tty driver. You could plug an old asr 33 teletype into the serial port and use it as a (printing) terminal. What is the window size then? You can use TIOCSWINSZ to set the window size to whatever you like. Then TIOCGWINSZ will return that value. Combine the two, and you can set a default if the values are zero. This can be done in your shell's start up scripts with the tput and stty programs.
lines=`tput lines` will get the current value and
stty rows $lines will set the value. For columns, use "cols" in both commands.
# 3  
Old 12-24-2004
thanks

Thanks! My problem is solved.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Not able to login AIX server but able to login thru console.

Hi, i am able to login to AX server thru console but not able to login directly thru server. also the server is not ping-able with other server. filesystem is fine. and OS version is AIX 5.3. please let me know if you need any specific log. thx in advance. Scriptor (2 Replies)
Discussion started by: scriptor
2 Replies

2. UNIX for Advanced & Expert Users

nohup: can't detach from console: Inappropriate ioctl for device

Hi! I am getting a nohup issue on mac osx while trying to start a process through nohup in the startup script. nohup: can't detach from console: Inappropriate ioctl for device Please help! Thanks, Allan. (0 Replies)
Discussion started by: jacki
0 Replies

3. UNIX for Dummies Questions & Answers

How to change the window size of Linux console in VMware?

The console's window size in VMware is too small. How can I change it? I mean changing the window size of pseudo terminals such as tty1, not the kde desktop. I think it may be connected to resolution.But changing resolution in the menu.lst of grub doesn't work. Any ideas? Thanks. (4 Replies)
Discussion started by: vic005
4 Replies

4. AIX

Unable to Switch tasks when trying to open console window in HMC

Hi, I am trying to open a console window through the HMC. When I choose to do this the toolbar at the top left of the HMC screen show 'Open Terminal Window'. However when I click on it I am getting the error - "The tsak you want to switch to is an applet based task, which dowes not support... (1 Reply)
Discussion started by: jimthompson
1 Replies

5. UNIX for Dummies Questions & Answers

Unix Id from Window Login ID

Hello All, My Problem is -> How can we get UNIX id from open mail authentication (Windows ID) in UNIX. In following command we are using domain name, which may change in your reference. As, if we use following command. ypcat passwd | grep rohitp | cut -d: -f5 | cut -d, -f1 => we get... (0 Replies)
Discussion started by: pandey.rohit
0 Replies

6. UNIX for Advanced & Expert Users

How to clear a cluttered DDD console window ?

During debugging, usually after printing the backtrace, I find that the console window looks cluttered. How would I clear the console window, to have a fresh start ??? Note: By DDD, I mean the Data Display Debugger, which is a graphical front end for GDB (0 Replies)
Discussion started by: RipClaw
0 Replies

7. UNIX Desktop Questions & Answers

only root can login through X window

Dear Friends I'm using Hp-unix release b.11.11 and i'm facing a problem to login through telnet session. i can login only by user root but other users can not login. but if i use x window application like (reflection X) all users can login with no problem. please kindly advice me on how to... (0 Replies)
Discussion started by: hai_jab
0 Replies

8. Linux

Why is linux console window in VMWare so small?

I install linux in VMWare, but Its console window is too small, Its size is 80*25, I can't change it even though I use full srceen mode in VMWare.How can I do? please help me! Thanks! (3 Replies)
Discussion started by: ChaoZhang
3 Replies

9. UNIX for Advanced & Expert Users

exec login fails

Ladies and Gentlemen; I need your help in determining what has happened to one of my companies systems. Here is the scenario: System Ultra 5 with Solaris 2.6 and the latest patch cluster installed. Third party security person "hardened" the system yesterday. Now when I login into CDE and open a... (2 Replies)
Discussion started by: rambo15
2 Replies
Login or Register to Ask a Question