<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ioctl problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611705#M825091</link>
    <description>In migrating from HPUX 10.1 to HPUX 11.23, you sure that no upgrades in the application are required? This is a big jump between OS versions.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 25 Aug 2005 08:41:10 GMT</pubDate>
    <dc:creator>Rick Garland</dc:creator>
    <dc:date>2005-08-25T08:41:10Z</dc:date>
    <item>
      <title>ioctl problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611704#M825090</link>
      <description>Some colleagues and I are attempting (with limited Unix experience) to port a set of bespoke programs from an HP9000 D200 server running HP-UX 10.1 to a new HP workstation running 11.23. The server is accessed remotely using a telnet type interface, and one of the programs we are trying to port is a word-processing package. The package makes use of a termio structure SS to store the original terminal settings, obtained with an ioctl call&lt;BR /&gt;&lt;BR /&gt;ioctl(file_num,TCGETA,&amp;amp;SS)&lt;BR /&gt;&lt;BR /&gt;where the value of file_num is obtained by the sequence:&lt;BR /&gt;&lt;BR /&gt;screen = fopen(ttyname(0),"w");&lt;BR /&gt;file_num = fileno(screen);&lt;BR /&gt;&lt;BR /&gt;Some of the values in the structure SS are then modified, and the new values written back by&lt;BR /&gt;&lt;BR /&gt;ioctl(file_num,TCSETAF,&amp;amp;SS);&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;all contributions gratefully received!&lt;BR /&gt;&lt;BR /&gt;paul&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Aug 2005 07:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611704#M825090</guid>
      <dc:creator>Paul Blake_2</dc:creator>
      <dc:date>2005-08-25T07:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: ioctl problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611705#M825091</link>
      <description>In migrating from HPUX 10.1 to HPUX 11.23, you sure that no upgrades in the application are required? This is a big jump between OS versions.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Aug 2005 08:41:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611705#M825091</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-08-25T08:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: ioctl problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611706#M825092</link>
      <description>sorry, perhaps I should have been clearer. The WP package is something written in house by a programmer who is no longer available, and we are trying to recompile it from the source code, which contains the statements above. It compiles ok, but fails as described unless the person running it is superuser&lt;BR /&gt;&lt;BR /&gt;paul</description>
      <pubDate>Thu, 25 Aug 2005 08:53:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611706#M825092</guid>
      <dc:creator>Paul Blake_2</dc:creator>
      <dc:date>2005-08-25T08:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: ioctl problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611707#M825093</link>
      <description>The problem stems from this:&lt;BR /&gt;&lt;BR /&gt;screen = fopen(ttyname(0),"w");&lt;BR /&gt;change it to:&lt;BR /&gt;screen = fopen(ttyname(0),"w+");&lt;BR /&gt;&lt;BR /&gt;Hint: Think about what is involved in flushing and draining  --- and before you say it, the old code was working by accident.&lt;BR /&gt;&lt;BR /&gt;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).&lt;BR /&gt;&lt;BR /&gt;I would do this:&lt;BR /&gt;&lt;BR /&gt;#define STDIN_FDES 0&lt;BR /&gt;&lt;BR /&gt;and replace every instance of file_num with STDIN_FDES and get rid of the fopen() and the fileno() functions. &lt;BR /&gt;</description>
      <pubDate>Thu, 25 Aug 2005 10:42:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611707#M825093</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-08-25T10:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: ioctl problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611708#M825094</link>
      <description>brilliant, thank you very much&lt;BR /&gt;&lt;BR /&gt;paul</description>
      <pubDate>Fri, 26 Aug 2005 01:21:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ioctl-problem/m-p/3611708#M825094</guid>
      <dc:creator>Paul Blake_2</dc:creator>
      <dc:date>2005-08-26T01:21:39Z</dc:date>
    </item>
  </channel>
</rss>

