X-Git-Url: https://deadsoftware.ru/gitweb?p=cpc.git;a=blobdiff_plain;f=src%2Fposix%2Fgeneric%2FHost%2FMod%2FFiles.cp;h=76c7a5b8f8b3e096ebedf2748683ef6a4a4b9cbb;hp=c7026a2b80c675e5f91bf7b457f1d94b1cad450d;hb=2f6052eb7f36254f3f459addb169dd7c07786cf7;hpb=92aff0fa77569efb2d8cd1b3703370cb61137173 diff --git a/src/posix/generic/Host/Mod/Files.cp b/src/posix/generic/Host/Mod/Files.cp index c7026a2..76c7a5b 100644 --- a/src/posix/generic/Host/Mod/Files.cp +++ b/src/posix/generic/Host/Mod/Files.cp @@ -6,6 +6,7 @@ MODULE HostFiles; macro := PosixCmacro, libgen := PosixClibgen, time := PosixCtime; (* !!! add buffer cache *) + (* !!! HostFiles64 must be base for HostFiles *) CONST closed = 0; new = 1; temp = 2; shared = 3; exclusive = 4; @@ -22,7 +23,7 @@ MODULE HostFiles; File = POINTER TO RECORD (Files.File) state: INTEGER; - len: INTEGER; + len: INTEGER; (* !!! must be sysstat.off_t *) fd: unistd.int; ino: sysstat.ino_t; pathname: FullName @@ -339,7 +340,7 @@ MODULE HostFiles; VAR i: INTEGER; sep: BOOLEAN; err: unistd.int; s: sysstat.struct_stat; mode: sysstat.mode_t; BEGIN i := 0; err := 0; - mode := ORD(BITS(511(*a=rwx*)) - BITS(sysstat.umask(0))); + mode := S.VAL((*!!!*)sysstat.mode_t, ORD(BITS(511(*a=rwx*)) - BITS(sysstat.umask(0)))); WHILE (err = 0) & (path[i] # 0X) DO WHILE (path[i] # "/") & (path[i] # 0X) DO INC(i) END; sep := path[i] = "/"; @@ -428,7 +429,7 @@ MODULE HostFiles; IF IsRegFile(s) THEN if := GetFileByInode(s.st_ino); IF (if = NIL) OR isShared & (if.state = shared) THEN - mode := ORD(BITS(rwrwrw) - BITS(sysstat.umask(0))); + mode := S.VAL((*!!!*)sysstat.mode_t, ORD(BITS(rwrwrw) - BITS(sysstat.umask(0)))); IF isShared THEN flags := fcntl.O_RDONLY ELSE flags := fcntl.O_RDWR END; @@ -445,7 +446,7 @@ MODULE HostFiles; IF res # -1 THEN NEW(f); HostLang.HostToString(pathname, f.pathname, HostLang.pep383, err); IF err = 0 THEN - f.fd := fd; f.len := s.st_size; f.ino := s.st_ino; + f.fd := fd; f.len := S.VAL((*!!!*)INTEGER, s.st_size); f.ino := s.st_ino; IF isShared THEN f.state := shared ELSE f.state := exclusive END; @@ -638,7 +639,7 @@ MODULE HostFiles; END; t.name := name$; t.type := ""; (* ??? *) - t.length := s.st_size; + t.length := S.VAL((*!!!*)INTEGER, s.st_size); tm := time.localtime(s.st_mtim.tv_sec); IF tm # NIL THEN t.modified.year := tm.tm_year + 1900;