dos.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  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,UnixType;
  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. fillchar(f,sizeof(f),0);
  465. if Path='' then
  466. begin
  467. DosError:=3;
  468. exit;
  469. end;
  470. {Create Info}
  471. f.SearchSpec := Path;
  472. {We always also search for readonly and archive, regardless of Attr:}
  473. f.SearchAttr := Attr or archive or readonly;
  474. f.SearchPos := 0;
  475. f.NamePos := Length(f.SearchSpec);
  476. while (f.NamePos>0) and (f.SearchSpec[f.NamePos]<>'/') do
  477. dec(f.NamePos);
  478. {Wildcards?}
  479. if (Pos('?',Path)=0) and (Pos('*',Path)=0) then
  480. begin
  481. if FindGetFileInfo(Path,f) then
  482. DosError:=0
  483. else
  484. begin
  485. { According to tdos2 test it should return 18
  486. if ErrNo=Sys_ENOENT then
  487. DosError:=3
  488. else }
  489. DosError:=18;
  490. end;
  491. f.DirPtr:=nil;
  492. f.SearchType:=1;
  493. f.searchnum:=-1;
  494. end
  495. else
  496. {Find Entry}
  497. begin
  498. Inc(CurrSearchNum);
  499. f.SearchNum:=CurrSearchNum;
  500. f.SearchType:=0;
  501. FindNext(f);
  502. end;
  503. End;
  504. {******************************************************************************
  505. --- File ---
  506. ******************************************************************************}
  507. Procedure FSplit(Path: PathStr; Var Dir: DirStr; Var Name: NameStr;Var Ext: ExtStr);
  508. Begin
  509. UnixUtil.FSplit(Path,Dir,Name,Ext);
  510. End;
  511. Function FExpand(Const Path: PathStr): PathStr;
  512. Begin
  513. FExpand:=Unix.FExpand(Path);
  514. End;
  515. Function FSearch(path : pathstr;dirlist : string) : pathstr;
  516. Var
  517. info : BaseUnix.stat;
  518. Begin
  519. if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) then
  520. FSearch:=path
  521. else
  522. FSearch:=Unix.FSearch(path,dirlist);
  523. End;
  524. Procedure GetFAttr(var f; var attr : word);
  525. Var
  526. info : baseunix.stat;
  527. LinAttr : longint;
  528. Begin
  529. DosError:=0;
  530. if FPStat(strpas(@textrec(f).name),info)<0 then
  531. begin
  532. Attr:=0;
  533. DosError:=3;
  534. exit;
  535. end
  536. else
  537. LinAttr:=Info.st_Mode;
  538. if fpS_ISDIR(LinAttr) then
  539. Attr:=$10
  540. else
  541. Attr:=$0;
  542. if fpAccess(strpas(@textrec(f).name),W_OK)<0 then
  543. Attr:=Attr or $1;
  544. if filerec(f).name[0]='.' then
  545. Attr:=Attr or $2;
  546. end;
  547. Procedure getftime (var f; var time : longint);
  548. Var
  549. Info: baseunix.stat;
  550. DT: DateTime;
  551. Begin
  552. doserror:=0;
  553. if fpfstat(filerec(f).handle,info)<0 then
  554. begin
  555. Time:=0;
  556. doserror:=6;
  557. exit
  558. end
  559. else
  560. UnixDateToDT(Info.st_mTime,DT);
  561. PackTime(DT,Time);
  562. End;
  563. Procedure setftime(var f; time : longint);
  564. Var
  565. utim: utimbuf;
  566. DT: DateTime;
  567. path: pathstr;
  568. index: Integer;
  569. Begin
  570. doserror:=0;
  571. with utim do
  572. begin
  573. actime:=getepochtime;
  574. UnPackTime(Time,DT);
  575. modtime:=DTToUnixDate(DT);
  576. end;
  577. path := strpas(@filerec(f).name);
  578. if fputime(path,@utim)<0 then
  579. begin
  580. Time:=0;
  581. doserror:=3;
  582. end;
  583. End;
  584. {******************************************************************************
  585. --- Environment ---
  586. ******************************************************************************}
  587. Function EnvCount: Longint;
  588. var
  589. envcnt : longint;
  590. p : ppchar;
  591. Begin
  592. envcnt:=0;
  593. p:=envp; {defined in syslinux}
  594. while (p^<>nil) do
  595. begin
  596. inc(envcnt);
  597. inc(p);
  598. end;
  599. EnvCount := envcnt
  600. End;
  601. Function EnvStr (Index: longint): String;
  602. Var
  603. i : longint;
  604. p : ppchar;
  605. Begin
  606. p:=envp; {defined in syslinux}
  607. i:=1;
  608. while (i<Index) and (p^<>nil) do
  609. begin
  610. inc(i);
  611. inc(p);
  612. end;
  613. if p=nil then
  614. envstr:=''
  615. else
  616. envstr:=strpas(p^)
  617. End;
  618. Function GetEnv(EnvVar: String): String;
  619. var
  620. p : pchar;
  621. Begin
  622. p:=BaseUnix.fpGetEnv(EnvVar);
  623. if p=nil then
  624. GetEnv:=''
  625. else
  626. GetEnv:=StrPas(p);
  627. End;
  628. {******************************************************************************
  629. --- Do Nothing Procedures/Functions ---
  630. ******************************************************************************}
  631. {$ifdef cpui386}
  632. Procedure Intr (intno: byte; var regs: registers);
  633. Begin
  634. {! No Unix equivalent !}
  635. End;
  636. Procedure msdos(var regs : registers);
  637. Begin
  638. {! No Unix equivalent !}
  639. End;
  640. {$endif cpui386}
  641. Procedure getintvec(intno : byte;var vector : pointer);
  642. Begin
  643. {! No Unix equivalent !}
  644. End;
  645. Procedure setintvec(intno : byte;vector : pointer);
  646. Begin
  647. {! No Unix equivalent !}
  648. End;
  649. Procedure SwapVectors;
  650. Begin
  651. {! No Unix equivalent !}
  652. End;
  653. Procedure keep(exitcode : word);
  654. Begin
  655. {! No Unix equivalent !}
  656. End;
  657. Procedure setfattr (var f;attr : word);
  658. Begin
  659. {! No Unix equivalent !}
  660. { Fail for setting VolumeId }
  661. if (attr and VolumeID)<>0 then
  662. doserror:=5;
  663. End;
  664. Procedure GetCBreak(Var BreakValue: Boolean);
  665. Begin
  666. {! No Unix equivalent !}
  667. breakvalue:=true
  668. End;
  669. Procedure SetCBreak(BreakValue: Boolean);
  670. Begin
  671. {! No Unix equivalent !}
  672. End;
  673. Procedure GetVerify(Var Verify: Boolean);
  674. Begin
  675. {! No Unix equivalent !}
  676. Verify:=true;
  677. End;
  678. Procedure SetVerify(Verify: Boolean);
  679. Begin
  680. {! No Unix equivalent !}
  681. End;
  682. function GetShortName(var p : String) : boolean;
  683. begin
  684. { short=long under *nix}
  685. GetShortName:=True;
  686. end;
  687. function GetLongName(var p : String) : boolean;
  688. begin
  689. { short=long under *nix}
  690. GetLongName:=True;
  691. end;
  692. {******************************************************************************
  693. --- Initialization ---
  694. ******************************************************************************}
  695. End.
  696. {
  697. $Log$
  698. Revision 1.32 2004-03-14 18:42:39 peter
  699. * reset searchrec info in findfirst
  700. Revision 1.31 2004/03/04 22:15:16 marco
  701. * UnixType changes. Please report problems to me.
  702. Revision 1.30 2004/02/18 22:00:45 peter
  703. * dirptr changed to pointer
  704. Revision 1.29 2004/02/18 19:08:27 florian
  705. * fixed bootstrapping with 1.9.2
  706. Revision 1.28 2004/02/17 17:37:26 daniel
  707. * Enable threadvars again
  708. Revision 1.27 2004/02/16 22:18:44 hajny
  709. * LastDosExitCode changed back from threadvar temporarily
  710. Revision 1.26 2004/02/15 21:36:10 hajny
  711. * overloaded ExecuteProcess added, EnvStr param changed to longint
  712. Revision 1.25 2004/02/09 17:01:28 marco
  713. * fixes to get it working under FreeBSD, and probably Linux too
  714. Revision 1.24 2004/02/09 12:03:16 michael
  715. + Switched to single interface in dosh.inc
  716. Revision 1.23 2004/01/31 16:15:14 florian
  717. * packing of searchrec for arm fixed
  718. Revision 1.22 2003/12/29 21:15:04 jonas
  719. * fixed setftime (sorry Marco :)
  720. Revision 1.21 2003/12/03 20:17:03 olle
  721. * files are not pretended to have attr ARCHIVED anymore
  722. + FindFirst etc now also filters on attr HIDDEN
  723. * files with attr READONLY and ARCHIVE are always returned by FindFirst etc
  724. Revision 1.19 2003/10/17 22:13:30 olle
  725. * changed i386 to cpui386
  726. Revision 1.18 2003/09/27 12:51:33 peter
  727. * fpISxxx macros renamed to C compliant fpS_ISxxx
  728. Revision 1.17 2003/09/17 17:30:46 marco
  729. * Introduction of unixutil
  730. Revision 1.16 2003/09/14 20:15:01 marco
  731. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  732. Revision 1.15 2003/05/16 20:56:06 florian
  733. no message
  734. Revision 1.14 2003/05/14 13:51:03 florian
  735. * ifdef'd code which i386 specific
  736. Revision 1.13 2002/12/08 16:05:34 peter
  737. * small error code fixes so tdos2 passes
  738. Revision 1.12 2002/09/07 16:01:27 peter
  739. * old logs removed and tabs fixed
  740. }