Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2003 14:15:09 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43774 for review
Message-ID:  <200312102215.hBAMF9J2042250@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43774

Change 43774 by peter@peter_daintree on 2003/12/10 14:14:18

	implement getitimer

Affected files ...

.. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_misc.c#4 edit
.. //depot/projects/hammer/sys/compat/freebsd32/syscalls.master#6 edit

Differences ...

==== //depot/projects/hammer/sys/compat/freebsd32/freebsd32_misc.c#4 (text+ko) ====

@@ -647,6 +647,34 @@
 }
 
 int
+freebsd32_getitimer(struct thread *td, struct freebsd32_getitimer_args *uap)
+{
+	int error;
+	caddr_t sg;
+	struct itimerval32 *p32, s32;
+	truct itimerval *p = NULL, s;
+
+	p32 = uap->itv;
+	if (p32) {
+		sg = stackgap_init();
+		p = stackgap_alloc(&sg, sizeof(struct itimerval));
+		uap->itv = (struct itimerval32 *)p;
+	}
+	error = getitimer(td, (struct getitimer_args *) uap);
+	if (error)
+		return (error);
+	if (p32) {
+		error = copyin(op, &s, sizeof(s));
+		if (error)
+			return (error);
+		TV_CP(s, s32, it_interval);
+		TV_CP(s, s32, it_value);
+		error = copyout(&s32, p32, sizeof(s32));
+	}
+	return (error);
+}
+
+int
 freebsd32_select(struct thread *td, struct freebsd32_select_args *uap)
 {
 	int error;

==== //depot/projects/hammer/sys/compat/freebsd32/syscalls.master#6 (text+ko) ====

@@ -116,8 +116,8 @@
 			    struct itimerval32 *oitv); }
 84	OBSOL	BSD	owait
 85	MNOPROTO BSD	{ int swapon(char *name); }
-; XXX implement
-86	OBSOL	BSD	ogetitimer
+86	MNOPROTO BSD	{ int freebsd32_getitimer(u_int which, \
+			    struct itimerval32 *itv); }
 87	OBSOL	BSD	ogethostname
 88	OBSOL	BSD	osethostname
 89	MNOPROTO BSD	{ int getdtablesize(void); }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312102215.hBAMF9J2042250>