syslinux.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1998-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 want to link to the C library, set the conditional crtlib }
  15. { $define crtlib}
  16. { If you use an aout system, set the conditional AOUT}
  17. { $Define AOUT}
  18. Unit SysLinux;
  19. Interface
  20. {$ifdef m68k}
  21. { used for single computations }
  22. const
  23. BIAS4 = $7f-1;
  24. {$endif}
  25. {$I systemh.inc}
  26. {$I heaph.inc}
  27. const
  28. UnusedHandle = -1;
  29. StdInputHandle = 0;
  30. StdOutputHandle = 1;
  31. StdErrorHandle = 2;
  32. var
  33. argc : longint;
  34. argv : ppchar;
  35. envp : ppchar;
  36. Implementation
  37. {$I system.inc}
  38. {$ifdef crtlib}
  39. Procedure _rtl_exit(l: longint); cdecl;
  40. Function _rtl_paramcount: longint; cdecl;
  41. Procedure _rtl_paramstr(st: pchar; l: longint); cdecl;
  42. Function _rtl_open(f: pchar; flags: longint): longint; cdecl;
  43. Procedure _rtl_close(h: longint); cdecl;
  44. Procedure _rtl_write(h: longint; addr: longInt; len : longint); cdecl;
  45. Procedure _rtl_erase(p: pchar); cdecl;
  46. Procedure _rtl_rename(p1: pchar; p2 : pchar); cdecl;
  47. Function _rtl_read(h: longInt; addr: longInt; len : longint) : longint; cdecl;
  48. Function _rtl_filepos(Handle: longint): longint; cdecl;
  49. Procedure _rtl_seek(Handle: longint; pos:longint); cdecl;
  50. Function _rtl_filesize(Handle:longint): longInt; cdecl;
  51. Procedure _rtl_rmdir(buffer: pchar); cdecl;
  52. Procedure _rtl_mkdir(buffer: pchar); cdecl;
  53. Procedure _rtl_chdir(buffer: pchar); cdecl;
  54. {$else}
  55. { used in syscall to report errors.}
  56. var
  57. Errno : longint;
  58. { Include constant and type definitions }
  59. {$i errno.inc } { Error numbers }
  60. {$i sysnr.inc } { System call numbers }
  61. {$i sysconst.inc } { Miscellaneous constants }
  62. {$i systypes.inc } { Types needed for system calls }
  63. { Read actual system call definitions. }
  64. {$i syscalls.inc }
  65. {$endif}
  66. {*****************************************************************************
  67. Misc. System Dependent Functions
  68. *****************************************************************************}
  69. {$ifdef i386}
  70. {$ASMMODE DIRECT}
  71. {$endif}
  72. Procedure Halt(ErrNum: Byte);
  73. Begin
  74. ExitCode:=Errnum;
  75. Do_Exit;
  76. {$ifdef i386}
  77. asm
  78. jmp _haltproc
  79. end;
  80. {$else}
  81. asm
  82. jmp _haltproc
  83. end;
  84. {$endif}
  85. End;
  86. Function ParamCount: Longint;
  87. Begin
  88. {$ifdef crtlib}
  89. ParamCount:=_rtl_paramcount;
  90. {$else}
  91. Paramcount:=argc-1
  92. {$endif}
  93. End;
  94. Function ParamStr(l: Longint): String;
  95. Var
  96. {$ifndef crtlib}
  97. i : longint;
  98. pp : ppchar;
  99. {$else}
  100. b : Array[0..255] of Char;
  101. {$endif}
  102. Begin
  103. {$ifdef crtlib}
  104. _rtl_paramstr(@b, l);
  105. ParamStr:=StrPas(b);
  106. {$else}
  107. if l>argc then
  108. begin
  109. paramstr:='';
  110. exit
  111. end;
  112. pp:=argv;
  113. i:=0;
  114. while (i<l) and (pp^<>nil) do
  115. begin
  116. inc(pp);
  117. inc(i);
  118. end;
  119. if pp^<>nil then
  120. Paramstr:=StrPas(pp^)
  121. else
  122. ParamStr:='';
  123. {$endif}
  124. End;
  125. Procedure Randomize;
  126. Begin
  127. {$ifdef crtlib}
  128. _rtl_gettime(longint(@randseed));
  129. {$else}
  130. randseed:=sys_time;
  131. {$endif}
  132. End;
  133. {*****************************************************************************
  134. Heap Management
  135. *****************************************************************************}
  136. function getheapstart:pointer;assembler;
  137. {$ifdef i386}
  138. asm
  139. leal HEAP,%eax
  140. end ['EAX'];
  141. {$else}
  142. asm
  143. lea.l HEAP,a0
  144. move.l a0,d0
  145. end;
  146. {$endif}
  147. function getheapsize:longint;assembler;
  148. {$ifdef i386}
  149. asm
  150. movl HEAPSIZE,%eax
  151. end ['EAX'];
  152. {$else}
  153. asm
  154. move.l HEAP_SIZE,d0
  155. end ['D0'];
  156. {$endif}
  157. Function sbrk(size : longint) : Longint;
  158. type
  159. tmmapargs=packed record
  160. address : longint;
  161. size : longint;
  162. prot : longint;
  163. flags : longint;
  164. fd : longint;
  165. offset : longint;
  166. end;
  167. var
  168. t : syscallregs;
  169. mmapargs : tmmapargs;
  170. begin
  171. mmapargs.address:=0;
  172. mmapargs.size:=Size;
  173. mmapargs.prot:=3;
  174. mmapargs.flags:=$22;
  175. mmapargs.fd:=-1;
  176. mmapargs.offset:=0;
  177. t.reg2:=longint(@mmapargs);
  178. Sbrk:=syscall(syscall_nr_mmap,t);
  179. if ErrNo<>0 then
  180. Sbrk:=0;
  181. end;
  182. { include standard heap management }
  183. {$I heap.inc}
  184. {*****************************************************************************
  185. Low Level File Routines
  186. *****************************************************************************}
  187. {
  188. The lowlevel file functions should take care of setting the InOutRes to the
  189. correct value if an error has occured, else leave it untouched
  190. }
  191. Procedure Errno2Inoutres;
  192. {
  193. Convert ErrNo error to the correct Inoutres value
  194. }
  195. begin
  196. if ErrNo=0 then { Else it will go through all the cases }
  197. exit;
  198. case ErrNo of
  199. Sys_ENFILE,
  200. Sys_EMFILE : Inoutres:=4;
  201. Sys_ENOENT : Inoutres:=2;
  202. Sys_EBADF : Inoutres:=6;
  203. Sys_ENOMEM,
  204. Sys_EFAULT : Inoutres:=217;
  205. Sys_EINVAL : Inoutres:=218;
  206. Sys_EPIPE,
  207. Sys_EINTR,
  208. Sys_EIO,
  209. Sys_EAGAIN,
  210. Sys_ENOSPC : Inoutres:=101;
  211. Sys_ENAMETOOLONG,
  212. Sys_ELOOP,
  213. Sys_ENOTDIR : Inoutres:=3;
  214. Sys_EROFS,
  215. Sys_EEXIST,
  216. Sys_EACCES : Inoutres:=5;
  217. Sys_ETXTBSY : Inoutres:=162;
  218. end;
  219. end;
  220. Procedure Do_Close(Handle:Longint);
  221. Begin
  222. {$ifdef crtlib}
  223. _rtl_close(Handle);
  224. {$else}
  225. sys_close(Handle);
  226. {$endif}
  227. End;
  228. Procedure Do_Erase(p:pchar);
  229. Begin
  230. {$ifdef crtlib}
  231. _rtl_erase(p);
  232. {$else}
  233. sys_unlink(p);
  234. Errno2Inoutres;
  235. {$endif}
  236. End;
  237. Procedure Do_Rename(p1,p2:pchar);
  238. Begin
  239. {$ifdef crtlib}
  240. _rtl_rename(p1,p2);
  241. {$else }
  242. sys_rename(p1,p2);
  243. Errno2Inoutres;
  244. {$endif}
  245. End;
  246. Function Do_Write(Handle,Addr,Len:Longint):longint;
  247. Begin
  248. {$ifdef crtlib}
  249. _rtl_write(Handle,addr,len);
  250. Do_Write:=Len;
  251. {$else}
  252. Do_Write:=sys_write(Handle,pchar(addr),len);
  253. Errno2Inoutres;
  254. {$endif}
  255. if Do_Write<0 then
  256. Do_Write:=0;
  257. End;
  258. Function Do_Read(Handle,Addr,Len:Longint):Longint;
  259. Begin
  260. {$ifdef crtlib}
  261. Do_Read:=_rtl_read(Handle,addr,len);
  262. {$else}
  263. Do_Read:=sys_read(Handle,pchar(addr),len);
  264. Errno2Inoutres;
  265. {$endif}
  266. if Do_Read<0 then
  267. Do_Read:=0;
  268. End;
  269. Function Do_FilePos(Handle: Longint): Longint;
  270. Begin
  271. {$ifdef crtlib}
  272. Do_FilePos:=_rtl_filepos(Handle);
  273. {$else}
  274. Do_FilePos:=sys_lseek(Handle, 0, Seek_Cur);
  275. Errno2Inoutres;
  276. {$endif}
  277. End;
  278. Procedure Do_Seek(Handle,Pos:Longint);
  279. Begin
  280. {$ifdef crtlib}
  281. _rtl_seek(Handle, Pos);
  282. {$else}
  283. sys_lseek(Handle, pos, Seek_set);
  284. {$endif}
  285. End;
  286. Function Do_SeekEnd(Handle:Longint): Longint;
  287. begin
  288. {$ifdef crtlib}
  289. Do_SeekEnd:=_rtl_filesize(Handle);
  290. {$else}
  291. Do_SeekEnd:=sys_lseek(Handle,0,Seek_End);
  292. {$endif}
  293. end;
  294. Function Do_FileSize(Handle:Longint): Longint;
  295. {$ifndef crtlib}
  296. var
  297. regs : Syscallregs;
  298. Info : Stat;
  299. {$endif}
  300. Begin
  301. {$ifdef crtlib}
  302. Do_FileSize:=_rtl_filesize(Handle);
  303. {$else}
  304. regs.reg2:=Handle;
  305. regs.reg3:=longint(@Info);
  306. if SysCall(SysCall_nr_fstat,regs)=0 then
  307. Do_FileSize:=Info.Size
  308. else
  309. Do_FileSize:=0;
  310. Errno2Inoutres;
  311. {$endif}
  312. End;
  313. Procedure Do_Truncate(Handle,Pos:longint);
  314. {$ifndef crtlib}
  315. var
  316. sr : syscallregs;
  317. {$endif}
  318. begin
  319. {$ifndef crtlib}
  320. sr.reg2:=Handle;
  321. sr.reg3:=Pos;
  322. syscall(syscall_nr_ftruncate,sr);
  323. Errno2Inoutres;
  324. {$endif}
  325. end;
  326. Procedure Do_Open(var f;p:pchar;flags:longint);
  327. {
  328. FileRec and textrec have both Handle and mode as the first items so
  329. they could use the same routine for opening/creating.
  330. when (flags and $100) the file will be append
  331. when (flags and $1000) the file will be truncate/rewritten
  332. when (flags and $10000) there is no check for close (needed for textfiles)
  333. }
  334. var
  335. {$ifndef crtlib}
  336. oflags : longint;
  337. {$endif}
  338. Begin
  339. { close first if opened }
  340. if ((flags and $10000)=0) then
  341. begin
  342. case FileRec(f).mode of
  343. fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
  344. fmclosed : ;
  345. else
  346. begin
  347. inoutres:=102; {not assigned}
  348. exit;
  349. end;
  350. end;
  351. end;
  352. { reset file Handle }
  353. FileRec(f).Handle:=UnusedHandle;
  354. { We do the conversion of filemodes here, concentrated on 1 place }
  355. case (flags and 3) of
  356. 0 : begin
  357. oflags :=Open_RDONLY;
  358. FileRec(f).mode:=fminput;
  359. end;
  360. 1 : begin
  361. oflags :=Open_WRONLY;
  362. FileRec(f).mode:=fmoutput;
  363. end;
  364. 2 : begin
  365. oflags :=Open_RDWR;
  366. FileRec(f).mode:=fminout;
  367. end;
  368. end;
  369. if (flags and $1000)=$1000 then
  370. oflags:=oflags or (Open_CREAT or Open_TRUNC)
  371. else
  372. if (flags and $100)=$100 then
  373. oflags:=oflags or (Open_APPEND);
  374. { empty name is special }
  375. if p[0]=#0 then
  376. begin
  377. case FileRec(f).mode of
  378. fminput : FileRec(f).Handle:=StdInputHandle;
  379. fmoutput,
  380. fmappend : begin
  381. FileRec(f).Handle:=StdOutputHandle;
  382. FileRec(f).mode:=fmoutput; {fool fmappend}
  383. end;
  384. end;
  385. exit;
  386. end;
  387. { real open call }
  388. {$ifdef crtlib}
  389. FileRec(f).Handle:=_rtl_open(p, oflags);
  390. if FileRec(f).Handle<0 then
  391. InOutRes:=2
  392. else
  393. InOutRes:=0;
  394. {$else}
  395. FileRec(f).Handle:=sys_open(p,oflags,438);
  396. if (ErrNo=Sys_EROFS) and ((OFlags and Open_RDWR)<>0) then
  397. begin
  398. Oflags:=Oflags and not(Open_RDWR);
  399. FileRec(f).Handle:=sys_open(p,oflags,438);
  400. end;
  401. Errno2Inoutres;
  402. {$endif}
  403. End;
  404. Function Do_IsDevice(Handle:Longint):boolean;
  405. {
  406. Interface to Unix ioctl call.
  407. Performs various operations on the filedescriptor Handle.
  408. Ndx describes the operation to perform.
  409. Data points to data needed for the Ndx function. The structure of this
  410. data is function-dependent.
  411. }
  412. var
  413. sr: SysCallRegs;
  414. Data : array[0..255] of byte; {Large enough for termios info}
  415. begin
  416. sr.reg2:=Handle;
  417. sr.reg3:=$5401; {=TCGETS}
  418. sr.reg4:=Longint(@Data);
  419. Do_IsDevice:=(SysCall(Syscall_nr_ioctl,sr)=0);
  420. end;
  421. {*****************************************************************************
  422. UnTyped File Handling
  423. *****************************************************************************}
  424. {$i file.inc}
  425. {*****************************************************************************
  426. Typed File Handling
  427. *****************************************************************************}
  428. {$i typefile.inc}
  429. {*****************************************************************************
  430. Text File Handling
  431. *****************************************************************************}
  432. {$DEFINE SHORT_LINEBREAK}
  433. {$DEFINE EXTENDED_EOF}
  434. {$i text.inc}
  435. {*****************************************************************************
  436. Directory Handling
  437. *****************************************************************************}
  438. Procedure MkDir(Const s: String);[IOCheck];
  439. Var
  440. Buffer: Array[0..255] of Char;
  441. Begin
  442. If InOutRes <> 0 then exit;
  443. Move(s[1], Buffer, Length(s));
  444. Buffer[Length(s)] := #0;
  445. {$ifdef crtlib}
  446. _rtl_mkdir(@buffer);
  447. {$else}
  448. sys_mkdir(@buffer, 511);
  449. Errno2Inoutres;
  450. {$endif}
  451. End;
  452. Procedure RmDir(Const s: String);[IOCheck];
  453. Var
  454. Buffer: Array[0..255] of Char;
  455. Begin
  456. If InOutRes <> 0 then exit;
  457. Move(s[1], Buffer, Length(s));
  458. Buffer[Length(s)] := #0;
  459. {$ifdef crtlib}
  460. _rtl_rmdir(@buffer);
  461. {$else}
  462. sys_rmdir(@buffer);
  463. Errno2Inoutres;
  464. {$endif}
  465. End;
  466. Procedure ChDir(Const s: String);[IOCheck];
  467. Var
  468. Buffer: Array[0..255] of Char;
  469. Begin
  470. If InOutRes <> 0 then exit;
  471. Move(s[1], Buffer, Length(s));
  472. Buffer[Length(s)] := #0;
  473. {$ifdef crtlib}
  474. _rtl_chdir(@buffer);
  475. {$else}
  476. sys_chdir(@buffer);
  477. Errno2Inoutres;
  478. {$endif}
  479. End;
  480. procedure getdir(drivenr : byte;var dir : shortstring);
  481. {$ifndef crtlib}
  482. var
  483. thisdir : stat;
  484. rootino,
  485. thisino,
  486. dotdotino : longint;
  487. rootdev,
  488. thisdev,
  489. dotdotdev : word;
  490. thedir,dummy : string[255];
  491. dirstream : pdir;
  492. d : pdirent;
  493. mountpoint : boolean;
  494. predot : string[255];
  495. {$endif}
  496. begin
  497. drivenr:=0;
  498. dir:='';
  499. {$ifndef crtlib}
  500. thedir:='/'#0;
  501. if sys_stat(@thedir[1],thisdir)<0 then
  502. exit;
  503. rootino:=thisdir.ino;
  504. rootdev:=thisdir.dev;
  505. thedir:='.'#0;
  506. if sys_stat(@thedir[1],thisdir)<0 then
  507. exit;
  508. thisino:=thisdir.ino;
  509. thisdev:=thisdir.dev;
  510. { Now we can uniquely identify the current and root dir }
  511. thedir:='';
  512. predot:='';
  513. while not ((thisino=rootino) and (thisdev=rootdev)) do
  514. begin
  515. { Are we on a mount point ? }
  516. dummy:=predot+'..'#0;
  517. if sys_stat(@dummy[1],thisdir)<0 then
  518. exit;
  519. dotdotino:=thisdir.ino;
  520. dotdotdev:=thisdir.dev;
  521. mountpoint:=(thisdev<>dotdotdev);
  522. { Now, Try to find the name of this dir in the previous one }
  523. dirstream:=opendir (@dummy[1]);
  524. if dirstream=nil then
  525. exit;
  526. repeat
  527. d:=sys_readdir (dirstream);
  528. if (d<>nil) and
  529. (not ((d^.name[0]='.') and ((d^.name[1]=#0) or ((d^.name[1]='.') and (d^.name[2]=#0))))) and
  530. (mountpoint or (d^.ino=thisino)) then
  531. begin
  532. dummy:=predot+'../'+strpas(@(d^.name[0]))+#0;
  533. if sys_stat (@(dummy[1]),thisdir)<0 then
  534. d:=nil;
  535. end;
  536. until (d=nil) or ((thisdir.dev=thisdev) and (thisdir.ino=thisino) );
  537. if (closedir(dirstream)<0) or (d=nil) then
  538. exit;
  539. { At this point, d.name contains the name of the current dir}
  540. thedir:='/'+strpas(@(d^.name[0]))+thedir;
  541. thisdev:=dotdotdev;
  542. thisino:=dotdotino;
  543. predot:=predot+'../';
  544. end;
  545. { Now rootino=thisino and rootdev=thisdev so we've reached / }
  546. dir:=thedir
  547. {$endif}
  548. end;
  549. {*****************************************************************************
  550. System Dependent Exit code
  551. *****************************************************************************}
  552. Procedure system_exit;
  553. begin
  554. end;
  555. {*****************************************************************************
  556. SystemUnit Initialization
  557. *****************************************************************************}
  558. Procedure SignalToRunError(Sig:longint);
  559. begin
  560. case sig of
  561. 8 : HandleError(200);
  562. 11 : HandleError(216);
  563. end;
  564. end;
  565. Procedure InstallSignals;
  566. var
  567. sr : syscallregs;
  568. begin
  569. sr.reg3:=longint(@SignalToRunError);
  570. { sigsegv }
  571. sr.reg2:=11;
  572. syscall(syscall_nr_signal,sr);
  573. { sigfpe }
  574. sr.reg2:=8;
  575. syscall(syscall_nr_signal,sr);
  576. end;
  577. procedure SetupCmdLine;
  578. var
  579. bufsize,
  580. len,j,
  581. size,i : longint;
  582. found : boolean;
  583. buf : array[0..1026] of char;
  584. procedure AddBuf;
  585. begin
  586. reallocmem(cmdline,size+bufsize);
  587. move(buf,cmdline[size],bufsize);
  588. inc(size,bufsize);
  589. bufsize:=0;
  590. end;
  591. begin
  592. size:=0;
  593. bufsize:=0;
  594. i:=0;
  595. while (i<argc) do
  596. begin
  597. len:=strlen(argv[i]);
  598. if len>sizeof(buf)-2 then
  599. len:=sizeof(buf)-2;
  600. found:=false;
  601. for j:=1 to len do
  602. if argv[i][j]=' ' then
  603. begin
  604. found:=true;
  605. break;
  606. end;
  607. if bufsize+len>=sizeof(buf)-2 then
  608. AddBuf;
  609. if found then
  610. begin
  611. buf[bufsize]:='"';
  612. inc(bufsize);
  613. end;
  614. move(argv[i]^,buf[bufsize],len);
  615. inc(bufsize,len);
  616. if found then
  617. begin
  618. buf[bufsize]:='"';
  619. inc(bufsize);
  620. end;
  621. if i<argc then
  622. buf[bufsize]:=' '
  623. else
  624. buf[bufsize]:=#0;
  625. inc(bufsize);
  626. inc(i);
  627. end;
  628. AddBuf;
  629. end;
  630. Begin
  631. { Set up signals handlers }
  632. InstallSignals;
  633. { Setup heap }
  634. InitHeap;
  635. InitExceptions;
  636. { Arguments }
  637. SetupCmdLine;
  638. { Setup stdin, stdout and stderr }
  639. OpenStdIO(Input,fmInput,StdInputHandle);
  640. OpenStdIO(Output,fmOutput,StdOutputHandle);
  641. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  642. OpenStdIO(StdErr,fmOutput,StdErrorHandle);
  643. { Reset IO Error }
  644. InOutRes:=0;
  645. End.
  646. {
  647. $Log$
  648. Revision 1.31 2000-01-07 16:32:28 daniel
  649. * copyright 2000 added
  650. Revision 1.30 1999/12/01 22:57:31 peter
  651. * cmdline support
  652. Revision 1.29 1999/11/06 14:39:12 peter
  653. * truncated log
  654. Revision 1.28 1999/10/28 09:50:06 peter
  655. * use mmap instead of brk
  656. Revision 1.27 1999/09/10 15:40:35 peter
  657. * fixed do_open flags to be > $100, becuase filemode can be upto 255
  658. Revision 1.26 1999/09/08 16:14:43 peter
  659. * pointer fixes
  660. Revision 1.25 1999/07/28 23:18:36 peter
  661. * closedir fixes, which now disposes the pdir itself
  662. Revision 1.24 1999/05/17 21:52:42 florian
  663. * most of the Object Pascal stuff moved to the system unit
  664. Revision 1.23 1999/04/08 12:23:04 peter
  665. * removed os.inc
  666. Revision 1.22 1999/01/18 10:05:53 pierre
  667. + system_exit procedure added
  668. Revision 1.21 1998/12/28 15:50:49 peter
  669. + stdout, which is needed when you write something in the system unit
  670. to the screen. Like the runtime error
  671. Revision 1.20 1998/12/18 17:21:34 peter
  672. * fixed io-error handling
  673. Revision 1.19 1998/12/15 22:43:08 peter
  674. * removed temp symbols
  675. Revision 1.18 1998/11/16 10:21:32 peter
  676. * fixes for H+
  677. Revision 1.17 1998/10/15 08:30:00 peter
  678. + sigfpe -> runerror 200
  679. Revision 1.16 1998/09/14 10:48:27 peter
  680. * FPC_ names
  681. * Heap manager is now system independent
  682. Revision 1.15 1998/09/06 19:41:40 peter
  683. * fixed unusedhandle for 0.99.5
  684. Revision 1.14 1998/09/04 18:16:16 peter
  685. * uniform filerec/textrec (with recsize:longint and name:0..255)
  686. Revision 1.13 1998/08/14 11:59:41 carl
  687. + m68k fixes
  688. Revision 1.12 1998/08/12 14:01:37 michael
  689. + Small m68k fixes
  690. Revision 1.11 1998/08/11 08:30:37 michael
  691. + Fixed paramstr() - sometimes there are no 255 characters available.
  692. Revision 1.10 1998/07/30 13:26:15 michael
  693. + Added support for ErrorProc variable. All internal functions are required
  694. to call HandleError instead of runerror from now on.
  695. This is necessary for exception support.
  696. Revision 1.9 1998/07/20 23:40:20 michael
  697. changed sbrk to fc_sbrk, to avoid conflicts with C library.
  698. }