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.
11 SM_RCSID("@(#)$Id: t-event.c,v 1.13 2005/06/14 23:07:20 ca Exp $")
17 # include <sys/wait.h>
20 #endif /* SM_CONF_SETITIMER */
25 static void evcheck __P((int));
26 static void ev1 __P((int));
46 /* define as x if you want debug output */
56 sm_test_begin(argc, argv, "test event handling");
57 fprintf(stdout, "This test may hang. If there is no output within twelve seconds, abort it\nand recompile with -DSM_CONF_SETITIMER=%d\n",
58 SM_CONF_SETITIMER == 0 ? 1 : 0);
61 DBG_OUT(fprintf(stdout, "We're back, test 1 seems to work.\n"));
62 ev = sm_seteventm(1000, ev1, 1);
65 DBG_OUT(fprintf(stdout, "We're back, test 2 seems to work.\n"));
67 /* schedule an event in 9s */
68 ev = sm_seteventm(9000, ev1, 2);
71 /* clear the event before it can fire */
74 DBG_OUT(fprintf(stdout, "We're back, test 3 seems to work.\n"));
76 /* schedule an event in 1s */
78 ev = sm_seteventm(1000, evcheck, 3);
85 DBG_OUT(fprintf(stdout, "We're back, test 4 seems to work.\n"));