dos.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt and Peter Vreman,
  5. members 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. Unit Dos;
  13. Interface
  14. Const
  15. {Max FileName Length for files}
  16. FileNameLen=255;
  17. Type
  18. SearchRec =
  19. {$ifndef ARM}
  20. packed
  21. {$endif ARM}
  22. Record
  23. {Fill : array[1..21] of byte; Fill replaced with below}
  24. SearchNum : LongInt; {to track which search this is}
  25. SearchPos : LongInt; {directory position}
  26. DirPtr : Pointer; {directory pointer for reading directory}
  27. SearchType : Byte; {0=normal, 1=open will close, 2=only 1 file}
  28. SearchAttr : Byte; {attribute we are searching for}
  29. Fill : Array[1..07] of Byte; {future use}
  30. {End of fill}
  31. Attr : Byte; {attribute of found file}
  32. Time : LongInt; {last modify date of found file}
  33. Size : LongInt; {file size of found file}
  34. Reserved : Word; {future use}
  35. Name : String[FileNameLen]; {name of found file}
  36. SearchSpec : String[FileNameLen]; {search pattern}
  37. NamePos : Word; {end of path, start of name position}
  38. End;
  39. {$ifdef cpui386}
  40. Registers = packed record
  41. case i : integer of
  42. 0 : (ax,f1,bx,f2,cx,f3,dx,f4,bp,f5,si,f51,di,f6,ds,f7,es,f8,flags,fs,gs : word);
  43. 1 : (al,ah,f9,f10,bl,bh,f11,f12,cl,ch,f13,f14,dl,dh : byte);
  44. 2 : (eax, ebx, ecx, edx, ebp, esi, edi : longint);
  45. End;
  46. {$endif cpui386}
  47. {$i dosh.inc}
  48. {Extra Utils}
  49. function weekday(y,m,d : longint) : longint;
  50. Procedure UnixDateToDt(SecsPast: LongInt; Var Dt: DateTime);
  51. Function DTToUnixDate(DT: DateTime): LongInt;
  52. {Disk}
  53. Procedure AddDisk(const path:string);
  54. Implementation
  55. Uses
  56. Strings,UnixUtil,Unix,BaseUnix;
  57. {******************************************************************************
  58. --- Link C Lib if set ---
  59. ******************************************************************************}
  60. type
  61. RtlInfoType = Record
  62. FMode,
  63. FInode,
  64. FUid,
  65. FGid,
  66. FSize,
  67. FMTime : LongInt;
  68. End;
  69. {******************************************************************************
  70. --- Info / Date / Time ---
  71. ******************************************************************************}
  72. Const
  73. {Date Calculation}
  74. C1970 = 2440588;
  75. D0 = 1461;
  76. D1 = 146097;
  77. D2 = 1721119;
  78. type
  79. GTRec = packed Record
  80. Year,
  81. Month,
  82. MDay,
  83. WDay,
  84. Hour,
  85. Minute,
  86. Second : Word;
  87. End;
  88. Function DosVersion:Word;
  89. Var
  90. Buffer : Array[0..255] of Char;
  91. Tmp2,
  92. TmpStr : String[40];
  93. TmpPos,
  94. SubRel,
  95. Rel : LongInt;
  96. info : utsname;
  97. Begin
  98. FPUName(info);
  99. Move(info.release,buffer[0],40);
  100. TmpStr:=StrPas(Buffer);
  101. SubRel:=0;
  102. TmpPos:=Pos('.',TmpStr);
  103. if TmpPos>0 then
  104. begin
  105. Tmp2:=Copy(TmpStr,TmpPos+1,40);
  106. Delete(TmpStr,TmpPos,40);
  107. end;
  108. TmpPos:=Pos('.',Tmp2);
  109. if TmpPos>0 then
  110. Delete(Tmp2,TmpPos,40);
  111. Val(TmpStr,Rel);
  112. Val(Tmp2,SubRel);
  113. DosVersion:=Rel+(SubRel shl 8);
  114. End;
  115. function WeekDay (y,m,d:longint):longint;
  116. {
  117. Calculates th day of the week. returns -1 on error
  118. }
  119. var
  120. u,v : longint;
  121. begin
  122. if (m<1) or (m>12) or (y<1600) or (y>4000) or
  123. (d<1) or (d>30+((m+ord(m>7)) and 1)-ord(m=2)) or
  124. ((m*d=58) and (((y mod 4>0) or (y mod 100=0)) and (y mod 400>0))) then
  125. WeekDay:=-1
  126. else
  127. begin
  128. u:=m;
  129. v:=y;
  130. if m<3 then
  131. begin
  132. inc(u,12);
  133. dec(v);
  134. end;
  135. WeekDay:=(d+2*u+((3*(u+1)) div 5)+v+(v div 4)-(v div 100)+(v div 400)+1) mod 7;
  136. end;
  137. end;
  138. Procedure GetDate(Var Year, Month, MDay, WDay: Word);
  139. Begin
  140. Unix.GetDate(Year,Month,MDay);
  141. Wday:=weekday(Year,Month,MDay);
  142. end;
  143. Procedure SetDate(Year, Month, Day: Word);
  144. Begin
  145. Unix.SetDate ( Year, Month, Day );
  146. End;
  147. Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
  148. Begin
  149. Unix.GetTime(Hour,Minute,Second,Sec100);
  150. end;
  151. Procedure SetTime(Hour, Minute, Second, Sec100: Word);
  152. Begin
  153. Unix.SetTime ( Hour, Minute, Second );
  154. End;
  155. Procedure packtime(var t : datetime;var p : longint);
  156. Begin
  157. p:=(t.sec shr 1)+(t.min shl 5)+(t.hour shl 11)+(t.day shl 16)+(t.month shl 21)+((t.year-1980) shl 25);
  158. End;
  159. Procedure unpacktime(p : longint;var t : datetime);
  160. Begin
  161. t.sec:=(p and 31) shl 1;
  162. t.min:=(p shr 5) and 63;
  163. t.hour:=(p shr 11) and 31;
  164. t.day:=(p shr 16) and 31;
  165. t.month:=(p shr 21) and 15;
  166. t.year:=(p shr 25)+1980;
  167. End;
  168. Procedure UnixDateToDt(SecsPast: LongInt; Var Dt: DateTime);
  169. Begin
  170. EpochToLocal(SecsPast,dt.Year,dt.Month,dt.Day,dt.Hour,dt.Min,dt.Sec);
  171. End;
  172. Function DTToUnixDate(DT: DateTime): LongInt;
  173. Begin
  174. DTToUnixDate:=LocalToEpoch(dt.Year,dt.Month,dt.Day,dt.Hour,dt.Min,dt.Sec);
  175. End;
  176. {******************************************************************************
  177. --- Exec ---
  178. ******************************************************************************}
  179. {$ifdef HASTHREADVAR}
  180. {$ifdef VER1_9_2}
  181. var
  182. {$else VER1_9_2}
  183. threadvar
  184. {$endif VER1_9_2}
  185. {$else HASTHREADVAR}
  186. var
  187. {$endif HASTHREADVAR}
  188. LastDosExitCode: word;
  189. Procedure Exec (Const Path: PathStr; Const ComLine: ComStr);
  190. var
  191. pid : longint;
  192. // The Error-Checking in the previous Version failed, since halt($7F) gives an WaitPid-status of $7F00
  193. Begin
  194. LastDosExitCode:=0;
  195. pid:=fpFork;
  196. if pid=0 then
  197. begin
  198. {The child does the actual exec, and then exits}
  199. if ComLine='' then
  200. Execl(Path)
  201. else
  202. Execl(Path+' '+ComLine);
  203. {If the execve fails, we return an exitvalue of 127, to let it be known}
  204. fpExit(127);
  205. end
  206. else
  207. if pid=-1 then {Fork failed}
  208. begin
  209. DosError:=8;
  210. exit
  211. end;
  212. {We're in the parent, let's wait.}
  213. LastDosExitCode:=WaitProcess(pid); // WaitPid and result-convert
  214. if (LastDosExitCode>=0) and (LastDosExitCode<>127) then
  215. DosError:=0
  216. else
  217. DosError:=8; // perhaps one time give an better error
  218. End;
  219. Function DosExitCode: Word;
  220. Begin
  221. DosExitCode:=LastDosExitCode;
  222. End;
  223. {******************************************************************************
  224. --- Disk ---
  225. ******************************************************************************}
  226. {
  227. The Diskfree and Disksize functions need a file on the specified drive, since this
  228. is required for the statfs system call.
  229. These filenames are set in drivestr[0..26], and have been preset to :
  230. 0 - '.' (default drive - hence current dir is ok.)
  231. 1 - '/fd0/.' (floppy drive 1 - should be adapted to local system )
  232. 2 - '/fd1/.' (floppy drive 2 - should be adapted to local system )
  233. 3 - '/' (C: equivalent of dos is the root partition)
  234. 4..26 (can be set by you're own applications)
  235. ! Use AddDisk() to Add new drives !
  236. They both return -1 when a failure occurs.
  237. }
  238. Const
  239. FixDriveStr : array[0..3] of pchar=(
  240. '.',
  241. '/fd0/.',
  242. '/fd1/.',
  243. '/.'
  244. );
  245. const
  246. Drives : byte = 4;
  247. var
  248. DriveStr : array[4..26] of pchar;
  249. Procedure AddDisk(const path:string);
  250. begin
  251. if not (DriveStr[Drives]=nil) then
  252. FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
  253. GetMem(DriveStr[Drives],length(Path)+1);
  254. StrPCopy(DriveStr[Drives],path);
  255. inc(Drives);
  256. if Drives>26 then
  257. Drives:=4;
  258. end;
  259. Function DiskFree(Drive: Byte): int64;
  260. var
  261. fs : tstatfs;
  262. Begin
  263. if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (StatFS(StrPas(fixdrivestr[drive]),fs)<>-1)) or
  264. ((not (drivestr[Drive]=nil)) and (StatFS(StrPas(drivestr[drive]),fs)<>-1)) then
  265. Diskfree:=int64(fs.bavail)*int64(fs.bsize)
  266. else
  267. Diskfree:=-1;
  268. End;
  269. Function DiskSize(Drive: Byte): int64;
  270. var
  271. fs : tstatfs;
  272. Begin
  273. if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (StatFS(StrPas(fixdrivestr[drive]),fs)<>-1)) or
  274. ((not (drivestr[Drive]=nil)) and (StatFS(StrPas(drivestr[drive]),fs)<>-1)) then
  275. DiskSize:=int64(fs.blocks)*int64(fs.bsize)
  276. else
  277. DiskSize:=-1;
  278. End;
  279. {******************************************************************************
  280. --- Findfirst FindNext ---
  281. ******************************************************************************}
  282. Const
  283. RtlFindSize = 15;
  284. Type
  285. RtlFindRecType = Record
  286. DirPtr : Pointer;
  287. SearchNum,
  288. LastUsed : LongInt;
  289. End;
  290. Var
  291. RtlFindRecs : Array[1..RtlFindSize] of RtlFindRecType;
  292. CurrSearchNum : LongInt;
  293. Procedure FindClose(Var f: SearchRec);
  294. {
  295. Closes dirptr if it is open
  296. }
  297. Var
  298. i : longint;
  299. Begin
  300. if f.SearchType=0 then
  301. begin
  302. i:=1;
  303. repeat
  304. if (RtlFindRecs[i].SearchNum=f.SearchNum) then
  305. break;
  306. inc(i);
  307. until (i>RtlFindSize);
  308. If i<=RtlFindSize Then
  309. Begin
  310. RtlFindRecs[i].SearchNum:=0;
  311. if f.dirptr<>nil then
  312. fpclosedir(pdir(f.dirptr)^);
  313. End;
  314. end;
  315. f.dirptr:=nil;
  316. End;
  317. Function FindGetFileInfo(const s:string;var f:SearchRec):boolean;
  318. var
  319. DT : DateTime;
  320. Info : RtlInfoType;
  321. st : baseunix.stat;
  322. begin
  323. FindGetFileInfo:=false;
  324. if not fpstat(s,st)>=0 then
  325. exit;
  326. info.FSize:=st.st_Size;
  327. info.FMTime:=st.st_mtime;
  328. if (st.st_mode and STAT_IFMT)=STAT_IFDIR then
  329. info.fmode:=$10
  330. else
  331. info.fmode:=$0;
  332. if (st.st_mode and STAT_IWUSR)=0 then
  333. info.fmode:=info.fmode or 1;
  334. if s[f.NamePos+1]='.' then
  335. info.fmode:=info.fmode or $2;
  336. If ((Info.FMode and Not(f.searchattr))=0) Then
  337. Begin
  338. f.Name:=Copy(s,f.NamePos+1,255);
  339. f.Attr:=Info.FMode;
  340. f.Size:=Info.FSize;
  341. UnixDateToDT(Info.FMTime, DT);
  342. PackTime(DT,f.Time);
  343. FindGetFileInfo:=true;
  344. End;
  345. end;
  346. Function FindLastUsed: Longint;
  347. {
  348. Find unused or least recently used dirpointer slot in findrecs array
  349. }
  350. Var
  351. BestMatch,i : Longint;
  352. Found : Boolean;
  353. Begin
  354. BestMatch:=1;
  355. i:=1;
  356. Found:=False;
  357. While (i <= RtlFindSize) And (Not Found) Do
  358. Begin
  359. If (RtlFindRecs[i].SearchNum = 0) Then
  360. Begin
  361. BestMatch := i;
  362. Found := True;
  363. End
  364. Else
  365. Begin
  366. If RtlFindRecs[i].LastUsed > RtlFindRecs[BestMatch].LastUsed Then
  367. BestMatch := i;
  368. End;
  369. Inc(i);
  370. End;
  371. FindLastUsed := BestMatch;
  372. End;
  373. Procedure FindNext(Var f: SearchRec);
  374. {
  375. re-opens dir if not already in array and calls FindWorkProc
  376. }
  377. Var
  378. DirName : Array[0..256] of Char;
  379. i,
  380. ArrayPos : Longint;
  381. FName,
  382. SName : string;
  383. Found,
  384. Finished : boolean;
  385. p : PDirEnt;
  386. Begin
  387. If f.SearchType=0 Then
  388. Begin
  389. ArrayPos:=0;
  390. For i:=1 to RtlFindSize Do
  391. Begin
  392. If RtlFindRecs[i].SearchNum = f.SearchNum Then
  393. ArrayPos:=i;
  394. Inc(RtlFindRecs[i].LastUsed);
  395. End;
  396. If ArrayPos=0 Then
  397. Begin
  398. If f.NamePos = 0 Then
  399. Begin
  400. DirName[0] := '.';
  401. DirName[1] := '/';
  402. DirName[2] := #0;
  403. End
  404. Else
  405. Begin
  406. Move(f.SearchSpec[1], DirName[0], f.NamePos);
  407. DirName[f.NamePos] := #0;
  408. End;
  409. f.DirPtr := fpopendir(@(DirName));
  410. If f.DirPtr <> nil Then
  411. begin
  412. ArrayPos:=FindLastUsed;
  413. If RtlFindRecs[ArrayPos].SearchNum > 0 Then
  414. FpCloseDir((pdir(rtlfindrecs[arraypos].dirptr)^));
  415. RtlFindRecs[ArrayPos].SearchNum := f.SearchNum;
  416. RtlFindRecs[ArrayPos].DirPtr := f.DirPtr;
  417. if f.searchpos>0 then
  418. seekdir(pdir(f.dirptr), f.searchpos);
  419. end;
  420. End;
  421. if ArrayPos>0 then
  422. RtlFindRecs[ArrayPos].LastUsed:=0;
  423. end;
  424. {Main loop}
  425. SName:=Copy(f.SearchSpec,f.NamePos+1,255);
  426. Found:=False;
  427. Finished:=(f.dirptr=nil);
  428. While Not Finished Do
  429. Begin
  430. p:=fpreaddir(pdir(f.dirptr)^);
  431. if p=nil then
  432. FName:=''
  433. else
  434. FName:=Strpas(@p^.d_name);
  435. If FName='' Then
  436. Finished:=True
  437. Else
  438. Begin
  439. If FNMatch(SName,FName) Then
  440. Begin
  441. Found:=FindGetFileInfo(Copy(f.SearchSpec,1,f.NamePos)+FName,f);
  442. if Found then
  443. Finished:=true;
  444. End;
  445. End;
  446. End;
  447. {Shutdown}
  448. If Found Then
  449. Begin
  450. f.searchpos:=telldir(pdir(f.dirptr));
  451. DosError:=0;
  452. End
  453. Else
  454. Begin
  455. FindClose(f);
  456. DosError:=18;
  457. End;
  458. End;
  459. Procedure FindFirst(Const Path: PathStr; Attr: Word; Var f: SearchRec);
  460. {
  461. opens dir and calls FindWorkProc
  462. }
  463. Begin
  464. if Path='' then
  465. begin
  466. DosError:=3;
  467. exit;
  468. end;
  469. {Create Info}
  470. f.SearchSpec := Path;
  471. {We always also search for readonly and archive, regardless of Attr:}
  472. f.SearchAttr := Attr or archive or readonly;
  473. f.SearchPos := 0;
  474. f.NamePos := Length(f.SearchSpec);
  475. while (f.NamePos>0) and (f.SearchSpec[f.NamePos]<>'/') do
  476. dec(f.NamePos);
  477. {Wildcards?}
  478. if (Pos('?',Path)=0) and (Pos('*',Path)=0) then
  479. begin
  480. if FindGetFileInfo(Path,f) then
  481. DosError:=0
  482. else
  483. begin
  484. { According to tdos2 test it should return 18
  485. if ErrNo=Sys_ENOENT then
  486. DosError:=3
  487. else }
  488. DosError:=18;
  489. end;
  490. f.DirPtr:=nil;
  491. f.SearchType:=1;
  492. f.searchnum:=-1;
  493. end
  494. else
  495. {Find Entry}
  496. begin
  497. Inc(CurrSearchNum);
  498. f.SearchNum:=CurrSearchNum;
  499. f.SearchType:=0;
  500. FindNext(f);
  501. end;
  502. End;
  503. {******************************************************************************
  504. --- File ---
  505. ******************************************************************************}
  506. Procedure FSplit(Path: PathStr; Var Dir: DirStr; Var Name: NameStr;Var Ext: ExtStr);
  507. Begin
  508. UnixUtil.FSplit(Path,Dir,Name,Ext);
  509. End;
  510. Function FExpand(Const Path: PathStr): PathStr;
  511. Begin
  512. FExpand:=Unix.FExpand(Path);
  513. End;
  514. Function FSearch(path : pathstr;dirlist : string) : pathstr;
  515. Var
  516. info : BaseUnix.stat;
  517. Begin
  518. if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) then
  519. FSearch:=path
  520. else
  521. FSearch:=Unix.FSearch(path,dirlist);
  522. End;
  523. Procedure GetFAttr(var f; var attr : word);
  524. Var
  525. info : baseunix.stat;
  526. LinAttr : longint;
  527. Begin
  528. DosError:=0;
  529. if FPStat(strpas(@textrec(f).name),info)<0 then
  530. begin
  531. Attr:=0;
  532. DosError:=3;
  533. exit;
  534. end
  535. else
  536. LinAttr:=Info.st_Mode;
  537. if fpS_ISDIR(LinAttr) then
  538. Attr:=$10
  539. else
  540. Attr:=$0;
  541. if fpAccess(strpas(@textrec(f).name),W_OK)<0 then
  542. Attr:=Attr or $1;
  543. if filerec(f).name[0]='.' then
  544. Attr:=Attr or $2;
  545. end;
  546. Procedure getftime (var f; var time : longint);
  547. Var
  548. Info: baseunix.stat;
  549. DT: DateTime;
  550. Begin
  551. doserror:=0;
  552. if fpfstat(filerec(f).handle,info)<0 then
  553. begin
  554. Time:=0;
  555. doserror:=6;
  556. exit
  557. end
  558. else
  559. UnixDateToDT(Info.st_mTime,DT);
  560. PackTime(DT,Time);
  561. End;
  562. Procedure setftime(var f; time : longint);
  563. Var
  564. utim: utimbuf;
  565. DT: DateTime;
  566. path: pathstr;
  567. index: Integer;
  568. Begin
  569. doserror:=0;
  570. with utim do
  571. begin
  572. actime:=getepochtime;
  573. UnPackTime(Time,DT);
  574. modtime:=DTToUnixDate(DT);
  575. end;
  576. path := strpas(@filerec(f).name);
  577. if fputime(path,@utim)<0 then
  578. begin
  579. Time:=0;
  580. doserror:=3;
  581. end;
  582. End;
  583. {******************************************************************************
  584. --- Environment ---
  585. ******************************************************************************}
  586. Function EnvCount: Longint;
  587. var
  588. envcnt : longint;
  589. p : ppchar;
  590. Begin
  591. envcnt:=0;
  592. p:=envp; {defined in syslinux}
  593. while (p^<>nil) do
  594. begin
  595. inc(envcnt);
  596. inc(p);
  597. end;
  598. EnvCount := envcnt
  599. End;
  600. Function EnvStr (Index: longint): String;
  601. Var
  602. i : longint;
  603. p : ppchar;
  604. Begin
  605. p:=envp; {defined in syslinux}
  606. i:=1;
  607. while (i<Index) and (p^<>nil) do
  608. begin
  609. inc(i);
  610. inc(p);
  611. end;
  612. if p=nil then
  613. envstr:=''
  614. else
  615. envstr:=strpas(p^)
  616. End;
  617. Function GetEnv(EnvVar: String): String;
  618. var
  619. p : pchar;
  620. Begin
  621. p:=BaseUnix.fpGetEnv(EnvVar);
  622. if p=nil then
  623. GetEnv:=''
  624. else
  625. GetEnv:=StrPas(p);
  626. End;
  627. {******************************************************************************
  628. --- Do Nothing Procedures/Functions ---
  629. ******************************************************************************}
  630. {$ifdef cpui386}
  631. Procedure Intr (intno: byte; var regs: registers);
  632. Begin
  633. {! No Unix equivalent !}
  634. End;
  635. Procedure msdos(var regs : registers);
  636. Begin
  637. {! No Unix equivalent !}
  638. End;
  639. {$endif cpui386}
  640. Procedure getintvec(intno : byte;var vector : pointer);
  641. Begin
  642. {! No Unix equivalent !}
  643. End;
  644. Procedure setintvec(intno : byte;vector : pointer);
  645. Begin
  646. {! No Unix equivalent !}
  647. End;
  648. Procedure SwapVectors;
  649. Begin
  650. {! No Unix equivalent !}
  651. End;
  652. Procedure keep(exitcode : word);
  653. Begin
  654. {! No Unix equivalent !}
  655. End;
  656. Procedure setfattr (var f;attr : word);
  657. Begin
  658. {! No Unix equivalent !}
  659. { Fail for setting VolumeId }
  660. if (attr and VolumeID)<>0 then
  661. doserror:=5;
  662. End;
  663. Procedure GetCBreak(Var BreakValue: Boolean);
  664. Begin
  665. {! No Unix equivalent !}
  666. breakvalue:=true
  667. End;
  668. Procedure SetCBreak(BreakValue: Boolean);
  669. Begin
  670. {! No Unix equivalent !}
  671. End;
  672. Procedure GetVerify(Var Verify: Boolean);
  673. Begin
  674. {! No Unix equivalent !}
  675. Verify:=true;
  676. End;
  677. Procedure SetVerify(Verify: Boolean);
  678. Begin
  679. {! No Unix equivalent !}
  680. End;
  681. function GetShortName(var p : String) : boolean;
  682. begin
  683. { short=long under *nix}
  684. GetShortName:=True;
  685. end;
  686. function GetLongName(var p : String) : boolean;
  687. begin
  688. { short=long under *nix}
  689. GetLongName:=True;
  690. end;
  691. {******************************************************************************
  692. --- Initialization ---
  693. ******************************************************************************}
  694. End.
  695. {
  696. $Log$
  697. Revision 1.30 2004-02-18 22:00:45 peter
  698. * dirptr changed to pointer
  699. Revision 1.29 2004/02/18 19:08:27 florian
  700. * fixed bootstrapping with 1.9.2
  701. Revision 1.28 2004/02/17 17:37:26 daniel
  702. * Enable threadvars again
  703. Revision 1.27 2004/02/16 22:18:44 hajny
  704. * LastDosExitCode changed back from threadvar temporarily
  705. Revision 1.26 2004/02/15 21:36:10 hajny
  706. * overloaded ExecuteProcess added, EnvStr param changed to longint
  707. Revision 1.25 2004/02/09 17:01:28 marco
  708. * fixes to get it working under FreeBSD, and probably Linux too
  709. Revision 1.24 2004/02/09 12:03:16 michael
  710. + Switched to single interface in dosh.inc
  711. Revision 1.23 2004/01/31 16:15:14 florian
  712. * packing of searchrec for arm fixed
  713. Revision 1.22 2003/12/29 21:15:04 jonas
  714. * fixed setftime (sorry Marco :)
  715. Revision 1.21 2003/12/03 20:17:03 olle
  716. * files are not pretended to have attr ARCHIVED anymore
  717. + FindFirst etc now also filters on attr HIDDEN
  718. * files with attr READONLY and ARCHIVE are always returned by FindFirst etc
  719. Revision 1.19 2003/10/17 22:13:30 olle
  720. * changed i386 to cpui386
  721. Revision 1.18 2003/09/27 12:51:33 peter
  722. * fpISxxx macros renamed to C compliant fpS_ISxxx
  723. Revision 1.17 2003/09/17 17:30:46 marco
  724. * Introduction of unixutil
  725. Revision 1.16 2003/09/14 20:15:01 marco
  726. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  727. Revision 1.15 2003/05/16 20:56:06 florian
  728. no message
  729. Revision 1.14 2003/05/14 13:51:03 florian
  730. * ifdef'd code which i386 specific
  731. Revision 1.13 2002/12/08 16:05:34 peter
  732. * small error code fixes so tdos2 passes
  733. Revision 1.12 2002/09/07 16:01:27 peter
  734. * old logs removed and tabs fixed
  735. }