dos.pp 19 KB

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