From 72ab7b68b820a886e5c9bf3d1b291ab6954e1ed1 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 3 Nov 1987 14:43:40 +0000 Subject: [PATCH] Added Xstat.c --- mach/m68020/libsys/LIST | 1 + mach/m68020/libsys/Xstat.c | 43 ++++++++++++++++++++++++++++++++++++++ mach/m68020/libsys/fstat.s | 6 +++--- mach/m68020/libsys/stat.s | 6 +++--- 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 mach/m68020/libsys/Xstat.c diff --git a/mach/m68020/libsys/LIST b/mach/m68020/libsys/LIST index 9b9c71d3f..a1e04e318 100644 --- a/mach/m68020/libsys/LIST +++ b/mach/m68020/libsys/LIST @@ -40,6 +40,7 @@ ptrace.s read.s setgid.s setuid.s +Xstat.c stat.s stime.s sync.s diff --git a/mach/m68020/libsys/Xstat.c b/mach/m68020/libsys/Xstat.c new file mode 100644 index 000000000..b18276f4e --- /dev/null +++ b/mach/m68020/libsys/Xstat.c @@ -0,0 +1,43 @@ +#include +#include + +static Xcvt(); + +int +stat(path, buf) + char *path; + struct stat *buf; +{ + char Xbuf[100]; + int retval; + + retval = _stat(path, Xbuf); + Xcvt(Xbuf, (char *)buf); + return retval; +} + +int +fstat(fd, buf) + int fd; + struct stat *buf; +{ + char Xbuf[100]; + int retval; + + retval = _fstat(fd, Xbuf); + Xcvt(Xbuf, (char *)buf); + return retval; +} + +static +Xcvt(buf, statbuf) + char *buf, *statbuf; +{ + register char *s, *t; + register int i; + + s = buf; t = statbuf; + for (i = 14; i; i--) *t++ = *s++; + *t++ = 0; *t++ = 0; + for (i = 16; i; i--) *t++ = *s++; +} diff --git a/mach/m68020/libsys/fstat.s b/mach/m68020/libsys/fstat.s index a9c091a9e..13ca1aedd 100644 --- a/mach/m68020/libsys/fstat.s +++ b/mach/m68020/libsys/fstat.s @@ -1,9 +1,9 @@ -.define _fstat -.extern _fstat +.define __fstat +.extern __fstat .sect .text .sect .rom .sect .data .sect .bss .sect .text -_fstat: move.l #0x1C,d0 +__fstat: move.l #0x1C,d0 jmp (callc) diff --git a/mach/m68020/libsys/stat.s b/mach/m68020/libsys/stat.s index 73dd9490f..cab8bb68d 100644 --- a/mach/m68020/libsys/stat.s +++ b/mach/m68020/libsys/stat.s @@ -1,9 +1,9 @@ -.define _stat -.extern _stat +.define __stat +.extern __stat .sect .text .sect .rom .sect .data .sect .bss .sect .text -_stat: move.l #0x12,d0 +__stat: move.l #0x12,d0 jmp (callc) -- 2.34.1