| 795 | }; |
| 796 | #endif |
| 797 | int |
| 798 | sys_setitimer(struct thread *td, struct setitimer_args *uap) |
| 799 | { |
| 800 | struct itimerval aitv, oitv; |
| 801 | int error; |
| 802 | |
| 803 | if (uap->itv == NULL) { |
| 804 | uap->itv = uap->oitv; |
| 805 | return (sys_getitimer(td, (struct getitimer_args *)uap)); |
| 806 | } |
| 807 | |
| 808 | if ((error = copyin(uap->itv, &aitv, sizeof(struct itimerval)))) |
| 809 | return (error); |
| 810 | error = kern_setitimer(td, uap->which, &aitv, &oitv); |
| 811 | if (error != 0 || uap->oitv == NULL) |
| 812 | return (error); |
| 813 | return (copyout(&oitv, uap->oitv, sizeof(struct itimerval))); |
| 814 | } |
| 815 | |
| 816 | int |
| 817 | kern_setitimer(struct thread *td, u_int which, struct itimerval *aitv, |
nothing calls this directly
no test coverage detected