bsdsysc.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Marco van de Voort
  4. The base *BSD syscalls required to implement the system unit. These
  5. are aliased for use in other units (to avoid poluting the system units
  6. interface)
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. ****************************************************************************
  13. }
  14. {$ifdef uselibc}
  15. {$Linklib c}
  16. // Out of date atm.
  17. { var
  18. Errno : cint; external name 'errno';}
  19. function sys_time(tloc:ptime_t): time_t; cdecl; external name 'time';
  20. function sys_open(const path: pchar; flags : cint; mode: mode_t):cint; cdecl; external name 'open';
  21. function sys_close(fd : cint): cint; cdecl; external name 'close';
  22. function sys_lseek(fd : cint; offset : off_t; whence : cint): off_t; cdecl; external name 'lseek';
  23. function sys_read(fd: cint; buf: pchar; nbytes : size_t): ssize_t; cdecl; external name 'read';
  24. function sys_write(fd: cint;const buf:pchar; nbytes : size_t): ssize_t; cdecl; external name 'write';
  25. function sys_unlink(const path: pchar): cint; cdecl; external name 'unlink';
  26. function sys_rename(const old : pchar; const newpath: pchar): cint; cdecl;external name 'rename';
  27. function sys_stat(const path: pchar; var buf : stat): cint; cdecl; external name 'stat';
  28. function sys_chdir(const path : pchar): cint; cdecl; external name 'chdir';
  29. function sys_mkdir(const path : pchar; mode: mode_t):cint; cdecl; external name 'mkdir';
  30. function sys_rmdir(const path : pchar): cint; cdecl; external name 'rmdir';
  31. function sys_opendir(const dirname : pchar): pdir; cdecl; external name 'opendir';
  32. function sys_readdir(var dirp : dir) : pdirent;cdecl; external name 'readdir';
  33. function sys_closedir(var dirp : dir): cint; cdecl; external name 'closedir';
  34. procedure sys_exit(status : cint); cdecl; external name '_exit';
  35. function sys_sigaction(sig: cint; var act : sigactionrec; var oact : sigactionrec): cint; cdecl; external name 'sigaction';
  36. function sys_ftruncate(fd : cint; flength : off_t): cint; cdecl; external name 'ftruncate';
  37. function sys_rename(const old : pchar; const newpath: pchar): cint; cdecl;external name 'rename';
  38. function sys_fstat(fd : cint; var sb : stat): cint; cdecl; external name 'fstat';
  39. function sys_fork : pid_t; cdecl; external name 'fork';
  40. function sys_execve(const path : pchar; const argv : ppchar; const envp: ppchar): cint; cdecl; external name 'execve';
  41. function sys_waitpid(pid : pid_t; var stat_loc : cint; options: cint): pid_t; cdecl; external name 'waitpid';
  42. function sys_access(const pathname : pchar; amode : cint): cint; cdecl; external name 'access';
  43. function sys_uname(var name: utsname): cint; cdecl; external name 'uname';
  44. function sys_Dup(oldd:cint):cint; cdecl; external name 'dup';
  45. function sys_Dup2(oldd:cint;newd:cint):cint; cdecl; external name 'dup2';
  46. {$else}
  47. {*****************************************************************************
  48. --- Main:The System Call Self ---
  49. *****************************************************************************}
  50. { The system designed for Linux can't be used for *BSD so easily, since
  51. *BSD pushes arguments, instead of loading them to registers.}
  52. // Var ErrNo : Longint;
  53. {$I syscall.inc}
  54. {$I sysnr.inc}
  55. {$I bsdmacro.inc}
  56. {$I bsdtypes.inc}
  57. // Should be moved to a FreeBSD specific unit in the future.
  58. function sys_time( tloc:ptime_t): time_t; [public, alias : 'FPC_SYSC_TIME'];
  59. VAR tv : timeval;
  60. tz : timezone;
  61. retval : longint;
  62. begin
  63. Retval:=do_syscall(syscall_nr_gettimeofday,longint(@tv),longint(@tz));
  64. If retval=-1 then
  65. sys_time:=-1
  66. else
  67. Begin
  68. If Assigned(tloc) Then
  69. TLoc^:=tv.tv_sec;
  70. sys_time:=tv.tv_sec;
  71. End;
  72. End;
  73. {*****************************************************************************
  74. --- File:File handling related calls ---
  75. *****************************************************************************}
  76. function sys_open(const path: pchar; flags : cint; mode: mode_t):cint; [public, alias : 'FPC_SYSC_OPEN'];
  77. Begin
  78. sys_open:=do_syscall(syscall_nr_open,longint(path),longint(flags),longint(mode));
  79. End;
  80. function sys_close(fd : cint): cint;
  81. begin
  82. sys_close:=do_syscall(syscall_nr_close,fd);
  83. end;
  84. function sys_lseek(fd : cint; offset : off_t; whence : cint): off_t; [public, alias : 'FPC_SYSC_LSEEK'];
  85. {
  86. this one is special for the return value being 64-bit..
  87. hi/lo offset not yet tested.
  88. NetBSD: ok, but implicit return value in edx:eax
  89. FreeBSD: same implementation as NetBSD.
  90. }
  91. begin
  92. sys_lseek:=do_syscall(syscall_nr___syscall,syscall_nr_lseek,0,longint(fd),0,lo(Offset),{0} hi(offset),Whence);
  93. end;
  94. function sys_read(fd: cint; buf: pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_READ'];
  95. begin
  96. sys_read:=do_syscall(syscall_nr_read,Fd,longint(buf),nbytes);
  97. end;
  98. function sys_write(fd: cint;const buf:pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_WRITE'];
  99. begin
  100. sys_write:=do_syscall(syscall_nr_write,Fd,longint(buf),nbytes);
  101. end;
  102. function sys_unlink(const path: pchar): cint; [public, alias : 'FPC_SYSC_UNLINK'];
  103. begin
  104. sys_unlink:=do_syscall(syscall_nr_unlink,longint(path));
  105. end;
  106. function sys_rename(const old : pchar; const newpath: pchar): cint; [public, alias : 'FPC_SYSC_RENAME'];
  107. begin
  108. sys_rename:=do_syscall(syscall_nr_rename,longint(old),longint(newpath));
  109. end;
  110. function sys_stat(const path: pchar; var buf : stat):cint; [public, alias : 'FPC_SYSC_STAT'];
  111. begin
  112. sys_stat:=do_syscall(syscall_nr_stat,longint(path),longint(@buf));
  113. end;
  114. {*****************************************************************************
  115. --- Directory:Directory related calls ---
  116. *****************************************************************************}
  117. function sys_chdir(const path : pchar): cint; [public, alias : 'FPC_SYSC_CHDIR'];
  118. begin
  119. sys_chdir:=do_syscall(syscall_nr_chdir,longint(path));
  120. end;
  121. function sys_mkdir(const path : pchar; mode: mode_t):cint; [public, alias : 'FPC_SYSC_MKDIR'];
  122. begin {Mode is 16-bit on F-BSD}
  123. sys_mkdir:=do_syscall(syscall_nr_mkdir,longint(path),mode);
  124. end;
  125. function sys_rmdir(const path : pchar): cint; [public, alias : 'FPC_SYSC_RMDIR'];
  126. begin
  127. sys_rmdir:=do_syscall(syscall_nr_rmdir,longint(path));
  128. end;
  129. {$ifndef NewReaddir}
  130. const DIRBLKSIZ=1024;
  131. function sys_opendir(const dirname : pchar): pdir; [public, alias : 'FPC_SYSC_OPENDIR'];
  132. var
  133. fd:longint;
  134. st:stat;
  135. ptr:pdir;
  136. begin
  137. sys_opendir:=nil;
  138. if sys_stat(dirname,st)<0 then
  139. exit;
  140. { Is it a dir ? }
  141. if not((st.st_mode and $f000)=$4000)then
  142. begin
  143. errno:=sys_enotdir;
  144. exit
  145. end;
  146. { Open it}
  147. fd:=sys_open(dirname,O_RDONLY,438);
  148. if fd<0 then
  149. Begin
  150. Errno:=-1;
  151. exit;
  152. End;
  153. new(ptr);
  154. if ptr=nil then
  155. Begin
  156. Errno:=1;
  157. exit;
  158. End;
  159. Getmem(ptr^.dd_buf,2*DIRBLKSIZ);
  160. if ptr^.dd_buf=nil then
  161. exit;
  162. ptr^.dd_fd:=fd;
  163. ptr^.dd_loc:=-1;
  164. ptr^.dd_rewind:=longint(ptr^.dd_buf);
  165. ptr^.dd_size:=0;
  166. // ptr^.dd_max:=sizeof(ptr^.dd_buf^);
  167. sys_opendir:=ptr;
  168. end;
  169. function sys_closedir(dirp : pdir): cint; [public, alias : 'FPC_SYSC_CLOSEDIR'];
  170. begin
  171. sys_closedir:=sys_close(dirp^.dd_fd);
  172. Freemem(dirp^.dd_buf);
  173. dispose(dirp);
  174. end;
  175. function sys_readdir(dirp : pdir) : pdirent; [public, alias : 'FPC_SYSC_READDIR'];
  176. {Different from Linux, Readdir on BSD is based on Getdents, due to the
  177. missing of the readdir syscall.
  178. Getdents requires the buffer to be larger than the blocksize.
  179. This usually the sectorsize =512 bytes, but maybe tapedrives and harddisks
  180. with blockmode have this higher?}
  181. function readbuffer:longint;
  182. var retval :longint;
  183. begin
  184. Retval:=do_syscall(syscall_nr_getdents,longint(dirp^.dd_fd),longint(@dirp^.dd_buf^),DIRBLKSIZ {sizeof(getdentsbuffer)});
  185. dirp^.dd_rewind:=longint(dirp^.dd_buf);
  186. if retval=0 then
  187. begin
  188. dirp^.dd_rewind:=0;
  189. dirp^.dd_loc:=0;
  190. end
  191. else
  192. dirP^.dd_loc:=retval;
  193. readbuffer:=retval;
  194. end;
  195. var
  196. FinalEntry : pdirent;
  197. novalid : boolean;
  198. Reclen : Longint;
  199. CurEntry : PDirent;
  200. begin
  201. if (dirp^.dd_buf=nil) or (dirp^.dd_loc=0) THEN
  202. exit(nil);
  203. if (dirp^.dd_loc=-1) OR {First readdir on this pdir. Initial fill of buffer}
  204. (dirp^.dd_rewind>=(longint(dirp^.dd_buf)+dirblksiz)) then {no more entries left?}
  205. Begin
  206. if readbuffer=0 then {succesful read?}
  207. Exit(NIL); {No more data}
  208. End;
  209. FinalEntry:=NIL;
  210. CurEntry:=nil;
  211. repeat
  212. novalid:=false;
  213. CurEntry:=pdirent(dirp^.dd_rewind);
  214. RecLen:=CurEntry^.d_reclen;
  215. if RecLen<>0 Then
  216. begin {valid direntry?}
  217. if CurEntry^.d_fileno<>0 then
  218. FinalEntry:=CurEntry;
  219. inc(dirp^.dd_rewind,Reclen);
  220. end
  221. else
  222. begin {block entirely searched or reclen=0}
  223. Novalid:=True;
  224. if dirp^.dd_loc<>0 THEN {blocks left?}
  225. if readbuffer()<>0 then {succesful read?}
  226. novalid:=false;
  227. end;
  228. until (FinalEntry<>nil) or novalid;
  229. If novalid then
  230. FinalEntry:=nil;
  231. Sys_ReadDir:=FinalEntry;
  232. end;
  233. {$endif}
  234. {*****************************************************************************
  235. --- Process:Process & program handling - related calls ---
  236. *****************************************************************************}
  237. procedure sys_exit(status : cint); [public, alias : 'FPC_SYSC_EXIT'];
  238. begin
  239. do_syscall(syscall_nr_exit,status);
  240. end;
  241. {
  242. Change action of process upon receipt of a signal.
  243. Signum specifies the signal (all except SigKill and SigStop).
  244. If Act is non-nil, it is used to specify the new action.
  245. If OldAct is non-nil the previous action is saved there.
  246. }
  247. function sys_sigaction(sig: cint; var act : sigactionrec; var oact : sigactionrec): cint; [public, alias : 'FPC_SYSC_SIGACTION'];
  248. {
  249. Change action of process upon receipt of a signal.
  250. Signum specifies the signal (all except SigKill and SigStop).
  251. If Act is non-nil, it is used to specify the new action.
  252. If OldAct is non-nil the previous action is saved there.
  253. }
  254. begin
  255. do_syscall(syscall_nr_sigaction,longint(sig),longint(@act),longint(@oact));
  256. end;
  257. (*=================== MOVED from sysunix.inc ========================*)
  258. function sys_ftruncate(fd : cint; flength : off_t): cint; [public, alias : 'FPC_SYSC_FTRUNCATE'];
  259. { See notes lseek. This one is completely similar.
  260. }
  261. begin
  262. sys_ftruncate:=Do_syscall(syscall_nr___syscall,syscall_nr_ftruncate,0,fd,0,lo(flength),hi(flength));
  263. end;
  264. function sys_fstat(fd : cint; var sb : stat): cint; [public, alias : 'FPC_SYSC_FSTAT'];
  265. begin
  266. Sys_FStat:=do_SysCall(syscall_nr_fstat,fd,longint(@sb));
  267. end;
  268. {$ifdef NewReaddir}
  269. {$I readdir.inc}
  270. {$endif}
  271. function sys_fork : pid_t; [public, alias : 'FPC_SYSC_FORK'];
  272. {
  273. This function issues the 'fork' System call. the program is duplicated in memory
  274. and Execution continues in parent and child process.
  275. In the parent process, fork returns the PID of the child. In the child process,
  276. zero is returned.
  277. A negative value indicates that an error has occurred, the error is returned in
  278. LinuxError.
  279. }
  280. Begin
  281. sys_fork:=Do_syscall(SysCall_nr_fork);
  282. End;
  283. {
  284. function sys_execve(const path : pathstr; const argv : ppchar; const envp: ppchar): cint;
  285. }
  286. {
  287. Replaces the current program by the program specified in path,
  288. arguments in args are passed to Execve.
  289. environment specified in ep is passed on.
  290. }
  291. {
  292. Begin
  293. path:=path+#0;
  294. do_syscall(syscall_nr_Execve,longint(@path[1]),longint(Argv),longint(envp));
  295. End;
  296. }
  297. {
  298. function sys_execve(const path : pchar; const argv : ppchar; const envp: ppchar): cint; [public, alias : 'FPC_SYSC_EXECVE'];
  299. }
  300. {
  301. Replaces the current program by the program specified in path,
  302. arguments in args are passed to Execve.
  303. environment specified in ep is passed on.
  304. }
  305. {
  306. Begin
  307. do_syscall(syscall_nr_Execve,longint(path),longint(Argv),longint(envp));
  308. End;
  309. }
  310. function sys_waitpid(pid : pid_t; var stat_loc : cint; options: cint): pid_t; [public, alias : 'FPC_SYSC_WAITPID'];
  311. {
  312. Waits until a child with PID Pid exits, or returns if it is exited already.
  313. Any resources used by the child are freed.
  314. The exit status is reported in the adress referred to by Status. It should
  315. be a longint.
  316. }
  317. begin // actually a wait4() call with 4th arg 0.
  318. sys_WaitPID:=do_syscall(syscall_nr_WaitPID,PID,longint(@Stat_loc),options,0);
  319. end;
  320. function sys_access(const pathname : pchar; amode : cint): cint; [public, alias : 'FPC_SYSC_ACCESS'];
  321. {
  322. Test users access rights on the specified file.
  323. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  324. R,W,X stand for read,write and Execute access, simultaneously.
  325. F_OK checks whether the test would be allowed on the file.
  326. i.e. It checks the search permissions in all directory components
  327. of the path.
  328. The test is done with the real user-ID, instead of the effective.
  329. If access is denied, or an error occurred, false is returned.
  330. If access is granted, true is returned.
  331. Errors other than no access,are reported in unixerror.
  332. }
  333. begin
  334. sys_Access:=do_syscall(syscall_nr_access,longint(pathname),amode);
  335. end;
  336. {
  337. function sys_access(const pathname : pathstr; amode : cint): cint;
  338. {
  339. Test users access rights on the specified file.
  340. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  341. R,W,X stand for read,write and Execute access, simultaneously.
  342. F_OK checks whether the test would be allowed on the file.
  343. i.e. It checks the search permissions in all directory components
  344. of the path.
  345. The test is done with the real user-ID, instead of the effective.
  346. If access is denied, or an error occurred, false is returned.
  347. If access is granted, true is returned.
  348. Errors other than no access,are reported in unixerror.
  349. }
  350. begin
  351. pathname:=pathname+#0;
  352. Access:=do_syscall(syscall_nr_access, longint(@pathname[1]),mode)=0;
  353. end;
  354. }
  355. Function sys_Dup(fildes:cint):cint; [public, alias : 'FPC_SYSC_DUP'];
  356. begin
  357. sys_dup:=Do_syscall(syscall_nr_dup,longint(fildes));
  358. end;
  359. Function sys_Dup2(fildes,fildes2:cint):cint; [public, alias : 'FPC_SYSC_DUP2'];
  360. begin
  361. sys_dup2:=do_syscall(syscall_nr_dup2,longint(fildes),longint(fildes2));
  362. end;
  363. CONST
  364. { Constansts for MMAP }
  365. MAP_PRIVATE =2;
  366. MAP_ANONYMOUS =$1000;
  367. Function Sys_mmap(adr,len,prot,flags,fdes,off:longint):longint; [public, alias : 'FPC_SYSC_MMAP'];
  368. begin
  369. Sys_mmap:=do_syscall(syscall_nr_mmap,Adr,Len,Prot,Flags,fdes,off,0);
  370. end;
  371. Function Sys_munmap(adr:longint;len:size_t):longint; [public, alias :'FPC_SYSC_MUNMAP'];
  372. begin
  373. Sys_munmap:=do_syscall(syscall_nr_munmap,longint(Adr),Len);
  374. end;
  375. Function sbrk(size : longint) : Longint;
  376. begin
  377. sbrk:=Sys_mmap(0,Size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0);
  378. if sbrk<>-1 then
  379. errno:=0;
  380. {! It must be -1, not 0 as before, see heap.inc. Should be in sysmmap?}
  381. end;
  382. {
  383. Interface to Unix ioctl call.
  384. Performs various operations on the filedescriptor Handle.
  385. Ndx describes the operation to perform.
  386. Data points to data needed for the Ndx function. The structure of this
  387. data is function-dependent.
  388. }
  389. Function Sys_IOCtl(Handle,Ndx: Longint;Data: Pointer):LongInt; [public, alias : 'FPC_SYSC_IOCTL'];
  390. // This was missing here, instead hardcoded in Do_IsDevice
  391. begin
  392. Sys_IOCtl:=do_SysCall(syscall_nr_ioctl,handle,Ndx,longint(data));
  393. end;
  394. CONST
  395. IOCtl_TCGETS=$5401;
  396. Function Do_IsDevice(Handle:Longint):boolean;
  397. {
  398. Interface to Unix ioctl call.
  399. Performs various operations on the filedescriptor Handle.
  400. Ndx describes the operation to perform.
  401. Data points to data needed for the Ndx function. The structure of this
  402. data is function-dependent.
  403. }
  404. var
  405. Data : array[0..255] of byte; {Large enough for termios info}
  406. begin
  407. Do_IsDevice:=(sys_ioctl(handle,IOCTL_TCGETS,@data)<>-1);
  408. end;
  409. Function sys_GetPid:LongInt; [public, alias : 'FPC_SYSC_GETPID'];
  410. {
  411. Get Process ID.
  412. }
  413. begin
  414. sys_GetPID:=do_syscall(syscall_nr_getpid);
  415. end;
  416. Function Sys_ReadLink(name,linkname:pchar;maxlen:longint):longint; [public, alias : 'FPC_SYSC_READLINK'];
  417. begin
  418. sys_readlink:=do_syscall(syscall_nr_readlink, longint(name),longint(linkname),maxlen);
  419. end;
  420. Function sys_NanoSleep(const req : timespec;var rem : timespec) : longint; [public, alias : 'FPC_SYSC_NANOSLEEP'];
  421. begin
  422. sys_NanoSleep:=Do_SysCall(syscall_nr_nanosleep,longint(@req),longint(@rem));
  423. end;
  424. function sys_getcwd(pt:pchar; _size:size_t):pchar;[public, alias :'FPC_SYSC_GETCWD'];
  425. const intpathmax = 1024-4; // didn't use POSIX data in libc
  426. // implementation.
  427. var ept,bpt : pchar;
  428. c : char;
  429. ret : cint;
  430. begin
  431. if pt=NIL Then
  432. begin
  433. // POSIX: undefined. (exit(nil) ?)
  434. // BSD : allocate mem for path.
  435. getmem(pt,intpathmax);
  436. if pt=nil Then
  437. exit(nil);
  438. ept:=pt+intpathmax;
  439. end
  440. else
  441. Begin
  442. if (_size=0) Then
  443. Begin
  444. seterrno(sys_EINVAL);
  445. exit(nil);
  446. End;
  447. if (_size=1) Then
  448. Begin
  449. seterrno(sys_ERANGE);
  450. exit(nil);
  451. End;
  452. ept:=pt+_size;
  453. end;
  454. ret := do_syscall(syscall_nr___getcwd,longint(pt),longint( ept - pt));
  455. If (ret = 0) Then
  456. If (pt[0] <> '/') Then
  457. Begin
  458. bpt := pt;
  459. ept := pt + strlen(pt) - 1;
  460. While (bpt < ept) Do
  461. Begin
  462. c := bpt^;
  463. bpt^:=ept^;
  464. inc(bpt);
  465. ept^:=c;
  466. dec(ept);
  467. End;
  468. End;
  469. sys_getcwd:=pt;
  470. end;
  471. {$endif}
  472. {
  473. $Log$
  474. Revision 1.9 2002-11-13 18:15:08 marco
  475. * sigset functions more flexible, small changes to sys_time
  476. Revision 1.8 2002/10/27 17:21:29 marco
  477. * Only "difficult" functions + execvp + termios + rewinddir left to do
  478. Revision 1.7 2002/10/27 11:58:29 marco
  479. * Modifications from Saturday.
  480. Revision 1.6 2002/10/26 18:27:51 marco
  481. * First series POSIX calls commits. Including getcwd.
  482. Revision 1.5 2002/10/18 12:19:58 marco
  483. * Fixes to get the generic *BSD RTL compiling again + fixes for thread
  484. support. Still problems left in fexpand. (inoutres?) Therefore fixed
  485. sysposix not yet commited
  486. Revision 1.4 2002/10/16 18:44:18 marco
  487. * Lseek and ftruncate 64-bit fix
  488. Revision 1.3 2002/09/07 16:01:17 peter
  489. * old logs removed and tabs fixed
  490. Revision 1.2 2002/08/21 07:03:16 marco
  491. * Fixes from Tuesday.
  492. Revision 1.1 2002/08/19 12:29:11 marco
  493. * First working POSIX *BSD system unit.
  494. Revision 1.2 2002/08/04 04:29:34 marco
  495. * More POSIX updates. Small changes to lseek and ftruncate in osposix.inc
  496. Initial versions of the type includefiles
  497. Revision 1.1 2002/08/03 19:34:19 marco
  498. * Initial *BSD versions. Seems that OpenBSD doesn't need much change,
  499. NetBSD may need some fixes to stat record and ftruncate and lseek.
  500. It is all close together, and it should be doable to have just one copy
  501. of these for *BSD.
  502. }