Added Xstat.c
This commit is contained in:
		
							parent
							
								
									6e5f3632c6
								
							
						
					
					
						commit
						72ab7b68b8
					
				
					 4 changed files with 50 additions and 6 deletions
				
			
		| 
						 | 
					@ -40,6 +40,7 @@ ptrace.s
 | 
				
			||||||
read.s
 | 
					read.s
 | 
				
			||||||
setgid.s
 | 
					setgid.s
 | 
				
			||||||
setuid.s
 | 
					setuid.s
 | 
				
			||||||
 | 
					Xstat.c
 | 
				
			||||||
stat.s
 | 
					stat.s
 | 
				
			||||||
stime.s
 | 
					stime.s
 | 
				
			||||||
sync.s
 | 
					sync.s
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										43
									
								
								mach/m68020/libsys/Xstat.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								mach/m68020/libsys/Xstat.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,43 @@
 | 
				
			||||||
 | 
					#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
 | 
				
			||||||
 | 
					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++;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
.define _fstat
 | 
					.define __fstat
 | 
				
			||||||
.extern _fstat
 | 
					.extern __fstat
 | 
				
			||||||
.sect .text
 | 
					.sect .text
 | 
				
			||||||
.sect .rom
 | 
					.sect .rom
 | 
				
			||||||
.sect .data
 | 
					.sect .data
 | 
				
			||||||
.sect .bss
 | 
					.sect .bss
 | 
				
			||||||
.sect .text
 | 
					.sect .text
 | 
				
			||||||
_fstat:		move.l	#0x1C,d0
 | 
					__fstat:	move.l	#0x1C,d0
 | 
				
			||||||
		jmp (callc)
 | 
							jmp (callc)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
.define _stat
 | 
					.define __stat
 | 
				
			||||||
.extern _stat
 | 
					.extern __stat
 | 
				
			||||||
.sect .text
 | 
					.sect .text
 | 
				
			||||||
.sect .rom
 | 
					.sect .rom
 | 
				
			||||||
.sect .data
 | 
					.sect .data
 | 
				
			||||||
.sect .bss
 | 
					.sect .bss
 | 
				
			||||||
.sect .text
 | 
					.sect .text
 | 
				
			||||||
_stat:		move.l #0x12,d0
 | 
					__stat:		move.l #0x12,d0
 | 
				
			||||||
		jmp (callc)
 | 
							jmp (callc)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue