From 9ae4e7924ad5ef734aab41e13b56714f72806797 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 3 Nov 1987 14:50:32 +0000 Subject: [PATCH] Added Xstat.c, to convert between different alignments --- mach/sun3/libsys/LIST | 1 + mach/sun3/libsys/Xstat.c | 58 ++++++++++++++++++++++++++++++++++++++++ mach/sun3/libsys/fstat.s | 4 +-- mach/sun3/libsys/lstat.s | 4 +-- mach/sun3/libsys/stat.s | 4 +-- 5 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 mach/sun3/libsys/Xstat.c diff --git a/mach/sun3/libsys/LIST b/mach/sun3/libsys/LIST index cffcb20de..760ef4e68 100644 --- a/mach/sun3/libsys/LIST +++ b/mach/sun3/libsys/LIST @@ -28,6 +28,7 @@ fchown.s fcntl.s flock.s fork.s +Xstat.c fstat.s fstatfs.s fsync.s diff --git a/mach/sun3/libsys/Xstat.c b/mach/sun3/libsys/Xstat.c new file mode 100644 index 000000000..d48475836 --- /dev/null +++ b/mach/sun3/libsys/Xstat.c @@ -0,0 +1,58 @@ +#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 +lstat(path, buf) + char *path; + struct stat *buf; +{ + char Xbuf[100]; + int retval; + + retval = _lstat(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; + *t++ = *s++; *t++ = *s++; + *t++ = 0; *t++ = 0; + for (i = 14; i; i--) *t++ = *s++; + *t++ = 0; *t++ = 0; + for (i = 44; i; i--) *t++ = *s++; +} diff --git a/mach/sun3/libsys/fstat.s b/mach/sun3/libsys/fstat.s index c3df3de7f..824df98bc 100644 --- a/mach/sun3/libsys/fstat.s +++ b/mach/sun3/libsys/fstat.s @@ -1,4 +1,4 @@ #include "syscall.h" .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text -.define _fstat -_fstat: SYSTEM(SYS_fstat) +.define __fstat +__fstat: SYSTEM(SYS_fstat) diff --git a/mach/sun3/libsys/lstat.s b/mach/sun3/libsys/lstat.s index b6e4ffe9f..ccf8a699f 100644 --- a/mach/sun3/libsys/lstat.s +++ b/mach/sun3/libsys/lstat.s @@ -1,4 +1,4 @@ #include "syscall.h" .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text -.define _lstat -_lstat: SYSTEM(SYS_lstat) +.define __lstat +__lstat: SYSTEM(SYS_lstat) diff --git a/mach/sun3/libsys/stat.s b/mach/sun3/libsys/stat.s index 37067e6a9..b953f554c 100644 --- a/mach/sun3/libsys/stat.s +++ b/mach/sun3/libsys/stat.s @@ -1,4 +1,4 @@ #include "syscall.h" .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text -.define _stat -_stat: SYSTEM(SYS_stat) +.define __stat +__stat: SYSTEM(SYS_stat) -- 2.34.1