added new routines for ansi
This commit is contained in:
parent
dbe88218e4
commit
a940c44ae5
|
@ -4,6 +4,7 @@ access.s
|
||||||
acct.s
|
acct.s
|
||||||
adjtime.s
|
adjtime.s
|
||||||
alarm.c
|
alarm.c
|
||||||
|
_alarm.c
|
||||||
async_dem.s
|
async_dem.s
|
||||||
bind.s
|
bind.s
|
||||||
cerror.s
|
cerror.s
|
||||||
|
@ -13,25 +14,35 @@ chown.s
|
||||||
chroot.s
|
chroot.s
|
||||||
cleanup.c
|
cleanup.c
|
||||||
close.s
|
close.s
|
||||||
|
_close.s
|
||||||
connect.s
|
connect.s
|
||||||
creat.s
|
creat.s
|
||||||
|
_creat.s
|
||||||
dup.s
|
dup.s
|
||||||
|
_dup.s
|
||||||
dup2.s
|
dup2.s
|
||||||
|
_dup2.s
|
||||||
execl.c
|
execl.c
|
||||||
|
_execl.c
|
||||||
execle.c
|
execle.c
|
||||||
execv.c
|
execv.c
|
||||||
execve.s
|
execve.s
|
||||||
|
_execve.s
|
||||||
exit.c
|
exit.c
|
||||||
exportfs.s
|
exportfs.s
|
||||||
fchmod.s
|
fchmod.s
|
||||||
fchown.s
|
fchown.s
|
||||||
fcntl.s
|
fcntl.s
|
||||||
|
_fcntl.s
|
||||||
flock.s
|
flock.s
|
||||||
fork.s
|
fork.s
|
||||||
|
_fork.s
|
||||||
fstat.s
|
fstat.s
|
||||||
|
_fstat.s
|
||||||
fstatfs.s
|
fstatfs.s
|
||||||
fsync.s
|
fsync.s
|
||||||
ftime.c
|
ftime.c
|
||||||
|
_ftime.c
|
||||||
ftruncate.s
|
ftruncate.s
|
||||||
getdirent.s
|
getdirent.s
|
||||||
getdomnam.s
|
getdomnam.s
|
||||||
|
@ -47,19 +58,26 @@ getpagesiz.s
|
||||||
getpeernam.s
|
getpeernam.s
|
||||||
getpgrp.s
|
getpgrp.s
|
||||||
getpid.s
|
getpid.s
|
||||||
|
_getpid.s
|
||||||
getprio.s
|
getprio.s
|
||||||
getrlimit.s
|
getrlimit.s
|
||||||
getrusage.s
|
getrusage.s
|
||||||
|
_getrusage.s
|
||||||
getsocknam.s
|
getsocknam.s
|
||||||
getsockopt.s
|
getsockopt.s
|
||||||
gettimday.s
|
gettimday.s
|
||||||
|
_gettimday.s
|
||||||
getuid.s
|
getuid.s
|
||||||
ioctl.s
|
ioctl.s
|
||||||
|
_ioctl.s
|
||||||
kill.s
|
kill.s
|
||||||
|
_kill.s
|
||||||
killpg.s
|
killpg.s
|
||||||
link.s
|
link.s
|
||||||
|
_link.s
|
||||||
listen.s
|
listen.s
|
||||||
lseek.s
|
lseek.s
|
||||||
|
_lseek.s
|
||||||
lstat.s
|
lstat.s
|
||||||
madvise.s
|
madvise.s
|
||||||
mincore.s
|
mincore.s
|
||||||
|
@ -73,12 +91,16 @@ munmap.s
|
||||||
nfssvc.s
|
nfssvc.s
|
||||||
nice.c
|
nice.c
|
||||||
open.s
|
open.s
|
||||||
|
_open.s
|
||||||
pause.c
|
pause.c
|
||||||
|
_pause.c
|
||||||
pipe.s
|
pipe.s
|
||||||
|
_pipe.s
|
||||||
profil.s
|
profil.s
|
||||||
ptrace.s
|
ptrace.s
|
||||||
quotactl.s
|
quotactl.s
|
||||||
read.s
|
read.s
|
||||||
|
_read.s
|
||||||
readlink.s
|
readlink.s
|
||||||
readv.s
|
readv.s
|
||||||
reboot.s
|
reboot.s
|
||||||
|
@ -88,6 +110,7 @@ recvmsg.s
|
||||||
rename.s
|
rename.s
|
||||||
rmdir.s
|
rmdir.s
|
||||||
sbrk.s
|
sbrk.s
|
||||||
|
_sbrk.s
|
||||||
select.s
|
select.s
|
||||||
send.s
|
send.s
|
||||||
sendmsg.s
|
sendmsg.s
|
||||||
|
@ -97,6 +120,7 @@ setdopt.s
|
||||||
setgroups.s
|
setgroups.s
|
||||||
sethostnam.s
|
sethostnam.s
|
||||||
setitimer.s
|
setitimer.s
|
||||||
|
_setitimer.s
|
||||||
setpgrp.s
|
setpgrp.s
|
||||||
setprio.s
|
setprio.s
|
||||||
setregid.s
|
setregid.s
|
||||||
|
@ -106,8 +130,10 @@ setsockopt.s
|
||||||
settimday.s
|
settimday.s
|
||||||
shutdown.s
|
shutdown.s
|
||||||
sigblock.s
|
sigblock.s
|
||||||
|
_sigblock.s
|
||||||
signal.c
|
signal.c
|
||||||
sigpause.s
|
sigpause.s
|
||||||
|
_sigpause.s
|
||||||
sigsetmask.s
|
sigsetmask.s
|
||||||
sigstack.s
|
sigstack.s
|
||||||
sigtramp.s
|
sigtramp.s
|
||||||
|
@ -123,20 +149,26 @@ sync.s
|
||||||
syscall.s
|
syscall.s
|
||||||
time.c
|
time.c
|
||||||
times.c
|
times.c
|
||||||
|
_times.c
|
||||||
truncate.s
|
truncate.s
|
||||||
umask.s
|
umask.s
|
||||||
unlink.s
|
unlink.s
|
||||||
|
_unlink.s
|
||||||
umount.s
|
umount.s
|
||||||
unmount.s
|
unmount.s
|
||||||
utime.c
|
utime.c
|
||||||
utimes.s
|
utimes.s
|
||||||
vhangup.s
|
vhangup.s
|
||||||
wait.s
|
wait.s
|
||||||
|
_wait.s
|
||||||
write.s
|
write.s
|
||||||
|
_write.s
|
||||||
writev.s
|
writev.s
|
||||||
_exit.s
|
_exit.s
|
||||||
stty.c
|
stty.c
|
||||||
|
_stty.c
|
||||||
gtty.c
|
gtty.c
|
||||||
|
_gtty.c
|
||||||
getegid.s
|
getegid.s
|
||||||
geteuid.s
|
geteuid.s
|
||||||
getppid.s
|
getppid.s
|
||||||
|
|
13
mach/sun2/libsys/_alarm.c
Normal file
13
mach/sun2/libsys/_alarm.c
Normal file
|
@ -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
mach/sun2/libsys/_close.s
Normal file
4
mach/sun2/libsys/_close.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __close
|
||||||
|
__close: SYSTEM(SYS_close)
|
4
mach/sun2/libsys/_creat.s
Normal file
4
mach/sun2/libsys/_creat.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __creat
|
||||||
|
__creat: SYSTEM(SYS_creat)
|
4
mach/sun2/libsys/_dup.s
Normal file
4
mach/sun2/libsys/_dup.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __dup
|
||||||
|
__dup: SYSTEM(SYS_dup)
|
4
mach/sun2/libsys/_dup2.s
Normal file
4
mach/sun2/libsys/_dup2.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __dup2
|
||||||
|
__dup2: SYSTEM(SYS_dup2)
|
8
mach/sun2/libsys/_execl.c
Normal file
8
mach/sun2/libsys/_execl.c
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
_execl(name,args)
|
||||||
|
char *name;
|
||||||
|
int args;
|
||||||
|
{
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
|
_execve(name,&args,environ);
|
||||||
|
}
|
4
mach/sun2/libsys/_execve.s
Normal file
4
mach/sun2/libsys/_execve.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __execve
|
||||||
|
__execve: SYSTEM(SYS_execve)
|
4
mach/sun2/libsys/_fcntl.s
Normal file
4
mach/sun2/libsys/_fcntl.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __fcntl
|
||||||
|
__fcntl: SYSTEM(SYS_fcntl)
|
14
mach/sun2/libsys/_fork.s
Normal file
14
mach/sun2/libsys/_fork.s
Normal file
|
@ -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
|
4
mach/sun2/libsys/_fstat.s
Normal file
4
mach/sun2/libsys/_fstat.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __fstat
|
||||||
|
__fstat: SYSTEM(SYS_fstat)
|
15
mach/sun2/libsys/_ftime.c
Normal file
15
mach/sun2/libsys/_ftime.c
Normal file
|
@ -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
mach/sun2/libsys/_getpid.s
Normal file
4
mach/sun2/libsys/_getpid.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __getpid
|
||||||
|
__getpid: SYSTEM(SYS_getpid)
|
4
mach/sun2/libsys/_getrusage.s
Normal file
4
mach/sun2/libsys/_getrusage.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __getrusage
|
||||||
|
__getrusage: SYSTEM(SYS_getrusage)
|
4
mach/sun2/libsys/_gettimday.s
Normal file
4
mach/sun2/libsys/_gettimday.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __gettimeofday
|
||||||
|
__gettimeofday: SYSTEM(SYS_gettimeofday)
|
8
mach/sun2/libsys/_gtty.c
Normal file
8
mach/sun2/libsys/_gtty.c
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include <sgtty.h>
|
||||||
|
int
|
||||||
|
_gtty(fildes,argp)
|
||||||
|
int fildes ;
|
||||||
|
struct sgttyb *argp ;
|
||||||
|
{
|
||||||
|
return _ioctl(fildes,TIOCGETP,argp) ;
|
||||||
|
}
|
4
mach/sun2/libsys/_ioctl.s
Normal file
4
mach/sun2/libsys/_ioctl.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __ioctl
|
||||||
|
__ioctl: SYSTEM(SYS_ioctl)
|
4
mach/sun2/libsys/_kill.s
Normal file
4
mach/sun2/libsys/_kill.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __kill
|
||||||
|
__kill: SYSTEM(SYS_kill)
|
4
mach/sun2/libsys/_link.s
Normal file
4
mach/sun2/libsys/_link.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __link
|
||||||
|
__link: SYSTEM(SYS_link)
|
4
mach/sun2/libsys/_lseek.s
Normal file
4
mach/sun2/libsys/_lseek.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __lseek
|
||||||
|
__lseek: SYSTEM(SYS_lseek)
|
4
mach/sun2/libsys/_open.s
Normal file
4
mach/sun2/libsys/_open.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __open
|
||||||
|
__open: SYSTEM(SYS_open)
|
3
mach/sun2/libsys/_pause.c
Normal file
3
mach/sun2/libsys/_pause.c
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
_pause() {
|
||||||
|
_sigpause(_sigblock());
|
||||||
|
}
|
14
mach/sun2/libsys/_pipe.s
Normal file
14
mach/sun2/libsys/_pipe.s
Normal file
|
@ -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
mach/sun2/libsys/_read.s
Normal file
4
mach/sun2/libsys/_read.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __read
|
||||||
|
__read: SYSTEM(SYS_read)
|
39
mach/sun2/libsys/_sbrk.s
Normal file
39
mach/sun2/libsys/_sbrk.s
Normal file
|
@ -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
|
4
mach/sun2/libsys/_setitimer.s
Normal file
4
mach/sun2/libsys/_setitimer.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __setitimer
|
||||||
|
__setitimer: SYSTEM(SYS_setitimer)
|
4
mach/sun2/libsys/_sigblock.s
Normal file
4
mach/sun2/libsys/_sigblock.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __sigblock
|
||||||
|
__sigblock: SYSTEM(SYS_sigblock)
|
4
mach/sun2/libsys/_sigpause.s
Normal file
4
mach/sun2/libsys/_sigpause.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __sigpause
|
||||||
|
__sigpause: SYSTEM(SYS_sigpause)
|
8
mach/sun2/libsys/_stty.c
Normal file
8
mach/sun2/libsys/_stty.c
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include <sgtty.h>
|
||||||
|
int
|
||||||
|
_stty(fildes,argp)
|
||||||
|
int fildes ;
|
||||||
|
struct sgttyb *argp ;
|
||||||
|
{
|
||||||
|
return _ioctl(fildes,TIOCSETP,argp) ;
|
||||||
|
}
|
16
mach/sun2/libsys/_times.c
Normal file
16
mach/sun2/libsys/_times.c
Normal file
|
@ -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;
|
||||||
|
}
|
4
mach/sun2/libsys/_unlink.s
Normal file
4
mach/sun2/libsys/_unlink.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __unlink
|
||||||
|
__unlink: SYSTEM(SYS_unlink)
|
15
mach/sun2/libsys/_wait.s
Normal file
15
mach/sun2/libsys/_wait.s
Normal file
|
@ -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
mach/sun2/libsys/_write.s
Normal file
4
mach/sun2/libsys/_write.s
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#include "syscall.h"
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
|
||||||
|
.define __write
|
||||||
|
__write: SYSTEM(SYS_write)
|
|
@ -1,5 +1,6 @@
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
int gtty(fildes,argp)
|
int
|
||||||
|
gtty(fildes,argp)
|
||||||
int fildes ;
|
int fildes ;
|
||||||
struct sgttyb *argp ;
|
struct sgttyb *argp ;
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
int stty(fildes,argp)
|
int
|
||||||
|
stty(fildes,argp)
|
||||||
int fildes ;
|
int fildes ;
|
||||||
struct sgttyb *argp ;
|
struct sgttyb *argp ;
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue