2 * Copyright (c) 2001-2002, 2004 Sendmail, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
10 #pragma ident "%Z%%M% %I% %E% SMI"
13 SM_RCSID("@(#)$Id: t-event.c,v 1.13 2005/06/14 23:07:20 ca Exp $")
19 # include <sys/wait.h>
22 #endif /* SM_CONF_SETITIMER */
27 static void evcheck
__P((int));
28 static void ev1
__P((int));
48 /* define as x if you want debug output */
58 sm_test_begin(argc
, argv
, "test event handling");
59 fprintf(stdout
, "This test may hang. If there is no output within twelve seconds, abort it\nand recompile with -DSM_CONF_SETITIMER=%d\n",
60 SM_CONF_SETITIMER
== 0 ? 1 : 0);
63 DBG_OUT(fprintf(stdout
, "We're back, test 1 seems to work.\n"));
64 ev
= sm_seteventm(1000, ev1
, 1);
67 DBG_OUT(fprintf(stdout
, "We're back, test 2 seems to work.\n"));
69 /* schedule an event in 9s */
70 ev
= sm_seteventm(9000, ev1
, 2);
73 /* clear the event before it can fire */
76 DBG_OUT(fprintf(stdout
, "We're back, test 3 seems to work.\n"));
78 /* schedule an event in 1s */
80 ev
= sm_seteventm(1000, evcheck
, 3);
87 DBG_OUT(fprintf(stdout
, "We're back, test 4 seems to work.\n"));