Browse Source

added new routines for ansi

eck 34 years ago
parent
commit
1dc6509af2

+ 24 - 0
mach/sun3/libsys/LIST

@@ -4,6 +4,7 @@ access.s
 acct.s
 adjtime.s
 alarm.c
+_alarm.c
 async_dem.s
 bind.s
 cerror.s
@@ -13,11 +14,14 @@ chown.s
 chroot.s
 cleanup.c
 close.s
+_close.s
 connect.s
 creat.s
 dup.s
 dup2.s
+_dup2.s
 execl.c
+_execl.c
 execle.c
 execv.c
 execve.s
@@ -28,11 +32,13 @@ fchown.s
 fcntl.s
 flock.s
 fork.s
+_fork.s
 Xstat.c
 fstat.s
 fstatfs.s
 fsync.s
 ftime.c
+_ftime.c
 ftruncate.s
 getdirent.s
 getdomnam.s
@@ -48,19 +54,26 @@ getpagesiz.s
 getpeernam.s
 getpgrp.s
 getpid.s
+_getpid.s
 getprio.s
 getrlimit.s
 getrusage.s
+_getrusage.s
 getsocknam.s
 getsockopt.s
 gettimday.s
+_gettimday.s
 getuid.s
 ioctl.s
+_ioctl.s
 kill.s
+_kill.s
 killpg.s
 link.s
+_link.s
 listen.s
 lseek.s
+_lseek.s
 lstat.s
 madvise.s
 mincore.s
@@ -75,12 +88,16 @@ munmap.s
 nfssvc.s
 nice.c
 open.s
+_open.s
 pause.c
+_pause.c
 pipe.s
+_pipe.s
 profil.s
 ptrace.s
 quotactl.s
 read.s
+_read.s
 readlink.s
 readv.s
 reboot.s
@@ -100,6 +117,7 @@ setdopt.s
 setgroups.s
 sethostnam.s
 setitimer.s
+_setitimer.s
 setpgrp.s
 setprio.s
 setregid.s
@@ -110,8 +128,10 @@ settimday.s
 shmsys.s
 shutdown.s
 sigblock.s
+_sigblock.s
 signal.c
 sigpause.s
+_sigpause.s
 sigsetmask.s
 sigstack.s
 sigtramp.s
@@ -130,6 +150,7 @@ times.c
 truncate.s
 umask.s
 unlink.s
+_unlink.s
 umount.s
 unmount.s
 ustat.s
@@ -137,11 +158,14 @@ utime.c
 utimes.s
 vhangup.s
 wait.s
+_wait.s
 write.s
+_write.s
 writev.s
 _exit.s
 stty.c
 gtty.c
+_gtty.c
 getegid.s
 geteuid.s
 getppid.s

+ 13 - 0
mach/sun3/libsys/_alarm.c

@@ -0,0 +1,13 @@
+unsigned
+_alarm(n)
+	unsigned n;
+{
+	struct { long l1,l2,l3,l4; } t1,t2;
+	t1.l1 = 0;
+	t1.l2 = 0;
+	t1.l4 = 0;
+	t1.l3 = n;
+	if (_setitimer(0,&t1,&t2) < 0) return -1;
+	if (t2.l4) t2.l3++;
+	return t2.l3;
+}

+ 4 - 0
mach/sun3/libsys/_close.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __close
+__close: SYSTEM(SYS_close)

+ 4 - 0
mach/sun3/libsys/_dup2.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __dup2
+__dup2: SYSTEM(SYS_dup2)

+ 8 - 0
mach/sun3/libsys/_execl.c

@@ -0,0 +1,8 @@
+_execl(name,args)
+	char *name;
+	int args;
+{
+	extern char **environ;
+
+	_execve(name,&args,environ);
+}

+ 14 - 0
mach/sun3/libsys/_fork.s

@@ -0,0 +1,14 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __fork
+__fork:
+	pea	(SYS_fork)
+	trap	#0
+	bcs	1f
+	tst.l	d1
+	beq	2f
+	clr.l	d0
+2:
+	rts
+1:
+	jmp	(cerror)

