syslinux.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  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 :
  381. FileRec(f).Handle:=StdInputHandle;
  382. fminout, { this is set by rewrite }
  383. fmoutput :
  384. FileRec(f).Handle:=StdOutputHandle;
  385. fmappend :
  386. begin
  387. FileRec(f).Handle:=StdOutputHandle;
  388. FileRec(f).mode:=fmoutput; {fool fmappend}
  389. end;
  390. end;
  391. exit;
  392. end;
  393. { real open call }
  394. {$ifdef crtlib}
  395. FileRec(f).Handle:=_rtl_open(p, oflags);
  396. if FileRec(f).Handle<0 then
  397. InOutRes:=2
  398. else
  399. InOutRes:=0;
  400. {$else}
  401. FileRec(f).Handle:=sys_open(p,oflags,438);
  402. if (ErrNo=Sys_EROFS) and ((OFlags and Open_RDWR)<>0) then
  403. begin
  404. Oflags:=Oflags and not(Open_RDWR);
  405. FileRec(f).Handle:=sys_open(p,oflags,438);
  406. end;
  407. Errno2Inoutres;
  408. {$endif}
  409. End;
  410. Function Do_IsDevice(Handle:Longint):boolean;
  411. {
  412. Interface to Unix ioctl call.
  413. Performs various operations on the filedescriptor Handle.
  414. Ndx describes the operation to perform.
  415. Data points to data needed for the Ndx function. The structure of this
  416. data is function-dependent.
  417. }
  418. var
  419. sr: SysCallRegs;
  420. Data : array[0..255] of byte; {Large enough for termios info}
  421. begin
  422. sr.reg2:=Handle;
  423. sr.reg3:=$5401; {=TCGETS}
  424. sr.reg4:=Longint(@Data);
  425. Do_IsDevice:=(SysCall(Syscall_nr_ioctl,sr)=0);
  426. end;
  427. {*****************************************************************************
  428. UnTyped File Handling
  429. *****************************************************************************}
  430. {$i file.inc}
  431. {*****************************************************************************
  432. Typed File Handling
  433. *****************************************************************************}
  434. {$i typefile.inc}
  435. {*****************************************************************************
  436. Text File Handling
  437. *****************************************************************************}
  438. {$DEFINE SHORT_LINEBREAK}
  439. {$DEFINE EXTENDED_EOF}
  440. {$i text.inc}
  441. {*****************************************************************************
  442. Directory Handling
  443. *****************************************************************************}
  444. Procedure MkDir(Const s: String);[IOCheck];
  445. Var
  446. Buffer: Array[0..255] of Char;
  447. Begin
  448. If InOutRes <> 0 then exit;
  449. Move(s[1], Buffer, Length(s));
  450. Buffer[Length(s)] := #0;
  451. {$ifdef crtlib}
  452. _rtl_mkdir(@buffer);
  453. {$else}
  454. sys_mkdir(@buffer, 511);
  455. Errno2Inoutres;
  456. {$endif}
  457. End;
  458. Procedure RmDir(Const s: String);[IOCheck];
  459. Var
  460. Buffer: Array[0..255] of Char;
  461. Begin
  462. If InOutRes <> 0 then exit;
  463. Move(s[1], Buffer, Length(s));
  464. Buffer[Length(s)] := #0;
  465. {$ifdef crtlib}
  466. _rtl_rmdir(@buffer);
  467. {$else}
  468. sys_rmdir(@buffer);
  469. Errno2Inoutres;
  470. {$endif}
  471. End;
  472. Procedure ChDir(Const s: String);[IOCheck];
  473. Var
  474. Buffer: Array[0..255] of Char;
  475. Begin
  476. If InOutRes <> 0 then exit;
  477. Move(s[1], Buffer, Length(s));
  478. Buffer[Length(s)] := #0;
  479. {$ifdef crtlib}
  480. _rtl_chdir(@buffer);
  481. {$else}
  482. sys_chdir(@buffer);
  483. Errno2Inoutres;
  484. {$endif}
  485. End;
  486. procedure getdir(drivenr : byte;var dir : shortstring);
  487. {$ifndef crtlib}
  488. var
  489. thisdir : stat;
  490. rootino,
  491. thisino,
  492. dotdotino : longint;
  493. rootdev,
  494. thisdev,
  495. dotdotdev : word;
  496. thedir,dummy : string[255];
  497. dirstream : pdir;
  498. d : pdirent;
  499. mountpoint : boolean;
  500. predot : string[255];
  501. {$endif}
  502. begin
  503. drivenr:=0;
  504. dir:='';
  505. {$ifndef crtlib}
  506. thedir:='/'#0;
  507. if sys_stat(@thedir[1],thisdir)<0 then
  508. exit;
  509. rootino:=thisdir.ino;
  510. rootdev:=thisdir.dev;
  511. thedir:='.'#0;
  512. if sys_stat(@thedir[1],thisdir)<0 then
  513. exit;
  514. thisino:=thisdir.ino;
  515. thisdev:=thisdir.dev;
  516. { Now we can uniquely identify the current and root dir }
  517. thedir:='';
  518. predot:='';
  519. while not ((thisino=rootino) and (thisdev=rootdev)) do
  520. begin
  521. { Are we on a mount point ? }
  522. dummy:=predot+'..'#0;
  523. if sys_stat(@dummy[1],thisdir)<0 then
  524. exit;
  525. dotdotino:=thisdir.ino;
  526. dotdotdev:=thisdir.dev;
  527. mountpoint:=(thisdev<>dotdotdev);
  528. { Now, Try to find the name of this dir in the previous one }
  529. dirstream:=opendir (@dummy[1]);
  530. if dirstream=nil then
  531. exit;
  532. repeat
  533. d:=sys_readdir (dirstream);
  534. if (d<>nil) and
  535. (not ((d^.name[0]='.') and ((d^.name[1]=#0) or ((d^.name[1]='.') and (d^.name[2]=#0))))) and
  536. (mountpoint or (d^.ino=thisino)) then
  537. begin
  538. dummy:=predot+'../'+strpas(@(d^.name[0]))+#0;
  539. if sys_stat (@(dummy[1]),thisdir)<0 then
  540. d:=nil;
  541. end;
  542. until (d=nil) or ((thisdir.dev=thisdev) and (thisdir.ino=thisino) );
  543. if (closedir(dirstream)<0) or (d=nil) then
  544. exit;
  545. { At this point, d.name contains the name of the current dir}
  546. thedir:='/'+strpas(@(d^.name[0]))+thedir;
  547. thisdev:=dotdotdev;
  548. thisino:=dotdotino;
  549. predot:=predot+'../';
  550. end;
  551. { Now rootino=thisino and rootdev=thisdev so we've reached / }
  552. dir:=thedir
  553. {$endif}
  554. end;
  555. {*****************************************************************************
  556. System Dependent Exit code
  557. *****************************************************************************}
  558. Procedure system_exit;
  559. begin
  560. end;
  561. {*****************************************************************************
  562. SystemUnit Initialization
  563. *****************************************************************************}
  564. Procedure SignalToRunError(Sig:longint);
  565. begin
  566. case sig of
  567. 8 : HandleError(200);
  568. 11 : HandleError(216);
  569. end;
  570. end;
  571. Procedure InstallSignals;
  572. var
  573. sr : syscallregs;
  574. begin
  575. sr.reg3:=longint(@SignalToRunError);
  576. { sigsegv }
  577. sr.reg2:=11;
  578. syscall(syscall_nr_signal,sr);
  579. { sigfpe }
  580. sr.reg2:=8;
  581. syscall(syscall_nr_signal,sr);
  582. end;
  583. procedure SetupCmdLine;
  584. var
  585. bufsize,
  586. len,j,
  587. size,i : longint;
  588. found : boolean;
  589. buf : array[0..1026] of char;
  590. procedure AddBuf;
  591. begin
  592. reallocmem(cmdline,size+bufsize);
  593. move(buf,cmdline[size],bufsize);
  594. inc(size,bufsize);
  595. bufsize:=0;
  596. end;
  597. begin
  598. size:=0;
  599. bufsize:=0;
  600. i:=0;
  601. while (i<argc) do
  602. begin
  603. len:=strlen(argv[i]);
  604. if len>sizeof(buf)-2 then
  605. len:=sizeof(buf)-2;
  606. found:=false;
  607. for j:=1 to len do
  608. if argv[i][j]=' ' then
  609. begin
  610. found:=true;
  611. break;
  612. end;
  613. if bufsize+len>=sizeof(buf)-2 then
  614. AddBuf;
  615. if found then
  616. begin
  617. buf[bufsize]:='"';
  618. inc(bufsize);
  619. end;
  620. move(argv[i]^,buf[bufsize],len);
  621. inc(bufsize,len);
  622. if found then
  623. begin
  624. buf[bufsize]:='"';
  625. inc(bufsize);
  626. end;
  627. if i<argc then
  628. buf[bufsize]:=' '
  629. else
  630. buf[bufsize]:=#0;
  631. inc(bufsize);
  632. inc(i);
  633. end;
  634. AddBuf;
  635. end;
  636. Begin
  637. { Set up signals handlers }
  638. InstallSignals;
  639. { Setup heap }
  640. InitHeap;
  641. InitExceptions;
  642. { Arguments }
  643. SetupCmdLine;
  644. { Setup stdin, stdout and stderr }
  645. OpenStdIO(Input,fmInput,StdInputHandle);
  646. OpenStdIO(Output,fmOutput,StdOutputHandle);
  647. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  648. OpenStdIO(StdErr,fmOutput,StdErrorHandle);
  649. { Reset IO Error }
  650. InOutRes:=0;
  651. End.
  652. {
  653. $Log$
  654. Revision 1.34 2000-01-20 23:38:02 peter
  655. * support fm_inout as stdoutput for assign(f,'');rewrite(f,1); becuase
  656. rewrite opens always with filemode 2
  657. Revision 1.33 2000/01/16 22:25:38 peter
  658. * check handle for file closing
  659. Revision 1.32 2000/01/07 16:41:41 daniel
  660. * copyright 2000
  661. Revision 1.31 2000/01/07 16:32:28 daniel
  662. * copyright 2000 added
  663. Revision 1.30 1999/12/01 22:57:31 peter
  664. * cmdline support
  665. Revision 1.29 1999/11/06 14:39:12 peter
  666. * truncated log
  667. Revision 1.28 1999/10/28 09:50:06 peter
  668. * use mmap instead of brk
  669. Revision 1.27 1999/09/10 15:40:35 peter
  670. * fixed do_open flags to be > $100, becuase filemode can be upto 255
  671. Revision 1.26 1999/09/08 16:14:43 peter
  672. * pointer fixes
  673. Revision 1.25 1999/07/28 23:18:36 peter
  674. * closedir fixes, which now disposes the pdir itself
  675. Revision 1.24 1999/05/17 21:52:42 florian
  676. * most of the Object Pascal stuff moved to the system unit
  677. Revision 1.23 1999/04/08 12:23:04 peter
  678. * removed os.inc
  679. Revision 1.22 1999/01/18 10:05:53 pierre
  680. + system_exit procedure added
  681. Revision 1.21 1998/12/28 15:50:49 peter
  682. + stdout, which is needed when you write something in the system unit
  683. to the screen. Like the runtime error
  684. Revision 1.20 1998/12/18 17:21:34 peter
  685. * fixed io-error handling
  686. Revision 1.19 1998/12/15 22:43:08 peter
  687. * removed temp symbols
  688. Revision 1.18 1998/11/16 10:21:32 peter
  689. * fixes for H+
  690. Revision 1.17 1998/10/15 08:30:00 peter
  691. + sigfpe -> runerror 200
  692. Revision 1.16 1998/09/14 10:48:27 peter
  693. * FPC_ names
  694. * Heap manager is now system independent
  695. Revision 1.15 1998/09/06 19:41:40 peter
  696. * fixed unusedhandle for 0.99.5
  697. Revision 1.14 1998/09/04 18:16:16 peter
  698. * uniform filerec/textrec (with recsize:longint and name:0..255)
  699. Revision 1.13 1998/08/14 11:59:41 carl
  700. + m68k fixes
  701. Revision 1.12 1998/08/12 14:01:37 michael
  702. + Small m68k fixes
  703. Revision 1.11 1998/08/11 08:30:37 michael
  704. + Fixed paramstr() - sometimes there are no 255 characters available.
  705. Revision 1.10 1998/07/30 13:26:15 michael
  706. + Added support for ErrorProc variable. All internal functions are required
  707. to call HandleError instead of runerror from now on.
  708. This is necessary for exception support.
  709. Revision 1.9 1998/07/20 23:40:20 michael
  710. changed sbrk to fc_sbrk, to avoid conflicts with C library.
  711. }