syslinux.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  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 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. if Handle<=4 then
  223. exit;
  224. {$ifdef crtlib}
  225. _rtl_close(Handle);
  226. {$else}
  227. sys_close(Handle);
  228. {$endif}
  229. End;
  230. Procedure Do_Erase(p:pchar);
  231. Begin
  232. {$ifdef crtlib}
  233. _rtl_erase(p);
  234. {$else}
  235. sys_unlink(p);
  236. Errno2Inoutres;
  237. {$endif}
  238. End;
  239. Procedure Do_Rename(p1,p2:pchar);
  240. Begin
  241. {$ifdef crtlib}
  242. _rtl_rename(p1,p2);
  243. {$else }
  244. sys_rename(p1,p2);
  245. Errno2Inoutres;
  246. {$endif}
  247. End;
  248. Function Do_Write(Handle,Addr,Len:Longint):longint;
  249. Begin
  250. {$ifdef crtlib}
  251. _rtl_write(Handle,addr,len);
  252. Do_Write:=Len;
  253. {$else}
  254. Do_Write:=sys_write(Handle,pchar(addr),len);
  255. Errno2Inoutres;
  256. {$endif}
  257. if Do_Write<0 then
  258. Do_Write:=0;
  259. End;
  260. Function Do_Read(Handle,Addr,Len:Longint):Longint;
  261. Begin
  262. {$ifdef crtlib}
  263. Do_Read:=_rtl_read(Handle,addr,len);
  264. {$else}
  265. Do_Read:=sys_read(Handle,pchar(addr),len);
  266. Errno2Inoutres;
  267. {$endif}
  268. if Do_Read<0 then
  269. Do_Read:=0;
  270. End;
  271. Function Do_FilePos(Handle: Longint): Longint;
  272. Begin
  273. {$ifdef crtlib}
  274. Do_FilePos:=_rtl_filepos(Handle);
  275. {$else}
  276. Do_FilePos:=sys_lseek(Handle, 0, Seek_Cur);
  277. Errno2Inoutres;
  278. {$endif}
  279. End;
  280. Procedure Do_Seek(Handle,Pos:Longint);
  281. Begin
  282. {$ifdef crtlib}
  283. _rtl_seek(Handle, Pos);
  284. {$else}
  285. sys_lseek(Handle, pos, Seek_set);
  286. {$endif}
  287. End;
  288. Function Do_SeekEnd(Handle:Longint): Longint;
  289. begin
  290. {$ifdef crtlib}
  291. Do_SeekEnd:=_rtl_filesize(Handle);
  292. {$else}
  293. Do_SeekEnd:=sys_lseek(Handle,0,Seek_End);
  294. {$endif}
  295. end;
  296. Function Do_FileSize(Handle:Longint): Longint;
  297. {$ifndef crtlib}
  298. var
  299. regs : Syscallregs;
  300. Info : Stat;
  301. {$endif}
  302. Begin
  303. {$ifdef crtlib}
  304. Do_FileSize:=_rtl_filesize(Handle);
  305. {$else}
  306. regs.reg2:=Handle;
  307. regs.reg3:=longint(@Info);
  308. if SysCall(SysCall_nr_fstat,regs)=0 then
  309. Do_FileSize:=Info.Size
  310. else
  311. Do_FileSize:=0;
  312. Errno2Inoutres;
  313. {$endif}
  314. End;
  315. Procedure Do_Truncate(Handle,Pos:longint);
  316. {$ifndef crtlib}
  317. var
  318. sr : syscallregs;
  319. {$endif}
  320. begin
  321. {$ifndef crtlib}
  322. sr.reg2:=Handle;
  323. sr.reg3:=Pos;
  324. syscall(syscall_nr_ftruncate,sr);
  325. Errno2Inoutres;
  326. {$endif}
  327. end;
  328. Procedure Do_Open(var f;p:pchar;flags:longint);
  329. {
  330. FileRec and textrec have both Handle and mode as the first items so
  331. they could use the same routine for opening/creating.
  332. when (flags and $100) the file will be append
  333. when (flags and $1000) the file will be truncate/rewritten
  334. when (flags and $10000) there is no check for close (needed for textfiles)
  335. }
  336. var
  337. {$ifndef crtlib}
  338. oflags : longint;
  339. {$endif}
  340. Begin
  341. { close first if opened }
  342. if ((flags and $10000)=0) then
  343. begin
  344. case FileRec(f).mode of
  345. fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
  346. fmclosed : ;
  347. else
  348. begin
  349. inoutres:=102; {not assigned}
  350. exit;
  351. end;
  352. end;
  353. end;
  354. { reset file Handle }
  355. FileRec(f).Handle:=UnusedHandle;
  356. { We do the conversion of filemodes here, concentrated on 1 place }
  357. case (flags and 3) of
  358. 0 : begin
  359. oflags :=Open_RDONLY;
  360. FileRec(f).mode:=fminput;
  361. end;
  362. 1 : begin
  363. oflags :=Open_WRONLY;
  364. FileRec(f).mode:=fmoutput;
  365. end;
  366. 2 : begin
  367. oflags :=Open_RDWR;
  368. FileRec(f).mode:=fminout;
  369. end;
  370. end;
  371. if (flags and $1000)=$1000 then
  372. oflags:=oflags or (Open_CREAT or Open_TRUNC)
  373. else
  374. if (flags and $100)=$100 then
  375. oflags:=oflags or (Open_APPEND);
  376. { empty name is special }
  377. if p[0]=#0 then
  378. begin
  379. case FileRec(f).mode of
  380. fminput : FileRec(f).Handle:=StdInputHandle;
  381. fmoutput,
  382. fmappend : begin
  383. FileRec(f).Handle:=StdOutputHandle;
  384. FileRec(f).mode:=fmoutput; {fool fmappend}
  385. end;
  386. end;
  387. exit;
  388. end;
  389. { real open call }
  390. {$ifdef crtlib}
  391. FileRec(f).Handle:=_rtl_open(p, oflags);
  392. if FileRec(f).Handle<0 then
  393. InOutRes:=2
  394. else
  395. InOutRes:=0;
  396. {$else}
  397. FileRec(f).Handle:=sys_open(p,oflags,438);
  398. if (ErrNo=Sys_EROFS) and ((OFlags and Open_RDWR)<>0) then
  399. begin
  400. Oflags:=Oflags and not(Open_RDWR);
  401. FileRec(f).Handle:=sys_open(p,oflags,438);
  402. end;
  403. Errno2Inoutres;
  404. {$endif}
  405. End;
  406. Function Do_IsDevice(Handle:Longint):boolean;
  407. {
  408. Interface to Unix ioctl call.
  409. Performs various operations on the filedescriptor Handle.
  410. Ndx describes the operation to perform.
  411. Data points to data needed for the Ndx function. The structure of this
  412. data is function-dependent.
  413. }
  414. var
  415. sr: SysCallRegs;
  416. Data : array[0..255] of byte; {Large enough for termios info}
  417. begin
  418. sr.reg2:=Handle;
  419. sr.reg3:=$5401; {=TCGETS}
  420. sr.reg4:=Longint(@Data);
  421. Do_IsDevice:=(SysCall(Syscall_nr_ioctl,sr)=0);
  422. end;
  423. {*****************************************************************************
  424. UnTyped File Handling
  425. *****************************************************************************}
  426. {$i file.inc}
  427. {*****************************************************************************
  428. Typed File Handling
  429. *****************************************************************************}
  430. {$i typefile.inc}
  431. {*****************************************************************************
  432. Text File Handling
  433. *****************************************************************************}
  434. {$DEFINE SHORT_LINEBREAK}
  435. {$DEFINE EXTENDED_EOF}
  436. {$i text.inc}
  437. {*****************************************************************************
  438. Directory Handling
  439. *****************************************************************************}
  440. Procedure MkDir(Const s: String);[IOCheck];
  441. Var
  442. Buffer: Array[0..255] of Char;
  443. Begin
  444. If InOutRes <> 0 then exit;
  445. Move(s[1], Buffer, Length(s));
  446. Buffer[Length(s)] := #0;
  447. {$ifdef crtlib}
  448. _rtl_mkdir(@buffer);
  449. {$else}
  450. sys_mkdir(@buffer, 511);
  451. Errno2Inoutres;
  452. {$endif}
  453. End;
  454. Procedure RmDir(Const s: String);[IOCheck];
  455. Var
  456. Buffer: Array[0..255] of Char;
  457. Begin
  458. If InOutRes <> 0 then exit;
  459. Move(s[1], Buffer, Length(s));
  460. Buffer[Length(s)] := #0;
  461. {$ifdef crtlib}
  462. _rtl_rmdir(@buffer);
  463. {$else}
  464. sys_rmdir(@buffer);
  465. Errno2Inoutres;
  466. {$endif}
  467. End;
  468. Procedure ChDir(Const s: String);[IOCheck];
  469. Var
  470. Buffer: Array[0..255] of Char;
  471. Begin
  472. If InOutRes <> 0 then exit;
  473. Move(s[1], Buffer, Length(s));
  474. Buffer[Length(s)] := #0;
  475. {$ifdef crtlib}
  476. _rtl_chdir(@buffer);
  477. {$else}
  478. sys_chdir(@buffer);
  479. Errno2Inoutres;
  480. {$endif}
  481. End;
  482. procedure getdir(drivenr : byte;var dir : shortstring);
  483. {$ifndef crtlib}
  484. var
  485. thisdir : stat;
  486. rootino,
  487. thisino,
  488. dotdotino : longint;
  489. rootdev,
  490. thisdev,
  491. dotdotdev : word;
  492. thedir,dummy : string[255];
  493. dirstream : pdir;
  494. d : pdirent;
  495. mountpoint : boolean;
  496. predot : string[255];
  497. {$endif}
  498. begin
  499. drivenr:=0;
  500. dir:='';
  501. {$ifndef crtlib}
  502. thedir:='/'#0;
  503. if sys_stat(@thedir[1],thisdir)<0 then
  504. exit;
  505. rootino:=thisdir.ino;
  506. rootdev:=thisdir.dev;
  507. thedir:='.'#0;
  508. if sys_stat(@thedir[1],thisdir)<0 then
  509. exit;
  510. thisino:=thisdir.ino;
  511. thisdev:=thisdir.dev;
  512. { Now we can uniquely identify the current and root dir }
  513. thedir:='';
  514. predot:='';
  515. while not ((thisino=rootino) and (thisdev=rootdev)) do
  516. begin
  517. { Are we on a mount point ? }
  518. dummy:=predot+'..'#0;
  519. if sys_stat(@dummy[1],thisdir)<0 then
  520. exit;
  521. dotdotino:=thisdir.ino;
  522. dotdotdev:=thisdir.dev;
  523. mountpoint:=(thisdev<>dotdotdev);
  524. { Now, Try to find the name of this dir in the previous one }
  525. dirstream:=opendir (@dummy[1]);
  526. if dirstream=nil then
  527. exit;
  528. repeat
  529. d:=sys_readdir (dirstream);
  530. if (d<>nil) and
  531. (not ((d^.name[0]='.') and ((d^.name[1]=#0) or ((d^.name[1]='.') and (d^.name[2]=#0))))) and
  532. (mountpoint or (d^.ino=thisino)) then
  533. begin
  534. dummy:=predot+'../'+strpas(@(d^.name[0]))+#0;
  535. if sys_stat (@(dummy[1]),thisdir)<0 then
  536. d:=nil;
  537. end;
  538. until (d=nil) or ((thisdir.dev=thisdev) and (thisdir.ino=thisino) );
  539. if (closedir(dirstream)<0) or (d=nil) then
  540. exit;
  541. { At this point, d.name contains the name of the current dir}
  542. thedir:='/'+strpas(@(d^.name[0]))+thedir;
  543. thisdev:=dotdotdev;
  544. thisino:=dotdotino;
  545. predot:=predot+'../';
  546. end;
  547. { Now rootino=thisino and rootdev=thisdev so we've reached / }
  548. dir:=thedir
  549. {$endif}
  550. end;
  551. {*****************************************************************************
  552. System Dependent Exit code
  553. *****************************************************************************}
  554. Procedure system_exit;
  555. begin
  556. end;
  557. {*****************************************************************************
  558. SystemUnit Initialization
  559. *****************************************************************************}
  560. Procedure SignalToRunError(Sig:longint);
  561. begin
  562. case sig of
  563. 8 : HandleError(200);
  564. 11 : HandleError(216);
  565. end;
  566. end;
  567. Procedure InstallSignals;
  568. var
  569. sr : syscallregs;
  570. begin
  571. sr.reg3:=longint(@SignalToRunError);
  572. { sigsegv }
  573. sr.reg2:=11;
  574. syscall(syscall_nr_signal,sr);
  575. { sigfpe }
  576. sr.reg2:=8;
  577. syscall(syscall_nr_signal,sr);
  578. end;
  579. procedure SetupCmdLine;
  580. var
  581. bufsize,
  582. len,j,
  583. size,i : longint;
  584. found : boolean;
  585. buf : array[0..1026] of char;
  586. procedure AddBuf;
  587. begin
  588. reallocmem(cmdline,size+bufsize);
  589. move(buf,cmdline[size],bufsize);
  590. inc(size,bufsize);
  591. bufsize:=0;
  592. end;
  593. begin
  594. size:=0;
  595. bufsize:=0;
  596. i:=0;
  597. while (i<argc) do
  598. begin
  599. len:=strlen(argv[i]);
  600. if len>sizeof(buf)-2 then
  601. len:=sizeof(buf)-2;
  602. found:=false;
  603. for j:=1 to len do
  604. if argv[i][j]=' ' then
  605. begin
  606. found:=true;
  607. break;
  608. end;
  609. if bufsize+len>=sizeof(buf)-2 then
  610. AddBuf;
  611. if found then
  612. begin
  613. buf[bufsize]:='"';
  614. inc(bufsize);
  615. end;
  616. move(argv[i]^,buf[bufsize],len);
  617. inc(bufsize,len);
  618. if found then
  619. begin
  620. buf[bufsize]:='"';
  621. inc(bufsize);
  622. end;
  623. if i<argc then
  624. buf[bufsize]:=' '
  625. else
  626. buf[bufsize]:=#0;
  627. inc(bufsize);
  628. inc(i);
  629. end;
  630. AddBuf;
  631. end;
  632. Begin
  633. { Set up signals handlers }
  634. InstallSignals;
  635. { Setup heap }
  636. InitHeap;
  637. InitExceptions;
  638. { Arguments }
  639. SetupCmdLine;
  640. { Setup stdin, stdout and stderr }
  641. OpenStdIO(Input,fmInput,StdInputHandle);
  642. OpenStdIO(Output,fmOutput,StdOutputHandle);
  643. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  644. OpenStdIO(StdErr,fmOutput,StdErrorHandle);
  645. { Reset IO Error }
  646. InOutRes:=0;
  647. End.
  648. {
  649. $Log$
  650. Revision 1.33 2000-01-16 22:25:38 peter
  651. * check handle for file closing
  652. Revision 1.32 2000/01/07 16:41:41 daniel
  653. * copyright 2000
  654. Revision 1.31 2000/01/07 16:32:28 daniel
  655. * copyright 2000 added
  656. Revision 1.30 1999/12/01 22:57:31 peter
  657. * cmdline support
  658. Revision 1.29 1999/11/06 14:39:12 peter
  659. * truncated log
  660. Revision 1.28 1999/10/28 09:50:06 peter
  661. * use mmap instead of brk
  662. Revision 1.27 1999/09/10 15:40:35 peter
  663. * fixed do_open flags to be > $100, becuase filemode can be upto 255
  664. Revision 1.26 1999/09/08 16:14:43 peter
  665. * pointer fixes
  666. Revision 1.25 1999/07/28 23:18:36 peter
  667. * closedir fixes, which now disposes the pdir itself
  668. Revision 1.24 1999/05/17 21:52:42 florian
  669. * most of the Object Pascal stuff moved to the system unit
  670. Revision 1.23 1999/04/08 12:23:04 peter
  671. * removed os.inc
  672. Revision 1.22 1999/01/18 10:05:53 pierre
  673. + system_exit procedure added
  674. Revision 1.21 1998/12/28 15:50:49 peter
  675. + stdout, which is needed when you write something in the system unit
  676. to the screen. Like the runtime error
  677. Revision 1.20 1998/12/18 17:21:34 peter
  678. * fixed io-error handling
  679. Revision 1.19 1998/12/15 22:43:08 peter
  680. * removed temp symbols
  681. Revision 1.18 1998/11/16 10:21:32 peter
  682. * fixes for H+
  683. Revision 1.17 1998/10/15 08:30:00 peter
  684. + sigfpe -> runerror 200
  685. Revision 1.16 1998/09/14 10:48:27 peter
  686. * FPC_ names
  687. * Heap manager is now system independent
  688. Revision 1.15 1998/09/06 19:41:40 peter
  689. * fixed unusedhandle for 0.99.5
  690. Revision 1.14 1998/09/04 18:16:16 peter
  691. * uniform filerec/textrec (with recsize:longint and name:0..255)
  692. Revision 1.13 1998/08/14 11:59:41 carl
  693. + m68k fixes
  694. Revision 1.12 1998/08/12 14:01:37 michael
  695. + Small m68k fixes
  696. Revision 1.11 1998/08/11 08:30:37 michael
  697. + Fixed paramstr() - sometimes there are no 255 characters available.
  698. Revision 1.10 1998/07/30 13:26:15 michael
  699. + Added support for ErrorProc variable. All internal functions are required
  700. to call HandleError instead of runerror from now on.
  701. This is necessary for exception support.
  702. Revision 1.9 1998/07/20 23:40:20 michael
  703. changed sbrk to fc_sbrk, to avoid conflicts with C library.
  704. }