+ 15 - 0
mach/sun3/libsys/_ftime.c

@@ -0,0 +1,15 @@
+#include <sys/types.h>
+
+_ftime(p)
+	struct { time_t time; unsigned short millitm;
+		 short timezone; short dstflag; } *p;
+{
+	struct { long l1,l2; } t1,t2;
+
+	if (_gettimeofday(&t1,&t2) < 0) return -1;
+	p->time = t1.l1;
+	p->millitm = t1.l2/1000;
+	p->dstflag = t2.l2;
+	p->timezone = t2.l1;
+	return 0;
+}

+ 4 - 0
mach/sun3/libsys/_getpid.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __getpid
+__getpid: SYSTEM(SYS_getpid)

+ 4 - 0
mach/sun3/libsys/_getrusage.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __getrusage
+__getrusage: SYSTEM(SYS_getrusage)

+ 4 - 0
mach/sun3/libsys/_gettimday.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __gettimeofday
+__gettimeofday: SYSTEM(SYS_gettimeofday)

+ 8 - 0
mach/sun3/libsys/_gtty.c

@@ -0,0 +1,8 @@
+#include <sgtty.h>
+int
+_gtty(fildes,argp)
+	int fildes ;
+	struct sgttyb *argp ;
+{
+	return _ioctl(fildes,TIOCGETP,argp) ;
+}

+ 4 - 0
mach/sun3/libsys/_ioctl.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __ioctl
+__ioctl: SYSTEM(SYS_ioctl)

+ 4 - 0
mach/sun3/libsys/_kill.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __kill
+__kill: SYSTEM(SYS_kill)

+ 4 - 0
mach/sun3/libsys/_link.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __link
+__link: SYSTEM(SYS_link)

+ 4 - 0
mach/sun3/libsys/_lseek.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __lseek
+__lseek: SYSTEM(SYS_lseek)

+ 4 - 0
mach/sun3/libsys/_open.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __open
+__open: SYSTEM(SYS_open)

+ 3 - 0
mach/sun3/libsys/_pause.c

@@ -0,0 +1,3 @@
+_pause() {
+	_sigpause(_sigblock());
+}

+ 14 - 0
mach/sun3/libsys/_pipe.s

@@ -0,0 +1,14 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __pipe
+__pipe:
+	pea	(SYS_pipe)
+	trap	#0
+	bcs	1f
+	move.l	(4,sp),a0
+	move.l	d0,(a0)+
+	move.l	d1,(a0)
+	clr.l	d0
+	rts
+1:
+	jmp	(cerror)

+ 4 - 0
mach/sun3/libsys/_read.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __read
+__read: SYSTEM(SYS_read)

+ 4 - 0
mach/sun3/libsys/_setitimer.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __setitimer
+__setitimer: SYSTEM(SYS_setitimer)

+ 4 - 0
mach/sun3/libsys/_sigblock.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __sigblock
+__sigblock: SYSTEM(SYS_sigblock)

+ 4 - 0
mach/sun3/libsys/_sigpause.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __sigpause
+__sigpause: SYSTEM(SYS_sigpause)

+ 4 - 0
mach/sun3/libsys/_unlink.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __unlink
+__unlink: SYSTEM(SYS_unlink)

+ 15 - 0
mach/sun3/libsys/_wait.s

@@ -0,0 +1,15 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __wait
+__wait:	
+	pea	(SYS_wait)
+	trap	#0
+	bcs	1f
+	tst.l	(4,sp)
+	beq	2f
+	move.l	(4,sp),a0
+	move.l	d1,(a0)
+2:
+	rts
+1:
+	jmp	(cerror)

+ 4 - 0
mach/sun3/libsys/_write.s

@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __write
+__write: SYSTEM(SYS_write)

+ 2 - 1
mach/sun3/libsys/gtty.c

@@ -1,5 +1,6 @@
 #include <sgtty.h>
-int gtty(fildes,argp)
+int
+gtty(fildes,argp)
 	int fildes ;
 	struct sgttyb *argp ;
 {