Jump to content
Excelsior Forums
qnr

tcgettattr questions

Recommended Posts

Hi, I'm trying to use some of the procedures in termios.def and not having a lot of luck.  Here is just one example.  I simply can't figure out how to use termios.tcgetattr - I always get an INVALID LOCATION  error either in the line containing it, or in the next line that contains a command.

In addition, how come the complier doesn't give me an error in the second usage?  I would think it would be flagged, since tcgetattr is a function.

MODULE readpassM2;

FROM termios IMPORT tcgetattr, termios;
FROM unistd IMPORT STDIN_FILENO;

FROM STextIO  IMPORT WriteLn;


VAR
  ts, ots : termios;
  return : INTEGER;

BEGIN

  return := tcgetattr( 0, ts );
  tcgetattr( STDIN_FILENO, ts);

  WriteLn;

END readpassM2.

Returns this:

$ ./readpassM2
#RTS: unhandled exception #3: invalid location 
     Source file   LineNo CodeOffset  Procedure name
readpass.mod   20        08048f42    main:F 
readpass.mod   18        08048e77   main:F

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×