sysunix.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt,
  5. member of the Free Pascal development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. { These things are set in the makefile, }
  13. { But you can override them here.}
  14. { If you use an aout system, set the conditional AOUT}
  15. { $Define AOUT}
  16. {$I system.inc}
  17. { used in syscall to report errors.}
  18. var
  19. Errno : longint;
  20. { Include constant and type definitions }
  21. {$i errno.inc } { Error numbers }
  22. {$i sysnr.inc } { System call numbers }
  23. {$i sysconst.inc } { Miscellaneous constants }
  24. {$i systypes.inc } { Types needed for system calls }
  25. { Read actual system call definitions. }
  26. {$i signal.inc}
  27. {$i syscalls.inc }
  28. {*****************************************************************************
  29. Misc. System Dependent Functions
  30. *****************************************************************************}
  31. procedure prthaltproc;external name '_haltproc';
  32. procedure System_exit;
  33. begin
  34. {$ifdef i386}
  35. asm
  36. jmp prthaltproc
  37. end;
  38. {$else}
  39. asm
  40. jmp prthaltproc
  41. end;
  42. {$endif}
  43. End;
  44. Function ParamCount: Longint;
  45. Begin
  46. Paramcount:=argc-1
  47. End;
  48. Function ParamStr(l: Longint): String;
  49. var
  50. link,
  51. hs : string;
  52. i : longint;
  53. begin
  54. if l=0 then
  55. begin
  56. str(sys_getpid,hs);
  57. hs:='/proc/'+hs+'/exe'#0;
  58. i:=Sys_readlink(@hs[1],@link[1],high(link));
  59. { it must also be an absolute filename, linux 2.0 points to a memory
  60. location so this will skip that }
  61. if (i>0) and (link[1]='/') then
  62. begin
  63. link[0]:=chr(i);
  64. paramstr:=link;
  65. end
  66. else
  67. paramstr:=strpas(argv[0]);
  68. end
  69. else
  70. if (l>0) and (l<argc) then
  71. paramstr:=strpas(argv[l])
  72. else
  73. paramstr:='';
  74. end;
  75. Procedure Randomize;
  76. Begin
  77. randseed:=sys_time;
  78. End;
  79. {*****************************************************************************
  80. Heap Management
  81. *****************************************************************************}
  82. var
  83. _HEAP : longint;external name 'HEAP';
  84. _HEAPSIZE : longint;external name 'HEAPSIZE';
  85. function getheapstart:pointer;assembler;
  86. {$ifdef i386}
  87. asm
  88. leal _HEAP,%eax
  89. end ['EAX'];
  90. {$else}
  91. asm
  92. lea.l _HEAP,a0
  93. move.l a0,d0
  94. end;
  95. {$endif}
  96. function getheapsize:longint;assembler;
  97. {$ifdef i386}
  98. asm
  99. movl _HEAPSIZE,%eax
  100. end ['EAX'];
  101. {$else}
  102. asm
  103. move.l _HEAPSIZE,d0
  104. end ['D0'];
  105. {$endif}
  106. {$ifdef bsd}
  107. Function sbrk(size : longint) : Longint;
  108. CONST MAP_PRIVATE =2;
  109. MAP_ANONYMOUS =$1000; {$20 under linux}
  110. begin
  111. Sbrk:=do_syscall(syscall_nr_mmap,0,size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0,0);
  112. if ErrNo<>0 then
  113. Sbrk:=0;
  114. end;
  115. {$else}
  116. Function sbrk(size : longint) : Longint;
  117. type
  118. tmmapargs=packed record
  119. address : longint;
  120. size : longint;
  121. prot : longint;
  122. flags : longint;
  123. fd : longint;
  124. offset : longint;
  125. end;
  126. var
  127. t : syscallregs;
  128. mmapargs : tmmapargs;
  129. begin
  130. mmapargs.address:=0;
  131. mmapargs.size:=Size;
  132. mmapargs.prot:=3;
  133. mmapargs.flags:=$22;
  134. mmapargs.fd:=-1;
  135. mmapargs.offset:=0;
  136. t.reg2:=longint(@mmapargs);
  137. Sbrk:=syscall(syscall_nr_mmap,t);
  138. if ErrNo<>0 then
  139. Sbrk:=0;
  140. end;
  141. {$endif}
  142. { include standard heap management }
  143. {$I heap.inc}
  144. {*****************************************************************************
  145. Low Level File Routines
  146. *****************************************************************************}
  147. {
  148. The lowlevel file functions should take care of setting the InOutRes to the
  149. correct value if an error has occured, else leave it untouched
  150. }
  151. Procedure Errno2Inoutres;
  152. {
  153. Convert ErrNo error to the correct Inoutres value
  154. }
  155. begin
  156. if ErrNo=0 then { Else it will go through all the cases }
  157. exit;
  158. case ErrNo of
  159. Sys_ENFILE,
  160. Sys_EMFILE : Inoutres:=4;
  161. Sys_ENOENT : Inoutres:=2;
  162. Sys_EBADF : Inoutres:=6;
  163. Sys_ENOMEM,
  164. Sys_EFAULT : Inoutres:=217;
  165. Sys_EINVAL : Inoutres:=218;
  166. Sys_EPIPE,
  167. Sys_EINTR,
  168. Sys_EIO,
  169. Sys_EAGAIN,
  170. Sys_ENOSPC : Inoutres:=101;
  171. Sys_ENAMETOOLONG,
  172. Sys_ELOOP,
  173. Sys_ENOTDIR : Inoutres:=3;
  174. Sys_EROFS,
  175. Sys_EEXIST,
  176. Sys_EACCES : Inoutres:=5;
  177. Sys_ETXTBSY : Inoutres:=162;
  178. end;
  179. end;
  180. Procedure Do_Close(Handle:Longint);
  181. Begin
  182. sys_close(Handle);
  183. End;
  184. Procedure Do_Erase(p:pchar);
  185. Begin
  186. sys_unlink(p);
  187. Errno2Inoutres;
  188. End;
  189. Procedure Do_Rename(p1,p2:pchar);
  190. Begin
  191. sys_rename(p1,p2);
  192. Errno2Inoutres;
  193. End;
  194. Function Do_Write(Handle,Addr,Len:Longint):longint;
  195. Begin
  196. repeat
  197. Do_Write:=sys_write(Handle,pchar(addr),len);
  198. until ErrNo<>Sys_EINTR;
  199. Errno2Inoutres;
  200. if Do_Write<0 then
  201. Do_Write:=0;
  202. End;
  203. Function Do_Read(Handle,Addr,Len:Longint):Longint;
  204. Begin
  205. repeat
  206. Do_Read:=sys_read(Handle,pchar(addr),len);
  207. until ErrNo<>Sys_EINTR;
  208. Errno2Inoutres;
  209. if Do_Read<0 then
  210. Do_Read:=0;
  211. End;
  212. Function Do_FilePos(Handle: Longint): Longint;
  213. Begin
  214. Do_FilePos:=sys_lseek(Handle, 0, Seek_Cur);
  215. Errno2Inoutres;
  216. End;
  217. Procedure Do_Seek(Handle,Pos:Longint);
  218. Begin
  219. sys_lseek(Handle, pos, Seek_set);
  220. End;
  221. Function Do_SeekEnd(Handle:Longint): Longint;
  222. begin
  223. Do_SeekEnd:=sys_lseek(Handle,0,Seek_End);
  224. end;
  225. {$ifdef BSD}
  226. Function Do_FileSize(Handle:Longint): Longint;
  227. var
  228. Info : Stat;
  229. Begin
  230. if do_SysCall(syscall_nr_fstat,handle,longint(@info))=0 then
  231. Do_FileSize:=Info.Size
  232. else
  233. Do_FileSize:=0;
  234. Errno2Inoutres;
  235. End;
  236. {$ELSE}
  237. Function Do_FileSize(Handle:Longint): Longint;
  238. var
  239. regs : Syscallregs;
  240. Info : Stat;
  241. Begin
  242. regs.reg2:=Handle;
  243. regs.reg3:=longint(@Info);
  244. if SysCall(SysCall_nr_fstat,regs)=0 then
  245. Do_FileSize:=Info.Size
  246. else
  247. Do_FileSize:=0;
  248. Errno2Inoutres;
  249. End;
  250. {$endif}
  251. Procedure Do_Truncate(Handle,Pos:longint);
  252. {$ifndef bsd}
  253. var
  254. sr : syscallregs;
  255. {$endif}
  256. begin
  257. {$ifdef bsd}
  258. do_syscall(syscall_nr_ftruncate,handle,pos,0);
  259. {$else}
  260. sr.reg2:=Handle;
  261. sr.reg3:=Pos;
  262. syscall(syscall_nr_ftruncate,sr);
  263. {$endif}
  264. Errno2Inoutres;
  265. end;
  266. Procedure Do_Open(var f;p:pchar;flags:longint);
  267. {
  268. FileRec and textrec have both Handle and mode as the first items so
  269. they could use the same routine for opening/creating.
  270. when (flags and $100) the file will be append
  271. when (flags and $1000) the file will be truncate/rewritten
  272. when (flags and $10000) there is no check for close (needed for textfiles)
  273. }
  274. var
  275. oflags : longint;
  276. Begin
  277. { close first if opened }
  278. if ((flags and $10000)=0) then
  279. begin
  280. case FileRec(f).mode of
  281. fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
  282. fmclosed : ;
  283. else
  284. begin
  285. inoutres:=102; {not assigned}
  286. exit;
  287. end;
  288. end;
  289. end;
  290. { reset file Handle }
  291. FileRec(f).Handle:=UnusedHandle;
  292. { We do the conversion of filemodes here, concentrated on 1 place }
  293. case (flags and 3) of
  294. 0 : begin
  295. oflags :=Open_RDONLY;
  296. FileRec(f).mode:=fminput;
  297. end;
  298. 1 : begin
  299. oflags :=Open_WRONLY;
  300. FileRec(f).mode:=fmoutput;
  301. end;
  302. 2 : begin
  303. oflags :=Open_RDWR;
  304. FileRec(f).mode:=fminout;
  305. end;
  306. end;
  307. if (flags and $1000)=$1000 then
  308. oflags:=oflags or (Open_CREAT or Open_TRUNC)
  309. else
  310. if (flags and $100)=$100 then
  311. oflags:=oflags or (Open_APPEND);
  312. { empty name is special }
  313. if p[0]=#0 then
  314. begin
  315. case FileRec(f).mode of
  316. fminput :
  317. FileRec(f).Handle:=StdInputHandle;
  318. fminout, { this is set by rewrite }
  319. fmoutput :
  320. FileRec(f).Handle:=StdOutputHandle;
  321. fmappend :
  322. begin
  323. FileRec(f).Handle:=StdOutputHandle;
  324. FileRec(f).mode:=fmoutput; {fool fmappend}
  325. end;
  326. end;
  327. exit;
  328. end;
  329. { real open call }
  330. FileRec(f).Handle:=sys_open(p,oflags,438);
  331. if (ErrNo=Sys_EROFS) and ((OFlags and Open_RDWR)<>0) then
  332. begin
  333. Oflags:=Oflags and not(Open_RDWR);
  334. FileRec(f).Handle:=sys_open(p,oflags,438);
  335. end;
  336. Errno2Inoutres;
  337. End;
  338. Function Do_IsDevice(Handle:Longint):boolean;
  339. {
  340. Interface to Unix ioctl call.
  341. Performs various operations on the filedescriptor Handle.
  342. Ndx describes the operation to perform.
  343. Data points to data needed for the Ndx function. The structure of this
  344. data is function-dependent.
  345. }
  346. var
  347. {$ifndef BSD}
  348. sr: SysCallRegs;
  349. {$endif}
  350. Data : array[0..255] of byte; {Large enough for termios info}
  351. begin
  352. {$ifdef BSD}
  353. Do_IsDevice:=(do_SysCall(syscall_nr_ioctl,handle,$5413,longint(@data))=0);
  354. {$else}
  355. sr.reg2:=Handle;
  356. sr.reg3:=$5401; {=TCGETS}
  357. sr.reg4:=Longint(@Data);
  358. Do_IsDevice:=(SysCall(Syscall_nr_ioctl,sr)=0);
  359. {$endif}
  360. end;
  361. {*****************************************************************************
  362. UnTyped File Handling
  363. *****************************************************************************}
  364. {$i file.inc}
  365. {*****************************************************************************
  366. Typed File Handling
  367. *****************************************************************************}
  368. {$i typefile.inc}
  369. {*****************************************************************************
  370. Text File Handling
  371. *****************************************************************************}
  372. {$DEFINE SHORT_LINEBREAK}
  373. {$DEFINE EXTENDED_EOF}
  374. {$i text.inc}
  375. {*****************************************************************************
  376. Directory Handling
  377. *****************************************************************************}
  378. Procedure MkDir(Const s: String);[IOCheck];
  379. Var
  380. Buffer: Array[0..255] of Char;
  381. Begin
  382. If (s='') or (InOutRes <> 0) then
  383. exit;
  384. Move(s[1], Buffer, Length(s));
  385. Buffer[Length(s)] := #0;
  386. sys_mkdir(@buffer, 511);
  387. Errno2Inoutres;
  388. End;
  389. Procedure RmDir(Const s: String);[IOCheck];
  390. Var
  391. Buffer: Array[0..255] of Char;
  392. Begin
  393. If (s='') or (InOutRes <> 0) then
  394. exit;
  395. Move(s[1], Buffer, Length(s));
  396. Buffer[Length(s)] := #0;
  397. sys_rmdir(@buffer);
  398. Errno2Inoutres;
  399. End;
  400. Procedure ChDir(Const s: String);[IOCheck];
  401. Var
  402. Buffer: Array[0..255] of Char;
  403. Begin
  404. If (s='') or (InOutRes <> 0) then
  405. exit;
  406. Move(s[1], Buffer, Length(s));
  407. Buffer[Length(s)] := #0;
  408. sys_chdir(@buffer);
  409. Errno2Inoutres;
  410. End;
  411. procedure GetDir (DriveNr: byte; var Dir: ShortString);
  412. var
  413. thisdir : stat;
  414. rootino,
  415. thisino,
  416. dotdotino : longint;
  417. rootdev,
  418. thisdev,
  419. dotdotdev : {$ifdef bsd}longint{$else}word{$endif};
  420. thedir,dummy : string[255];
  421. dirstream : pdir;
  422. d : pdirent;
  423. mountpoint,validdir : boolean;
  424. predot : string[255];
  425. begin
  426. drivenr:=0;
  427. dir:='';
  428. thedir:='/'#0;
  429. if sys_stat(@thedir[1],thisdir)<0 then
  430. exit;
  431. rootino:=thisdir.ino;
  432. rootdev:=thisdir.dev;
  433. thedir:='.'#0;
  434. if sys_stat(@thedir[1],thisdir)<0 then
  435. exit;
  436. thisino:=thisdir.ino;
  437. thisdev:=thisdir.dev;
  438. { Now we can uniquely identify the current and root dir }
  439. thedir:='';
  440. predot:='';
  441. while not ((thisino=rootino) and (thisdev=rootdev)) do
  442. begin
  443. { Are we on a mount point ? }
  444. dummy:=predot+'..'#0;
  445. if sys_stat(@dummy[1],thisdir)<0 then
  446. exit;
  447. dotdotino:=thisdir.ino;
  448. dotdotdev:=thisdir.dev;
  449. mountpoint:=(thisdev<>dotdotdev);
  450. { Now, Try to find the name of this dir in the previous one }
  451. dirstream:=opendir (@dummy[1]);
  452. if dirstream=nil then
  453. exit;
  454. repeat
  455. d:=sys_readdir (dirstream);
  456. validdir:=false;
  457. if (d<>nil) and
  458. (not ((d^.name[0]='.') and ((d^.name[1]=#0) or ((d^.name[1]='.')
  459. and (d^.name[2]=#0))))) and
  460. (mountpoint or (d^.ino=thisino)) then
  461. begin
  462. dummy:=predot+'../'+strpas(@(d^.name[0]))+#0;
  463. validdir:=not (sys_stat (@(dummy[1]),thisdir)<0);
  464. end
  465. else
  466. validdir:=false;
  467. until (d=nil) or
  468. ((validdir) and (thisdir.dev=thisdev) and (thisdir.ino=thisino) );
  469. { At this point, d.name contains the name of the current dir}
  470. if (d<>nil) then
  471. thedir:='/'+strpas(@(d^.name[0]))+thedir;
  472. { closedir also makes d invalid }
  473. if (closedir(dirstream)<0) or (d=nil) then
  474. exit;
  475. thisdev:=dotdotdev;
  476. thisino:=dotdotino;
  477. predot:=predot+'../';
  478. end;
  479. { Now rootino=thisino and rootdev=thisdev so we've reached / }
  480. dir:=thedir
  481. end;
  482. {*****************************************************************************
  483. SystemUnit Initialization
  484. *****************************************************************************}
  485. {$ifdef I386}
  486. { this should be defined in i386 directory !! PM }
  487. const
  488. fpucw : word = $1332;
  489. FPU_Invalid = 1;
  490. FPU_Denormal = 2;
  491. FPU_DivisionByZero = 4;
  492. FPU_Overflow = 8;
  493. FPU_Underflow = $10;
  494. FPU_StackUnderflow = $20;
  495. FPU_StackOverflow = $40;
  496. {$endif I386}
  497. Procedure ResetFPU;
  498. begin
  499. {$ifdef I386}
  500. asm
  501. fninit
  502. fldcw fpucw
  503. end;
  504. {$endif I386}
  505. end;
  506. {$ifdef BSD}
  507. procedure SignalToRunerror(Sig: longint; SigContext: SigContextRec;someptr:pointer); cdecl;
  508. {$else}
  509. procedure SignalToRunerror(Sig: longint; SigContext: SigContextRec); cdecl;
  510. {$ENDIF}
  511. var
  512. res,fpustate : word;
  513. begin
  514. res:=0;
  515. case sig of
  516. 8 : begin
  517. { this is not allways necessary but I don't know yet
  518. how to tell if it is or not PM }
  519. {$ifdef I386}
  520. fpustate:=0;
  521. res:=200;
  522. {$ifndef BSD}
  523. if assigned(SigContext.fpstate) then
  524. fpuState:=SigContext.fpstate^.sw;
  525. {$else}
  526. fpustate:=SigContext.en_sw;
  527. {$ifdef SYSTEM_DEBUG}
  528. writeln('xx:',sigcontext.en_tw,' ',sigcontext.en_cw);
  529. {$endif SYSTEM_DEBUG}
  530. {$endif}
  531. {$ifdef SYSTEM_DEBUG}
  532. Writeln(stderr,'FpuState = ',FpuState);
  533. {$endif SYSTEM_DEBUG}
  534. if (FpuState and $7f) <> 0 then
  535. begin
  536. { first check te more precise options }
  537. if (FpuState and FPU_DivisionByZero)<>0 then
  538. res:=200
  539. else if (FpuState and FPU_Overflow)<>0 then
  540. res:=205
  541. else if (FpuState and FPU_Underflow)<>0 then
  542. res:=206
  543. else if (FpuState and FPU_Denormal)<>0 then
  544. res:=216
  545. else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
  546. res:=207
  547. else if (FpuState and FPU_Invalid)<>0 then
  548. res:=216
  549. else
  550. res:=207; {'Coprocessor Error'}
  551. end;
  552. {$endif I386}
  553. ResetFPU;
  554. end;
  555. 11 : res:=216;
  556. end;
  557. { give runtime error at the position where the signal was raised }
  558. if res<>0 then
  559. begin
  560. {$ifdef I386}
  561. {$ifdef BSD}
  562. HandleErrorAddrFrame(res,SigContext.sc_eip,SigContext.sc_ebp);
  563. {$else}
  564. HandleErrorAddrFrame(res,SigContext.eip,SigContext.ebp);
  565. {$endif}
  566. {$else}
  567. HandleError(res);
  568. {$endif}
  569. end;
  570. end;
  571. Procedure InstallSignals;
  572. const
  573. {$Ifndef BSD}
  574. act: SigActionRec = (handler:(Sa:@SignalToRunError);sa_mask:0;sa_flags:0;
  575. Sa_restorer: NIL);
  576. {$ELSE}
  577. act: SigActionRec = (handler:(Sa:@SignalToRunError);sa_flags:SA_SIGINFO;
  578. sa_mask:0);
  579. {$endif}
  580. oldact: PSigActionRec = Nil; {Probably not necessary anymore, now
  581. VAR is removed}
  582. begin
  583. ResetFPU;
  584. SigAction(8,@act,oldact);
  585. SigAction(11,@act,oldact);
  586. end;
  587. procedure SetupCmdLine;
  588. var
  589. bufsize,
  590. len,j,
  591. size,i : longint;
  592. found : boolean;
  593. buf : array[0..1026] of char;
  594. procedure AddBuf;
  595. begin
  596. reallocmem(cmdline,size+bufsize);
  597. move(buf,cmdline[size],bufsize);
  598. inc(size,bufsize);
  599. bufsize:=0;
  600. end;
  601. begin
  602. size:=0;
  603. bufsize:=0;
  604. i:=0;
  605. while (i<argc) do
  606. begin
  607. len:=strlen(argv[i]);
  608. if len>sizeof(buf)-2 then
  609. len:=sizeof(buf)-2;
  610. found:=false;
  611. for j:=1 to len do
  612. if argv[i][j]=' ' then
  613. begin
  614. found:=true;
  615. break;
  616. end;
  617. if bufsize+len>=sizeof(buf)-2 then
  618. AddBuf;
  619. if found then
  620. begin
  621. buf[bufsize]:='"';
  622. inc(bufsize);
  623. end;
  624. move(argv[i]^,buf[bufsize],len);
  625. inc(bufsize,len);
  626. if found then
  627. begin
  628. buf[bufsize]:='"';
  629. inc(bufsize);
  630. end;
  631. if i<argc then
  632. buf[bufsize]:=' '
  633. else
  634. buf[bufsize]:=#0;
  635. inc(bufsize);
  636. inc(i);
  637. end;
  638. AddBuf;
  639. end;
  640. Begin
  641. { Set up signals handlers }
  642. InstallSignals;
  643. { Setup heap }
  644. InitHeap;
  645. InitExceptions;
  646. { Arguments }
  647. SetupCmdLine;
  648. { Setup stdin, stdout and stderr }
  649. OpenStdIO(Input,fmInput,StdInputHandle);
  650. OpenStdIO(Output,fmOutput,StdOutputHandle);
  651. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  652. OpenStdIO(StdErr,fmOutput,StdErrorHandle);
  653. { Reset IO Error }
  654. InOutRes:=0;
  655. End.
  656. {
  657. $Log$
  658. Revision 1.9 2001-04-13 22:39:05 peter
  659. * removed warning
  660. Revision 1.8 2001/04/12 17:53:43 peter
  661. * fixed usage of already release memory in getdir
  662. Revision 1.7 2001/03/21 21:08:20 hajny
  663. * GetDir fixed
  664. Revision 1.6 2001/03/16 20:09:58 hajny
  665. * universal FExpand
  666. Revision 1.5 2001/02/20 21:31:12 peter
  667. * chdir,mkdir,rmdir with empty string fixed
  668. Revision 1.4 2000/12/17 14:00:57 peter
  669. * removed debug writelns
  670. Revision 1.3 2000/10/09 16:35:51 marco
  671. * Fixed the first (of many) ioctls that make building the IDE hard.
  672. Revision 1.2 2000/09/18 13:14:51 marco
  673. * Global Linux +bsd to (rtl/freebsd rtl/unix rtl/linux structure)
  674. Revision 1.6 2000/09/11 13:48:08 marco
  675. * FreeBSD support and removal of old sighandler
  676. Revision 1.5 2000/08/13 08:43:45 peter
  677. * don't check for directory in do_open (merged)
  678. Revision 1.4 2000/08/05 18:33:51 peter
  679. * paramstr(0) fix for linux 2.0 kernels (merged)
  680. Revision 1.3 2000/07/14 10:33:10 michael
  681. + Conditionals fixed
  682. Revision 1.2 2000/07/13 11:33:49 michael
  683. + removed logs
  684. }