syslinux.pp 17 KB

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