Added Xstat.c, to convert between different alignments
This commit is contained in:
parent
72ab7b68b8
commit
9ae4e7924a
|
@ -28,6 +28,7 @@ fchown.s
|
|||
fcntl.s
|
||||
flock.s
|
||||
fork.s
|
||||
Xstat.c
|
||||
fstat.s
|
||||
fstatfs.s
|
||||
fsync.s
|
||||
|
|
58
mach/sun3/libsys/Xstat.c
Normal file
58
mach/sun3/libsys/Xstat.c
Normal file
|
@ -0,0 +1,58 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
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++;
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue