<?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: Termios is freezing in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974983#M99290</link>
    <description>There is a function getpass() that will do all of this for you. Man getpass() for details.&lt;BR /&gt;&lt;BR /&gt;I suspect that your problem stems from the use of TCSANNOW rather than TCSAFLUSH.</description>
    <pubDate>Sat, 22 Apr 2006 16:55:48 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2006-04-22T16:55:48Z</dc:date>
    <item>
      <title>Termios is freezing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974981#M99288</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have the following small program which read password from user after echoing off. But the problem is, it is freezing for some time (not sure about the duration) before going to the next statement and I have to press "enter" multiple times (maximum 4, it is not consistent though). I am trying it on a hp-ux machine with aCC compiler.&lt;BR /&gt;&lt;BR /&gt;Any pointers/help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;TERMIOS.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include&lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;struct termios oldt,&lt;BR /&gt;newt;&lt;BR /&gt;char ch;&lt;BR /&gt;char userpasswd[50];&lt;BR /&gt;&lt;BR /&gt;printf("enter password:");&lt;BR /&gt;tcgetattr( STDIN_FILENO, &amp;amp;oldt );&lt;BR /&gt;newt = oldt;&lt;BR /&gt;newt.c_lflag &amp;amp;= ~( ICANON | ECHO );&lt;BR /&gt;tcsetattr( STDIN_FILENO, TCSANOW, &amp;amp;newt );&lt;BR /&gt;gets(userpasswd);&lt;BR /&gt;tcsetattr( STDIN_FILENO, TCSANOW, &amp;amp;oldt );&lt;BR /&gt;printf("\nPassword enetered %s\n", userpasswd);&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Reddy&lt;BR /&gt;Edit/Delete Message&lt;/STRING.H&gt;&lt;/UNISTD.H&gt;&lt;/TERMIOS.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Sat, 22 Apr 2006 06:06:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974981#M99288</guid>
      <dc:creator>hem c reddy</dc:creator>
      <dc:date>2006-04-22T06:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Termios is freezing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974982#M99289</link>
      <description>HI Reddy, &lt;BR /&gt;&lt;BR /&gt;You can try running your program under tusc to see where and what system call it hangs, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Sat, 22 Apr 2006 08:29:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974982#M99289</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-04-22T08:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Termios is freezing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974983#M99290</link>
      <description>There is a function getpass() that will do all of this for you. Man getpass() for details.&lt;BR /&gt;&lt;BR /&gt;I suspect that your problem stems from the use of TCSANNOW rather than TCSAFLUSH.</description>
      <pubDate>Sat, 22 Apr 2006 16:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974983#M99290</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-04-22T16:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Termios is freezing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974984#M99291</link>
      <description>I removed ICANON  from "newt.c_lflag &amp;amp;= ~( ICANON | ECHO )" and is not&lt;BR /&gt;working fine.&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your responses..&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Reddy</description>
      <pubDate>Thu, 27 Apr 2006 04:54:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974984#M99291</guid>
      <dc:creator>hem c reddy</dc:creator>
      <dc:date>2006-04-27T04:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Termios is freezing</title>
      <link>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974985#M99292</link>
      <description>I have got my problem solved</description>
      <pubDate>Thu, 27 Apr 2006 04:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/termios-is-freezing/m-p/4974985#M99292</guid>
      <dc:creator>hem c reddy</dc:creator>
      <dc:date>2006-04-27T04:58:51Z</dc:date>
    </item>
  </channel>
</rss>

