Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/osf1 add COMPAT_OSF1 getitimer(2). Patch submitt...



details:   https://anonhg.NetBSD.org/src/rev/ac4d17334b7d
branches:  trunk
changeset: 511848:ac4d17334b7d
user:      dmcmahill <dmcmahill%NetBSD.org@localhost>
date:      Thu Jun 28 01:48:22 2001 +0000

description:
add COMPAT_OSF1 getitimer(2).  Patch submitted by Kevin Schoedel
<schoedel%kw.igs.net@localhost> in PR port-alpha/13071, reviewed by Jason Thorpe.

diffstat:

 sys/compat/osf1/osf1_time.c     |  49 ++++++++++++++++++++++++++++++++++++++++-
 sys/compat/osf1/syscalls.master |   4 +-
 2 files changed, 50 insertions(+), 3 deletions(-)

diffs (81 lines):

diff -r fc69c19e4b32 -r ac4d17334b7d sys/compat/osf1/osf1_time.c
--- a/sys/compat/osf1/osf1_time.c       Thu Jun 28 00:26:38 2001 +0000
+++ b/sys/compat/osf1/osf1_time.c       Thu Jun 28 01:48:22 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_time.c,v 1.2 1999/05/05 01:51:37 cgd Exp $ */
+/* $NetBSD: osf1_time.c,v 1.3 2001/06/28 01:48:23 dmcmahill Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -176,6 +176,53 @@
 }
 
 int
+osf1_sys_getitimer(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct osf1_sys_getitimer_args *uap = v;
+       struct sys_getitimer_args a;
+       struct osf1_itimerval o_oitv;
+       struct itimerval b_oitv;
+       caddr_t sg;
+       int error;
+       switch (SCARG(uap, which)) {
+       case OSF1_ITIMER_REAL:
+               SCARG(&a, which) = ITIMER_REAL;
+               break;
+       case OSF1_ITIMER_VIRTUAL:
+               SCARG(&a, which) = ITIMER_VIRTUAL;
+               break;
+       case OSF1_ITIMER_PROF:
+               SCARG(&a, which) = ITIMER_PROF;
+               break;
+       default:
+               return (EINVAL);
+       }
+       sg = stackgap_init(p->p_emul);
+       SCARG(&a, itv) = stackgap_alloc(&sg, sizeof b_oitv);
+       if (error == 0)
+               error = sys_getitimer(p, &a, retval);
+       if (error == 0 && SCARG(uap, itv) != NULL) {
+               /* get the NetBSD itimerval return value */
+               error = copyin((caddr_t)SCARG(&a, itv), (caddr_t)&b_oitv,
+                   sizeof b_oitv);
+               if (error == 0) {
+                       /* fill in and copy out the NetBSD timeval */
+                       memset(&o_oitv, 0, sizeof o_oitv);
+                       o_oitv.it_interval.tv_sec = b_oitv.it_interval.tv_sec;
+                       o_oitv.it_interval.tv_usec = b_oitv.it_interval.tv_usec;
+                       o_oitv.it_value.tv_sec = b_oitv.it_value.tv_sec;
+                       o_oitv.it_value.tv_usec = b_oitv.it_value.tv_usec;
+                       error = copyout((caddr_t)&o_oitv,
+                           (caddr_t)SCARG(uap, itv), sizeof o_oitv);
+               }
+       }
+       return (error);
+}
+
+int
 osf1_sys_settimeofday(p, v, retval)
        struct proc *p;
        void *v;
diff -r fc69c19e4b32 -r ac4d17334b7d sys/compat/osf1/syscalls.master
--- a/sys/compat/osf1/syscalls.master   Thu Jun 28 00:26:38 2001 +0000
+++ b/sys/compat/osf1/syscalls.master   Thu Jun 28 01:48:22 2001 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.37 2001/06/23 02:45:54 dmcmahill Exp $
+       $NetBSD: syscalls.master,v 1.38 2001/06/28 01:48:22 dmcmahill Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -159,7 +159,7 @@
                            struct osf1_itimerval *oitv); }
 84     UNIMPL          old wait
 85     UNIMPL          table
-86     UNIMPL          getitimer
+86     STD             { int osf1_sys_getitimer(u_int which, struct osf1_itimerval *itv); }
 87     NOARGS          { int compat_43_sys_gethostname(char *hostname, \
                            u_int len); }
 88     NOARGS          { int compat_43_sys_sethostname(const char *hostname, \



Home | Main Index | Thread Index | Old Index