2 * Copyright (c) 2001-2002 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.11 2002/04/25 01:50:25 ca Exp $")
17 # include <sys/wait.h>
19 # include <sys/time.h>
20 #endif /* SM_CONF_SETITIMER */
43 /* define as x if you want debug output */
53 sm_test_begin(argc, argv, "test event handling");
54 fprintf(stdout, "This test may hang. If there is no output within twelve seconds, abort it\nand recompile with -DSM_CONF_SETITIMER=%d\n",
55 SM_CONF_SETITIMER == 0 ? 1 : 0);
58 DBG_OUT(fprintf(stdout, "We're back, test 1 seems to work.\n"));
59 ev = sm_seteventm(1000, ev1, 1);
62 DBG_OUT(fprintf(stdout, "We're back, test 2 seems to work.\n"));
64 /* schedule an event in 9s */
65 ev = sm_seteventm(9000, ev1, 2);
68 /* clear the event before it can fire */
71 DBG_OUT(fprintf(stdout, "We're back, test 3 seems to work.\n"));
73 /* schedule an event in 1s */
75 ev = sm_seteventm(1000, evcheck, 3);
82 DBG_OUT(fprintf(stdout, "We're back, test 4 seems to work.\n"));