LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-17-2003, 09:51 PM   #1
Tarts
Member
 
Registered: Feb 2003
Distribution: Slackware 9.1 (exclusively) ;)
Posts: 344

Rep: Reputation: 30
A couple of non-functioning functions.


I cant seem to get these functions to work on my system, I would be much obliged if someone could compile/run them.

Code:
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
struct termios save_attr;
void set_terminal(void)
{
        struct termios set_attr;
        set_attr.c_lflag &= ~(ICANON|ECHO);
        tcgetattr(0, &save_attr);
        tcsetattr(0, TCSANOW, &set_attr);
}


void reset_terminal(void)
{
        tcsetattr(0, TCSANOW, &save_attr);
}

int main()
{
        char buf[100];
        printf("Enter your name...\n");
        set_terminal();
        fgets(buf, sizeof(buf), stdin);
        reset_terminal();
        printf("Your name is %s\n", buf);
        return 0;
}
Its official, what worked in Slackware 8.1 (above), does not work in 9.1. I would be interested to know why...

Last edited by Tarts; 12-17-2003 at 11:51 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
You must know the windows functioning. RonRice Linux - General 1 09-01-2005 05:19 AM
Converting php5 socket functions to php3 socket functions mrobertson Programming 0 06-23-2005 09:11 AM
Gnome's not functioning adelante Red Hat 1 09-28-2004 06:39 AM
pointers to functions/member functions champ Programming 2 03-28-2003 06:22 PM
Non Functioning Icons japple Linux - Newbie 6 03-03-2002 06:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration