mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 10:09:26 +02:00
Merged revisions 1368 via svnmerge from
svn+ssh://peter@www.freepascal.org/FPC/svn/fpc/trunk r1368 (marco) * removed old BSD ifdefs git-svn-id: branches/fixes_2_0@1436 -
This commit is contained in:
parent
04ca9513ac
commit
39d6067dc8
@ -7,11 +7,7 @@
|
|||||||
|
|
||||||
Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
|
Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
TCGetAttr:=fpIOCtl(fd,TCGETS,@tios);
|
TCGetAttr:=fpIOCtl(fd,TCGETS,@tios);
|
||||||
{$else}
|
|
||||||
TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -19,17 +15,10 @@ Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint;
|
|||||||
var
|
var
|
||||||
nr:cint;
|
nr:cint;
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
case OptAct of
|
case OptAct of
|
||||||
TCSANOW : nr:=TCSETS;
|
TCSANOW : nr:=TCSETS;
|
||||||
TCSADRAIN : nr:=TCSETSW;
|
TCSADRAIN : nr:=TCSETSW;
|
||||||
TCSAFLUSH : nr:=TCSETSF;
|
TCSAFLUSH : nr:=TCSETSF;
|
||||||
{$else}
|
|
||||||
case OptAct of
|
|
||||||
TCSANOW : nr:=TIOCSETA;
|
|
||||||
TCSADRAIN : nr:=TIOCSETAW;
|
|
||||||
TCSAFLUSH : nr:=TIOCSETAF;
|
|
||||||
{$endif}
|
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
fpsetErrNo(ESysEINVAL);
|
fpsetErrNo(ESysEINVAL);
|
||||||
@ -43,21 +32,13 @@ end;
|
|||||||
|
|
||||||
Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
tios.c_cflag:=(tios.c_cflag and (not CBAUD)) or speed;
|
tios.c_cflag:=(tios.c_cflag and (not CBAUD)) or speed;
|
||||||
{$else}
|
|
||||||
tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
CFSetISpeed(tios,speed);
|
CFSetISpeed(tios,speed);
|
||||||
{$else}
|
|
||||||
tios.c_ospeed:=speed;
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -96,34 +77,18 @@ end;
|
|||||||
|
|
||||||
Function TCDrain(fd:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
Function TCDrain(fd:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
TCDrain:=fpIOCtl(fd,TCSBRK,pointer(1));
|
TCDrain:=fpIOCtl(fd,TCSBRK,pointer(1));
|
||||||
{$else}
|
|
||||||
TCDrain:=fpIOCtl(fd,TIOCDRAIN,0); {Should set timeout to 1 first?}
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
TCFlow:=fpIOCtl(fd,TCXONC,pointer(ptrint(act)));
|
TCFlow:=fpIOCtl(fd,TCXONC,pointer(ptrint(act)));
|
||||||
{$else}
|
|
||||||
case act OF
|
|
||||||
TCOOFF : TCFlow:=fpIoctl(fd,TIOCSTOP,0);
|
|
||||||
TCOOn : TCFlow:=fpIOctl(Fd,TIOCStart,0);
|
|
||||||
TCIOFF : {N/I}
|
|
||||||
end;
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCFlush(fd,qsel:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
Function TCFlush(fd,qsel:cint):cint; {$ifdef VER2_0}inline;{$endif}
|
||||||
begin
|
begin
|
||||||
{$ifndef BSD}
|
|
||||||
TCFlush:=fpIOCtl(fd,TCFLSH,pointer(ptrint(qsel)));
|
TCFlush:=fpIOCtl(fd,TCFLSH,pointer(ptrint(qsel)));
|
||||||
{$else}
|
|
||||||
TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(ptrint(qsel)));
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function IsATTY (Handle:cint):cint;
|
Function IsATTY (Handle:cint):cint;
|
||||||
|
Loading…
Reference in New Issue
Block a user