From owner-freebsd-mobile Thu Jan 1 09:50:55 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA25160 for mobile-outgoing; Thu, 1 Jan 1998 09:50:55 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from duncan.cs.utk.edu (DUNCAN.CS.UTK.EDU [128.169.94.83]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id JAA25151 for ; Thu, 1 Jan 1998 09:50:47 -0800 (PST) (envelope-from key@cs.utk.edu) Received: from LOCALHOST.cs.utk.edu by duncan.cs.utk.edu with SMTP (cf v2.11c-UTK) id MAA09248; Thu, 1 Jan 1998 12:50:33 -0500 Message-Id: <199801011750.MAA09248@duncan.cs.utk.edu> To: Mike Smith cc: Ken Key , freebsd-mobile@freebsd.org Subject: Re: More on APM suspened/calltodo patch. From: Ken Key In-reply-to: Your message of Wed, 31 Dec 1997 14:03:48 +1030. <199712310333.OAA00537@word.smith.net.au> Date: Thu, 01 Jan 1998 12:50:31 -0500 Sender: owner-freebsd-mobile@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > The "right" thing to do here appears to me to wait until I can actually > get a working -current kernel for my laptop, verify that the new > technique actually works (what tests did you do?), and then push your > older version back into 2.2. OK, sounds good to me. To test if the APM suspend/timeout code was working, I just ran the following test program and suspended the machine, waited a few minutes, resumed, and then watched to see if the select() timeout fired immediately or waited the amount of time. =================================>8 cut here 8<=========================== /* * timer_test.c testing interaction between timer operation on select and APM. */ #include #include #include int main(int argc, char *argv[]) { int cc; struct timeval timeout; time_t timenow; char *str_p; /* Test timeout of 45 seconds */ timeout.tv_sec = 45; timeout.tv_usec = 0; do { timenow = time(NULL); str_p = ctime(&timenow); str_p[strlen(str_p)-1] = ' '; printf("Time entering select: %s (timeout=%d)\n", str_p, timeout.tv_sec); cc = select(0, NULL, NULL, NULL, &timeout); timenow = time(NULL); str_p = ctime(&timenow); str_p[strlen(str_p)-1] = ' '; printf("Time exiting select: %s (cc= %d)\n\n", str_p, cc); } while(1); } =================================>8 cut here 8<=========================== -- Ken Key (key@cs.utk.edu) Univ. of Tennessee, Knoxville