summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2/ibcs2_misc.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-03-31 22:58:37 +0000
committerjhb <jhb@FreeBSD.org>2005-03-31 22:58:37 +0000
commit047dd93dbdefce8c79951c96743cb1941a8ebf3d (patch)
treee4ff94c35f34f4271e8741394cb85664ec9edd62 /sys/i386/ibcs2/ibcs2_misc.c
parent38bfdc988feda4d036626c8699e0e764ca1b1cb8 (diff)
downloadFreeBSD-src-047dd93dbdefce8c79951c96743cb1941a8ebf3d.zip
FreeBSD-src-047dd93dbdefce8c79951c96743cb1941a8ebf3d.tar.gz
Use kern_settimeofday() to avoid stackgap use.
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_misc.c')
-rw-r--r--sys/i386/ibcs2/ibcs2_misc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c
index d29946f..c4b9370 100644
--- a/sys/i386/ibcs2/ibcs2_misc.c
+++ b/sys/i386/ibcs2/ibcs2_misc.c
@@ -899,19 +899,19 @@ ibcs2_stime(td, uap)
struct thread *td;
struct ibcs2_stime_args *uap;
{
+ struct timeval tv;
+ long secs;
int error;
- struct settimeofday_args sa;
- caddr_t sg = stackgap_init();
- sa.tv = stackgap_alloc(&sg, sizeof(*sa.tv));
- sa.tzp = NULL;
- if ((error = copyin((caddr_t)uap->timep,
- &(sa.tv->tv_sec), sizeof(long))) != 0)
- return error;
- sa.tv->tv_usec = 0;
- if ((error = settimeofday(td, &sa)) != 0)
- return EPERM;
- return 0;
+ error = copyin(uap->timep, &secs, sizeof(long));
+ if (error)
+ return (error);
+ tv.tv_sec = secs;
+ tv.tv_usec = 0;
+ error = kern_settimeofday(td, &tv, NULL);
+ if (error)
+ error = EPERM;
+ return (error);
}
int
OpenPOWER on IntegriCloud