syslinux.pp 18 KB

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