added new routines for ansi
authoreck <none@none>
Mon, 22 Jan 1990 11:56:01 +0000 (11:56 +0000)
committereck <none@none>
Mon, 22 Jan 1990 11:56:01 +0000 (11:56 +0000)
35 files changed:
mach/sun2/libsys/LIST
mach/sun2/libsys/_alarm.c [new file with mode: 0644]
mach/sun2/libsys/_close.s [new file with mode: 0644]
mach/sun2/libsys/_creat.s [new file with mode: 0644]
mach/sun2/libsys/_dup.s [new file with mode: 0644]
mach/sun2/libsys/_dup2.s [new file with mode: 0644]
mach/sun2/libsys/_execl.c [new file with mode: 0644]
mach/sun2/libsys/_execve.s [new file with mode: 0644]
mach/sun2/libsys/_fcntl.s [new file with mode: 0644]
mach/sun2/libsys/_fork.s [new file with mode: 0644]
mach/sun2/libsys/_fstat.s [new file with mode: 0644]
mach/sun2/libsys/_ftime.c [new file with mode: 0644]
mach/sun2/libsys/_getpid.s [new file with mode: 0644]
mach/sun2/libsys/_getrusage.s [new file with mode: 0644]
mach/sun2/libsys/_gettimday.s [new file with mode: 0644]
mach/sun2/libsys/_gtty.c [new file with mode: 0644]
mach/sun2/libsys/_ioctl.s [new file with mode: 0644]
mach/sun2/libsys/_kill.s [new file with mode: 0644]
mach/sun2/libsys/_link.s [new file with mode: 0644]
mach/sun2/libsys/_lseek.s [new file with mode: 0644]
mach/sun2/libsys/_open.s [new file with mode: 0644]
mach/sun2/libsys/_pause.c [new file with mode: 0644]
mach/sun2/libsys/_pipe.s [new file with mode: 0644]
mach/sun2/libsys/_read.s [new file with mode: 0644]
mach/sun2/libsys/_sbrk.s [new file with mode: 0644]
mach/sun2/libsys/_setitimer.s [new file with mode: 0644]
mach/sun2/libsys/_sigblock.s [new file with mode: 0644]
mach/sun2/libsys/_sigpause.s [new file with mode: 0644]
mach/sun2/libsys/_stty.c [new file with mode: 0644]
mach/sun2/libsys/_times.c [new file with mode: 0644]
mach/sun2/libsys/_unlink.s [new file with mode: 0644]
mach/sun2/libsys/_wait.s [new file with mode: 0644]
mach/sun2/libsys/_write.s [new file with mode: 0644]
mach/sun2/libsys/gtty.c
mach/sun2/libsys/stty.c

index 3b15290..47351b7 100644 (file)
@@ -4,6 +4,7 @@ access.s
 acct.s
 adjtime.s
 alarm.c
+_alarm.c
 async_dem.s
 bind.s
 cerror.s
@@ -13,25 +14,35 @@ chown.s
 chroot.s
 cleanup.c
 close.s
+_close.s
 connect.s
 creat.s
+_creat.s
 dup.s
+_dup.s
 dup2.s
+_dup2.s
 execl.c
+_execl.c
 execle.c
 execv.c
 execve.s
+_execve.s
 exit.c
 exportfs.s
 fchmod.s
 fchown.s
 fcntl.s
+_fcntl.s
 flock.s
 fork.s
+_fork.s
 fstat.s
+_fstat.s
 fstatfs.s
 fsync.s
 ftime.c
+_ftime.c
 ftruncate.s
 getdirent.s
 getdomnam.s
@@ -47,19 +58,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
@@ -73,12 +91,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
@@ -88,6 +110,7 @@ recvmsg.s
 rename.s
 rmdir.s
 sbrk.s
+_sbrk.s
 select.s
 send.s
 sendmsg.s
@@ -97,6 +120,7 @@ setdopt.s
 setgroups.s
 sethostnam.s
 setitimer.s
+_setitimer.s
 setpgrp.s
 setprio.s
 setregid.s
@@ -106,8 +130,10 @@ setsockopt.s
 settimday.s
 shutdown.s
 sigblock.s
+_sigblock.s
 signal.c
 sigpause.s
+_sigpause.s
 sigsetmask.s
 sigstack.s
 sigtramp.s
@@ -123,20 +149,26 @@ sync.s
 syscall.s
 time.c
 times.c
+_times.c
 truncate.s
 umask.s
 unlink.s
+_unlink.s
 umount.s
 unmount.s
 utime.c
 utimes.s
 vhangup.s
 wait.s
+_wait.s
 write.s
+_write.s
 writev.s
 _exit.s
 stty.c
+_stty.c
 gtty.c
+_gtty.c
 getegid.s
 geteuid.s
 getppid.s
diff --git a/mach/sun2/libsys/_alarm.c b/mach/sun2/libsys/_alarm.c
new file mode 100644 (file)
index 0000000..595cb13
--- /dev/null
@@ -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;
+}
diff --git a/mach/sun2/libsys/_close.s b/mach/sun2/libsys/_close.s
new file mode 100644 (file)
index 0000000..cc0d4be
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __close
+__close: SYSTEM(SYS_close)
diff --git a/mach/sun2/libsys/_creat.s b/mach/sun2/libsys/_creat.s
new file mode 100644 (file)
index 0000000..eb31e48
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __creat
+__creat: SYSTEM(SYS_creat)
diff --git a/mach/sun2/libsys/_dup.s b/mach/sun2/libsys/_dup.s
new file mode 100644 (file)
index 0000000..b2f4d6f
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __dup
+__dup: SYSTEM(SYS_dup)
diff --git a/mach/sun2/libsys/_dup2.s b/mach/sun2/libsys/_dup2.s
new file mode 100644 (file)
index 0000000..63a371d
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __dup2
+__dup2: SYSTEM(SYS_dup2)
diff --git a/mach/sun2/libsys/_execl.c b/mach/sun2/libsys/_execl.c
new file mode 100644 (file)
index 0000000..93b8a37
--- /dev/null
@@ -0,0 +1,8 @@
+_execl(name,args)
+       char *name;
+       int args;
+{
+       extern char **environ;
+
+       _execve(name,&args,environ);
+}
diff --git a/mach/sun2/libsys/_execve.s b/mach/sun2/libsys/_execve.s
new file mode 100644 (file)
index 0000000..21de1ff
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __execve
+__execve: SYSTEM(SYS_execve)
diff --git a/mach/sun2/libsys/_fcntl.s b/mach/sun2/libsys/_fcntl.s
new file mode 100644 (file)
index 0000000..2f71c8a
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __fcntl
+__fcntl: SYSTEM(SYS_fcntl)
diff --git a/mach/sun2/libsys/_fork.s b/mach/sun2/libsys/_fork.s
new file mode 100644 (file)
index 0000000..2d0eb4c
--- /dev/null
@@ -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
diff --git a/mach/sun2/libsys/_fstat.s b/mach/sun2/libsys/_fstat.s
new file mode 100644 (file)
index 0000000..824df98
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __fstat
+__fstat: SYSTEM(SYS_fstat)
diff --git a/mach/sun2/libsys/_ftime.c b/mach/sun2/libsys/_ftime.c
new file mode 100644 (file)
index 0000000..15d6913
--- /dev/null
@@ -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;
+}
diff --git a/mach/sun2/libsys/_getpid.s b/mach/sun2/libsys/_getpid.s
new file mode 100644 (file)
index 0000000..8f52a39
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __getpid
+__getpid: SYSTEM(SYS_getpid)
diff --git a/mach/sun2/libsys/_getrusage.s b/mach/sun2/libsys/_getrusage.s
new file mode 100644 (file)
index 0000000..f5e38a2
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __getrusage
+__getrusage: SYSTEM(SYS_getrusage)
diff --git a/mach/sun2/libsys/_gettimday.s b/mach/sun2/libsys/_gettimday.s
new file mode 100644 (file)
index 0000000..a4f3adc
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __gettimeofday
+__gettimeofday: SYSTEM(SYS_gettimeofday)
diff --git a/mach/sun2/libsys/_gtty.c b/mach/sun2/libsys/_gtty.c
new file mode 100644 (file)
index 0000000..0b2f0cc
--- /dev/null
@@ -0,0 +1,8 @@
+#include <sgtty.h>
+int
+_gtty(fildes,argp)
+       int fildes ;
+       struct sgttyb *argp ;
+{
+       return _ioctl(fildes,TIOCGETP,argp) ;
+}
diff --git a/mach/sun2/libsys/_ioctl.s b/mach/sun2/libsys/_ioctl.s
new file mode 100644 (file)
index 0000000..e93fa65
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __ioctl
+__ioctl: SYSTEM(SYS_ioctl)
diff --git a/mach/sun2/libsys/_kill.s b/mach/sun2/libsys/_kill.s
new file mode 100644 (file)
index 0000000..a821215
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __kill
+__kill: SYSTEM(SYS_kill)
diff --git a/mach/sun2/libsys/_link.s b/mach/sun2/libsys/_link.s
new file mode 100644 (file)
index 0000000..ab20e8b
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __link
+__link: SYSTEM(SYS_link)
diff --git a/mach/sun2/libsys/_lseek.s b/mach/sun2/libsys/_lseek.s
new file mode 100644 (file)
index 0000000..1a0f707
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __lseek
+__lseek: SYSTEM(SYS_lseek)
diff --git a/mach/sun2/libsys/_open.s b/mach/sun2/libsys/_open.s
new file mode 100644 (file)
index 0000000..8c3ceb8
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __open
+__open: SYSTEM(SYS_open)
diff --git a/mach/sun2/libsys/_pause.c b/mach/sun2/libsys/_pause.c
new file mode 100644 (file)
index 0000000..90da575
--- /dev/null
@@ -0,0 +1,3 @@
+_pause() {
+       _sigpause(_sigblock());
+}
diff --git a/mach/sun2/libsys/_pipe.s b/mach/sun2/libsys/_pipe.s
new file mode 100644 (file)
index 0000000..990cbc1
--- /dev/null
@@ -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
diff --git a/mach/sun2/libsys/_read.s b/mach/sun2/libsys/_read.s
new file mode 100644 (file)
index 0000000..9bd1f88
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __read
+__read: SYSTEM(SYS_read)
diff --git a/mach/sun2/libsys/_sbrk.s b/mach/sun2/libsys/_sbrk.s
new file mode 100644 (file)
index 0000000..ba658b2
--- /dev/null
@@ -0,0 +1,39 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __sbrk,__brk
+__sbrk:
+       move.l  4(sp),d0
+       add.l   #3,d0
+       move.l  #~3,d1
+       and.l   d1,d0
+       move.l  d0,a0
+       move.l  curbrk,d0
+       add.l   #3,d0
+       and.l   d1,d0
+       move.l  d0,curbrk
+       add.l   d0,a0
+       move.l  a0,4(sp)
+       pea     17      ! not SYS_sbrk
+       trap    #0
+       bcs     1f
+       move.l  curbrk,d0
+       move.l  4(sp),curbrk
+       rts
+1:
+       jmp     cerror
+
+__brk:
+       move.l  4(sp),d0
+       add.l   #3,d0
+       move.l  #~3,d1
+       and.l   d1,d0
+       move.l  d0,4(sp)
+       pea     17
+       trap    #0
+       bcs     1b
+       move.l  4(sp),curbrk
+       clr.l   d0
+       rts
+
+.sect .data
+curbrk:        .data4 endbss
diff --git a/mach/sun2/libsys/_setitimer.s b/mach/sun2/libsys/_setitimer.s
new file mode 100644 (file)
index 0000000..5b5966f
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __setitimer
+__setitimer: SYSTEM(SYS_setitimer)
diff --git a/mach/sun2/libsys/_sigblock.s b/mach/sun2/libsys/_sigblock.s
new file mode 100644 (file)
index 0000000..503cde2
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __sigblock
+__sigblock: SYSTEM(SYS_sigblock)
diff --git a/mach/sun2/libsys/_sigpause.s b/mach/sun2/libsys/_sigpause.s
new file mode 100644 (file)
index 0000000..0774b99
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __sigpause
+__sigpause: SYSTEM(SYS_sigpause)
diff --git a/mach/sun2/libsys/_stty.c b/mach/sun2/libsys/_stty.c
new file mode 100644 (file)
index 0000000..4081357
--- /dev/null
@@ -0,0 +1,8 @@
+#include <sgtty.h>
+int
+_stty(fildes,argp)
+       int fildes ;
+       struct sgttyb *argp ;
+{
+       return _ioctl(fildes,TIOCSETP,argp) ;
+}
diff --git a/mach/sun2/libsys/_times.c b/mach/sun2/libsys/_times.c
new file mode 100644 (file)
index 0000000..1d6a7b9
--- /dev/null
@@ -0,0 +1,16 @@
+#include <sys/types.h>
+
+#define Xval(xx)       ((xx).l1*60+(xx).l2/(100000/6))
+
+_times(bp)
+       struct { time_t l1,l2,l3,l4;} *bp;
+{
+       struct { struct { long l1,l2; }s1,s2; long x[20]; } t;
+       if (_getrusage(0,&t) < 0) return -1;
+       bp->l1 = Xval(t.s1);
+       bp->l2 = Xval(t.s2);
+       if (_getrusage(-1,&t) < 0) return -1;
+       bp->l3 = Xval(t.s1);
+       bp->l4 = Xval(t.s2);
+       return 0;
+}
diff --git a/mach/sun2/libsys/_unlink.s b/mach/sun2/libsys/_unlink.s
new file mode 100644 (file)
index 0000000..0538fb0
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __unlink
+__unlink: SYSTEM(SYS_unlink)
diff --git a/mach/sun2/libsys/_wait.s b/mach/sun2/libsys/_wait.s
new file mode 100644 (file)
index 0000000..3ae14f9
--- /dev/null
@@ -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
diff --git a/mach/sun2/libsys/_write.s b/mach/sun2/libsys/_write.s
new file mode 100644 (file)
index 0000000..1c45020
--- /dev/null
@@ -0,0 +1,4 @@
+#include "syscall.h"
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __write
+__write: SYSTEM(SYS_write)
index 7f42ea1..be841e7 100644 (file)
@@ -1,5 +1,6 @@
 #include <sgtty.h>
-int gtty(fildes,argp)
+int
+gtty(fildes,argp)
        int fildes ;
        struct sgttyb *argp ;
 {
index 222310c..1473aba 100644 (file)
@@ -1,5 +1,6 @@
 #include <sgtty.h>
-int stty(fildes,argp)
+int
+stty(fildes,argp)
        int fildes ;
        struct sgttyb *argp ;
 {