* Everything in this file is a routine implementing a system call.
* return the current time (old-style entry)
* New time entry-- return TOD with milliseconds, timezone,
uap
= (struct a
*)u
.u_ap
;
t
.millitm
= (1000*ms
)/HZ
;
if (copyout((caddr_t
)&t
, (caddr_t
)uap
->tp
, sizeof(t
)) < 0)
register unsigned int i
, j
;
uap
= (struct a
*)u
.u_ap
;
/* In addition to setting software time (GMT seconds
* since YRREF), also set VAX TODR reg (10 ms. clicks
* into current year YRCURR
for (i
= time
, j
= YRREF
; j
< YRCURR
; j
++)
i
-= (SECYR
+ (j
%4?0:SECDAY
)) ;
mtpr(TODR
,i
*100) ; /* 10 ms. clicks */
uap
= (struct a
*)u
.u_ap
;
if(u
.u_ruid
== uid
|| suser()) {
uap
= (struct a
*)u
.u_ap
;
if(u
.u_rgid
== gid
|| suser()) {
u
.u_r
.r_val1
= u
.u_procp
->p_pid
;
u
.u_r
.r_val2
= u
.u_procp
->p_ppid
;
uap
= (struct a
*)u
.u_ap
;
* Hard to avoid races here, especially
* in unlinking directories.
register struct inode
*ip
, *pp
;
* to avoid hanging on the iget
if (pp
->i_number
== u
.u_dent
.d_ino
) {
ip
= iget(pp
->i_dev
, u
.u_dent
.d_ino
);
if((ip
->i_mode
&IFMT
)==IFDIR
&& !suser())
* Don't unlink a mounted file.
if (ip
->i_dev
!= pp
->i_dev
) {
xrele(ip
); /* try once to free text */
if (ip
->i_flag
&ITEXT
&& ip
->i_nlink
==1) {
u
.u_offset
-= sizeof(struct direct
);
u
.u_base
= (caddr_t
)&u
.u_dent
;
u
.u_count
= sizeof(struct direct
);
register struct inode
**ipp
;
register struct inode
*ip
;
if((ip
->i_mode
&IFMT
) != IFDIR
) {
register struct inode
*ip
;
uap
= (struct a
*)u
.u_ap
;
if ((ip
= owner()) == NULL
)
ip
->i_mode
|= uap
->fmode
&07777;
if (ip
->i_flag
&ITEXT
&& (ip
->i_mode
&ISVTX
)==0)
register struct inode
*ip
;
uap
= (struct a
*)u
.u_ap
;
if (!suser() || (ip
= owner()) == NULL
)
uap
= (struct a
*)u
.u_ap
;
if(a
<=0 || a
>=NSIG
|| a
==SIGKIL
) {
u
.u_r
.r_val1
= u
.u_signal
[a
];
u
.u_signal
[a
] = uap
->fun
;
u
.u_procp
->p_sig
&= ~(1<<(a
-1));
register struct proc
*p
, *q
;
uap
= (struct a
*)u
.u_ap
;
if (a
==-1 && u
.u_uid
==0) {
for(p
= &proc
[0]; p
< &proc
[NPROC
]; p
++) {
if(a
!= 0 && p
->p_pid
!= a
)
if(a
==0 && ((p
->p_pgrp
!=q
->p_pgrp
&&priv
==0) || p
<=&proc
[1]))
if(u
.u_uid
!= 0 && u
.u_uid
!= p
->p_uid
)
uap
= (struct a
*)u
.u_ap
;
if (copyout((caddr_t
)&u
.u_utime
, (caddr_t
)uap
->times
, sizeof(*uap
->times
)) < 0)
uap
= (struct a
*)u
.u_ap
;
u
.u_prof
.pr_base
= uap
->bufbase
;
u
.u_prof
.pr_size
= uap
->bufsize
;
u
.u_prof
.pr_off
= uap
->pcoffset
;
u
.u_prof
.pr_scale
= uap
->pcscale
;
uap
= (struct a
*)u
.u_ap
;
p
->p_clktim
= uap
->deltat
;
* no one should wakeup(&u)
sleep((caddr_t
)&u
, PSLEP
);
* mode mask for creation of files
uap
= (struct a
*)u
.u_ap
;
u
.u_cmask
= uap
->mask
& 0777;
* Set IUPD and IACC times on file.
register struct inode
*ip
;
uap
= (struct a
*)u
.u_ap
;
if ((ip
= owner()) == NULL
)
if (copyin((caddr_t
)uap
->tptr
, (caddr_t
)tv
, sizeof(tv
))) {
ip
->i_flag
|= IACC
|IUPD
|ICHG
;
iupdat(ip
, &tv
[0], &tv
[1]);
* Get microseconds since system boot
register int clkcnt
,clkstat
,pri
;
uap
= (struct a
*)u
.u_ap
;
clkcnt
+= CLKTICK
; /* microseconds since last tick */
clkcnt
+= CLKTICK
; /* account for overflow */
add64(clkcnt
,&total
[0],&total
[1]);
if (copyout((caddr_t
)total
,(caddr_t
)uap
->times
,8))