- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ioctl problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 12:12 AM
08-25-2005 12:12 AM
ioctl(file_num,TCGETA,&SS)
where the value of file_num is obtained by the sequence:
screen = fopen(ttyname(0),"w");
file_num = fileno(screen);
Some of the values in the structure SS are then modified, and the new values written back by
ioctl(file_num,TCSETAF,&SS);
On the old server this works perfectly well. On the new one this last ioctl call fails, setting errno to EPERM, unless you run the program as superuser.
It is obviously an issue of permissions somewhere, but we can't figure out where. Anyone got any ideas what we need to change? The only obvious difference that I can see between the way the 2 systems are handling terminals is that the pseudoterminal on the old HP is /dev/ttyp[1-f] whereas on the new one it seems to be /dev/pts/t[1-f] but it clearly isn't to do with the permissions of the devices in the /dev/pts directory because we tried changing those to no avail.
all contributions gratefully received!
paul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 01:41 AM
08-25-2005 01:41 AM
Re: ioctl problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 01:53 AM
08-25-2005 01:53 AM
Re: ioctl problem
paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 03:42 AM
08-25-2005 03:42 AM
Solutionscreen = fopen(ttyname(0),"w");
change it to:
screen = fopen(ttyname(0),"w+");
Hint: Think about what is involved in flushing and draining --- and before you say it, the old code was working by accident.
However, if this were me, I wouldn't bother with this file_num nonsense since all you are really doing (and doing it not quite right) is copying file descriptor 0 (stdin).
I would do this:
#define STDIN_FDES 0
and replace every instance of file_num with STDIN_FDES and get rid of the fopen() and the fileno() functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 06:21 PM
08-25-2005 06:21 PM
Re: ioctl problem
paul