dos.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  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 : LongInt; {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. threadvar
  181. {$else HASTHREADVAR}
  182. var
  183. {$endif HASTHREADVAR}
  184. LastDosExitCode: word;
  185. Procedure Exec (Const Path: PathStr; Const ComLine: ComStr);
  186. var
  187. pid : longint;
  188. // The Error-Checking in the previous Version failed, since halt($7F) gives an WaitPid-status of $7F00
  189. Begin
  190. LastDosExitCode:=0;
  191. pid:=fpFork;
  192. if pid=0 then
  193. begin
  194. {The child does the actual exec, and then exits}
  195. if ComLine='' then
  196. Execl(Path)
  197. else
  198. Execl(Path+' '+ComLine);
  199. {If the execve fails, we return an exitvalue of 127, to let it be known}
  200. fpExit(127);
  201. end
  202. else
  203. if pid=-1 then {Fork failed}
  204. begin
  205. DosError:=8;
  206. exit
  207. end;
  208. {We're in the parent, let's wait.}
  209. LastDosExitCode:=WaitProcess(pid); // WaitPid and result-convert
  210. if (LastDosExitCode>=0) and (LastDosExitCode<>127) then
  211. DosError:=0
  212. else
  213. DosError:=8; // perhaps one time give an better error
  214. End;
  215. Function DosExitCode: Word;
  216. Begin
  217. DosExitCode:=LastDosExitCode;
  218. End;
  219. {******************************************************************************
  220. --- Disk ---
  221. ******************************************************************************}
  222. {
  223. The Diskfree and Disksize functions need a file on the specified drive, since this
  224. is required for the statfs system call.
  225. These filenames are set in drivestr[0..26], and have been preset to :
  226. 0 - '.' (default drive - hence current dir is ok.)
  227. 1 - '/fd0/.' (floppy drive 1 - should be adapted to local system )
  228. 2 - '/fd1/.' (floppy drive 2 - should be adapted to local system )
  229. 3 - '/' (C: equivalent of dos is the root partition)
  230. 4..26 (can be set by you're own applications)
  231. ! Use AddDisk() to Add new drives !
  232. They both return -1 when a failure occurs.
  233. }
  234. Const
  235. FixDriveStr : array[0..3] of pchar=(
  236. '.',
  237. '/fd0/.',
  238. '/fd1/.',
  239. '/.'
  240. );
  241. const
  242. Drives : byte = 4;
  243. var
  244. DriveStr : array[4..26] of pchar;
  245. Procedure AddDisk(const path:string);
  246. begin
  247. if not (DriveStr[Drives]=nil) then
  248. FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
  249. GetMem(DriveStr[Drives],length(Path)+1);
  250. StrPCopy(DriveStr[Drives],path);
  251. inc(Drives);
  252. if Drives>26 then
  253. Drives:=4;
  254. end;
  255. Function DiskFree(Drive: Byte): int64;
  256. var
  257. fs : tstatfs;
  258. Begin
  259. if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (StatFS(StrPas(fixdrivestr[drive]),fs)<>-1)) or
  260. ((not (drivestr[Drive]=nil)) and (StatFS(StrPas(drivestr[drive]),fs)<>-1)) then
  261. Diskfree:=int64(fs.bavail)*int64(fs.bsize)
  262. else
  263. Diskfree:=-1;
  264. End;
  265. Function DiskSize(Drive: Byte): int64;
  266. var
  267. fs : tstatfs;
  268. Begin
  269. if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (StatFS(StrPas(fixdrivestr[drive]),fs)<>-1)) or
  270. ((not (drivestr[Drive]=nil)) and (StatFS(StrPas(drivestr[drive]),fs)<>-1)) then
  271. DiskSize:=int64(fs.blocks)*int64(fs.bsize)
  272. else
  273. DiskSize:=-1;
  274. End;
  275. {******************************************************************************
  276. --- Findfirst FindNext ---
  277. ******************************************************************************}
  278. Const
  279. RtlFindSize = 15;
  280. Type
  281. RtlFindRecType = Record
  282. SearchNum,
  283. DirPtr,
  284. LastUsed : LongInt;
  285. End;
  286. Var
  287. RtlFindRecs : Array[1..RtlFindSize] of RtlFindRecType;
  288. CurrSearchNum : LongInt;
  289. Procedure FindClose(Var f: SearchRec);
  290. {
  291. Closes dirptr if it is open
  292. }
  293. Var
  294. i : longint;
  295. Begin
  296. if f.SearchType=0 then
  297. begin
  298. i:=1;
  299. repeat
  300. if (RtlFindRecs[i].SearchNum=f.SearchNum) then
  301. break;
  302. inc(i);
  303. until (i>RtlFindSize);
  304. If i<=RtlFindSize Then
  305. Begin
  306. RtlFindRecs[i].SearchNum:=0;
  307. if f.dirptr<>0 then
  308. fpclosedir(pdir(f.dirptr)^);
  309. End;
  310. end;
  311. f.dirptr:=0;
  312. End;
  313. Function FindGetFileInfo(const s:string;var f:SearchRec):boolean;
  314. var
  315. DT : DateTime;
  316. Info : RtlInfoType;
  317. st : baseunix.stat;
  318. begin
  319. FindGetFileInfo:=false;
  320. if not fpstat(s,st)>=0 then
  321. exit;
  322. info.FSize:=st.st_Size;
  323. info.FMTime:=st.st_mtime;
  324. if (st.st_mode and STAT_IFMT)=STAT_IFDIR then
  325. info.fmode:=$10
  326. else
  327. info.fmode:=$0;
  328. if (st.st_mode and STAT_IWUSR)=0 then
  329. info.fmode:=info.fmode or 1;
  330. if s[f.NamePos+1]='.' then
  331. info.fmode:=info.fmode or $2;
  332. If ((Info.FMode and Not(f.searchattr))=0) Then
  333. Begin
  334. f.Name:=Copy(s,f.NamePos+1,255);
  335. f.Attr:=Info.FMode;
  336. f.Size:=Info.FSize;
  337. UnixDateToDT(Info.FMTime, DT);
  338. PackTime(DT,f.Time);
  339. FindGetFileInfo:=true;
  340. End;
  341. end;
  342. Function FindLastUsed: Longint;
  343. {
  344. Find unused or least recently used dirpointer slot in findrecs array
  345. }
  346. Var
  347. BestMatch,i : Longint;
  348. Found : Boolean;
  349. Begin
  350. BestMatch:=1;
  351. i:=1;
  352. Found:=False;
  353. While (i <= RtlFindSize) And (Not Found) Do
  354. Begin
  355. If (RtlFindRecs[i].SearchNum = 0) Then
  356. Begin
  357. BestMatch := i;
  358. Found := True;
  359. End
  360. Else
  361. Begin
  362. If RtlFindRecs[i].LastUsed > RtlFindRecs[BestMatch].LastUsed Then
  363. BestMatch := i;
  364. End;
  365. Inc(i);
  366. End;
  367. FindLastUsed := BestMatch;
  368. End;
  369. Procedure FindNext(Var f: SearchRec);
  370. {
  371. re-opens dir if not already in array and calls FindWorkProc
  372. }
  373. Var
  374. DirName : Array[0..256] of Char;
  375. i,
  376. ArrayPos : Longint;
  377. FName,
  378. SName : string;
  379. Found,
  380. Finished : boolean;
  381. p : PDirEnt;
  382. Begin
  383. If f.SearchType=0 Then
  384. Begin
  385. ArrayPos:=0;
  386. For i:=1 to RtlFindSize Do
  387. Begin
  388. If RtlFindRecs[i].SearchNum = f.SearchNum Then
  389. ArrayPos:=i;
  390. Inc(RtlFindRecs[i].LastUsed);
  391. End;
  392. If ArrayPos=0 Then
  393. Begin
  394. If f.NamePos = 0 Then
  395. Begin
  396. DirName[0] := '.';
  397. DirName[1] := '/';
  398. DirName[2] := #0;
  399. End
  400. Else
  401. Begin
  402. Move(f.SearchSpec[1], DirName[0], f.NamePos);
  403. DirName[f.NamePos] := #0;
  404. End;
  405. f.DirPtr := longint(fpopendir(@(DirName)));
  406. If f.DirPtr <> 0 Then
  407. begin
  408. ArrayPos:=FindLastUsed;
  409. If RtlFindRecs[ArrayPos].SearchNum > 0 Then
  410. FpCloseDir((pdir(rtlfindrecs[arraypos].dirptr)^));
  411. RtlFindRecs[ArrayPos].SearchNum := f.SearchNum;
  412. RtlFindRecs[ArrayPos].DirPtr := f.DirPtr;
  413. if f.searchpos>0 then
  414. seekdir(pdir(f.dirptr), f.searchpos);
  415. end;
  416. End;
  417. if ArrayPos>0 then
  418. RtlFindRecs[ArrayPos].LastUsed:=0;
  419. end;
  420. {Main loop}
  421. SName:=Copy(f.SearchSpec,f.NamePos+1,255);
  422. Found:=False;
  423. Finished:=(f.dirptr=0);
  424. While Not Finished Do
  425. Begin
  426. p:=fpreaddir(pdir(f.dirptr)^);
  427. if p=nil then
  428. FName:=''
  429. else
  430. FName:=Strpas(@p^.d_name);
  431. If FName='' Then
  432. Finished:=True
  433. Else
  434. Begin
  435. If FNMatch(SName,FName) Then
  436. Begin
  437. Found:=FindGetFileInfo(Copy(f.SearchSpec,1,f.NamePos)+FName,f);
  438. if Found then
  439. Finished:=true;
  440. End;
  441. End;
  442. End;
  443. {Shutdown}
  444. If Found Then
  445. Begin
  446. f.searchpos:=telldir(pdir(f.dirptr));
  447. DosError:=0;
  448. End
  449. Else
  450. Begin
  451. FindClose(f);
  452. DosError:=18;
  453. End;
  454. End;
  455. Procedure FindFirst(Const Path: PathStr; Attr: Word; Var f: SearchRec);
  456. {
  457. opens dir and calls FindWorkProc
  458. }
  459. Begin
  460. if Path='' then
  461. begin
  462. DosError:=3;
  463. exit;
  464. end;
  465. {Create Info}
  466. f.SearchSpec := Path;
  467. {We always also search for readonly and archive, regardless of Attr:}
  468. f.SearchAttr := Attr or archive or readonly;
  469. f.SearchPos := 0;
  470. f.NamePos := Length(f.SearchSpec);
  471. while (f.NamePos>0) and (f.SearchSpec[f.NamePos]<>'/') do
  472. dec(f.NamePos);
  473. {Wildcards?}
  474. if (Pos('?',Path)=0) and (Pos('*',Path)=0) then
  475. begin
  476. if FindGetFileInfo(Path,f) then
  477. DosError:=0
  478. else
  479. begin
  480. { According to tdos2 test it should return 18
  481. if ErrNo=Sys_ENOENT then
  482. DosError:=3
  483. else }
  484. DosError:=18;
  485. end;
  486. f.DirPtr:=0;
  487. f.SearchType:=1;
  488. f.searchnum:=-1;
  489. end
  490. else
  491. {Find Entry}
  492. begin
  493. Inc(CurrSearchNum);
  494. f.SearchNum:=CurrSearchNum;
  495. f.SearchType:=0;
  496. FindNext(f);
  497. end;
  498. End;
  499. {******************************************************************************
  500. --- File ---
  501. ******************************************************************************}
  502. Procedure FSplit(Path: PathStr; Var Dir: DirStr; Var Name: NameStr;Var Ext: ExtStr);
  503. Begin
  504. UnixUtil.FSplit(Path,Dir,Name,Ext);
  505. End;
  506. Function FExpand(Const Path: PathStr): PathStr;
  507. Begin
  508. FExpand:=Unix.FExpand(Path);
  509. End;
  510. Function FSearch(path : pathstr;dirlist : string) : pathstr;
  511. Var
  512. info : BaseUnix.stat;
  513. Begin
  514. if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) then
  515. FSearch:=path
  516. else
  517. FSearch:=Unix.FSearch(path,dirlist);
  518. End;
  519. Procedure GetFAttr(var f; var attr : word);
  520. Var
  521. info : baseunix.stat;
  522. LinAttr : longint;
  523. Begin
  524. DosError:=0;
  525. if FPStat(strpas(@textrec(f).name),info)<0 then
  526. begin
  527. Attr:=0;
  528. DosError:=3;
  529. exit;
  530. end
  531. else
  532. LinAttr:=Info.st_Mode;
  533. if fpS_ISDIR(LinAttr) then
  534. Attr:=$10
  535. else
  536. Attr:=$0;
  537. if fpAccess(strpas(@textrec(f).name),W_OK)<0 then
  538. Attr:=Attr or $1;
  539. if filerec(f).name[0]='.' then
  540. Attr:=Attr or $2;
  541. end;
  542. Procedure getftime (var f; var time : longint);
  543. Var
  544. Info: baseunix.stat;
  545. DT: DateTime;
  546. Begin
  547. doserror:=0;
  548. if fpfstat(filerec(f).handle,info)<0 then
  549. begin
  550. Time:=0;
  551. doserror:=6;
  552. exit
  553. end
  554. else
  555. UnixDateToDT(Info.st_mTime,DT);
  556. PackTime(DT,Time);
  557. End;
  558. Procedure setftime(var f; time : longint);
  559. Var
  560. utim: utimbuf;
  561. DT: DateTime;
  562. path: pathstr;
  563. index: Integer;
  564. Begin
  565. doserror:=0;
  566. with utim do
  567. begin
  568. actime:=getepochtime;
  569. UnPackTime(Time,DT);
  570. modtime:=DTToUnixDate(DT);
  571. end;
  572. path := strpas(@filerec(f).name);
  573. if fputime(path,@utim)<0 then
  574. begin
  575. Time:=0;
  576. doserror:=3;
  577. end;
  578. End;
  579. {******************************************************************************
  580. --- Environment ---
  581. ******************************************************************************}
  582. Function EnvCount: Longint;
  583. var
  584. envcnt : longint;
  585. p : ppchar;
  586. Begin
  587. envcnt:=0;
  588. p:=envp; {defined in syslinux}
  589. while (p^<>nil) do
  590. begin
  591. inc(envcnt);
  592. inc(p);
  593. end;
  594. EnvCount := envcnt
  595. End;
  596. Function EnvStr (Index: longint): String;
  597. Var
  598. i : longint;
  599. p : ppchar;
  600. Begin
  601. p:=envp; {defined in syslinux}
  602. i:=1;
  603. while (i<Index) and (p^<>nil) do
  604. begin
  605. inc(i);
  606. inc(p);
  607. end;
  608. if p=nil then
  609. envstr:=''
  610. else
  611. envstr:=strpas(p^)
  612. End;
  613. Function GetEnv(EnvVar: String): String;
  614. var
  615. p : pchar;
  616. Begin
  617. p:=BaseUnix.fpGetEnv(EnvVar);
  618. if p=nil then
  619. GetEnv:=''
  620. else
  621. GetEnv:=StrPas(p);
  622. End;
  623. {******************************************************************************
  624. --- Do Nothing Procedures/Functions ---
  625. ******************************************************************************}
  626. {$ifdef cpui386}
  627. Procedure Intr (intno: byte; var regs: registers);
  628. Begin
  629. {! No Unix equivalent !}
  630. End;
  631. Procedure msdos(var regs : registers);
  632. Begin
  633. {! No Unix equivalent !}
  634. End;
  635. {$endif cpui386}
  636. Procedure getintvec(intno : byte;var vector : pointer);
  637. Begin
  638. {! No Unix equivalent !}
  639. End;
  640. Procedure setintvec(intno : byte;vector : pointer);
  641. Begin
  642. {! No Unix equivalent !}
  643. End;
  644. Procedure SwapVectors;
  645. Begin
  646. {! No Unix equivalent !}
  647. End;
  648. Procedure keep(exitcode : word);
  649. Begin
  650. {! No Unix equivalent !}
  651. End;
  652. Procedure setfattr (var f;attr : word);
  653. Begin
  654. {! No Unix equivalent !}
  655. { Fail for setting VolumeId }
  656. if (attr and VolumeID)<>0 then
  657. doserror:=5;
  658. End;
  659. Procedure GetCBreak(Var BreakValue: Boolean);
  660. Begin
  661. {! No Unix equivalent !}
  662. breakvalue:=true
  663. End;
  664. Procedure SetCBreak(BreakValue: Boolean);
  665. Begin
  666. {! No Unix equivalent !}
  667. End;
  668. Procedure GetVerify(Var Verify: Boolean);
  669. Begin
  670. {! No Unix equivalent !}
  671. Verify:=true;
  672. End;
  673. Procedure SetVerify(Verify: Boolean);
  674. Begin
  675. {! No Unix equivalent !}
  676. End;
  677. function GetShortName(var p : String) : boolean;
  678. begin
  679. { short=long under *nix}
  680. GetShortName:=True;
  681. end;
  682. function GetLongName(var p : String) : boolean;
  683. begin
  684. { short=long under *nix}
  685. GetLongName:=True;
  686. end;
  687. {******************************************************************************
  688. --- Initialization ---
  689. ******************************************************************************}
  690. End.
  691. {
  692. $Log$
  693. Revision 1.26 2004-02-15 21:36:10 hajny
  694. * overloaded ExecuteProcess added, EnvStr param changed to longint
  695. Revision 1.25 2004/02/09 17:01:28 marco
  696. * fixes to get it working under FreeBSD, and probably Linux too
  697. Revision 1.24 2004/02/09 12:03:16 michael
  698. + Switched to single interface in dosh.inc
  699. Revision 1.23 2004/01/31 16:15:14 florian
  700. * packing of searchrec for arm fixed
  701. Revision 1.22 2003/12/29 21:15:04 jonas
  702. * fixed setftime (sorry Marco :)
  703. Revision 1.21 2003/12/03 20:17:03 olle
  704. * files are not pretended to have attr ARCHIVED anymore
  705. + FindFirst etc now also filters on attr HIDDEN
  706. * files with attr READONLY and ARCHIVE are always returned by FindFirst etc
  707. Revision 1.19 2003/10/17 22:13:30 olle
  708. * changed i386 to cpui386
  709. Revision 1.18 2003/09/27 12:51:33 peter
  710. * fpISxxx macros renamed to C compliant fpS_ISxxx
  711. Revision 1.17 2003/09/17 17:30:46 marco
  712. * Introduction of unixutil
  713. Revision 1.16 2003/09/14 20:15:01 marco
  714. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  715. Revision 1.15 2003/05/16 20:56:06 florian
  716. no message
  717. Revision 1.14 2003/05/14 13:51:03 florian
  718. * ifdef'd code which i386 specific
  719. Revision 1.13 2002/12/08 16:05:34 peter
  720. * small error code fixes so tdos2 passes
  721. Revision 1.12 2002/09/07 16:01:27 peter
  722. * old logs removed and tabs fixed
  723. }