003 File Manager
Current Path:
/usr/src/contrib/sendmail/src
usr
/
src
/
contrib
/
sendmail
/
src
/
📁
..
📄
Makefile
(347 B)
📄
Makefile.m4
(4.37 KB)
📄
README
(81.76 KB)
📄
SECURITY
(7.5 KB)
📄
TRACEFLAGS
(3.1 KB)
📄
TUNING
(10.22 KB)
📄
alias.c
(22.22 KB)
📄
aliases
(1.43 KB)
📄
aliases.5
(3.15 KB)
📄
arpadate.c
(4.01 KB)
📄
bf.c
(17.58 KB)
📄
bf.h
(1007 B)
📄
collect.c
(24.45 KB)
📄
conf.c
(152.23 KB)
📄
conf.h
(7.13 KB)
📄
control.c
(8.91 KB)
📄
convtime.c
(3.56 KB)
📄
daemon.c
(99.13 KB)
📄
daemon.h
(1.46 KB)
📄
deliver.c
(151.7 KB)
📄
domain.c
(36.74 KB)
📄
envelope.c
(31.71 KB)
📄
err.c
(26.52 KB)
📄
headers.c
(50.32 KB)
📄
helpfile
(5.53 KB)
📄
macro.c
(14.86 KB)
📄
mailq.1
(3.46 KB)
📄
main.c
(108.07 KB)
📄
map.c
(177.38 KB)
📄
map.h
(3.81 KB)
📄
mci.c
(35.37 KB)
📄
milter.c
(103.43 KB)
📄
mime.c
(30.7 KB)
📄
newaliases.1
(1.27 KB)
📄
parseaddr.c
(80.3 KB)
📄
queue.c
(206.08 KB)
📄
ratectrl.c
(13.01 KB)
📄
ratectrl.h
(3.94 KB)
📄
readcf.c
(119.73 KB)
📄
recipient.c
(48.48 KB)
📄
sasl.c
(5.7 KB)
📄
savemail.c
(43.3 KB)
📄
sendmail.8
(17.31 KB)
📄
sendmail.h
(103.76 KB)
📄
sfsasl.c
(21.01 KB)
📄
sfsasl.h
(644 B)
📄
shmticklib.c
(1.51 KB)
📄
sm_resolve.c
(33.24 KB)
📄
sm_resolve.h
(5.25 KB)
📄
srvrsmtp.c
(133.04 KB)
📄
stab.c
(8.73 KB)
📄
stats.c
(4.17 KB)
📄
statusd_shm.h
(945 B)
📄
sysexits.c
(3.61 KB)
📄
timers.c
(4.29 KB)
📄
timers.h
(800 B)
📄
tls.c
(62.13 KB)
📄
tls.h
(8.1 KB)
📄
tlsh.c
(4.73 KB)
📄
trace.c
(4.25 KB)
📄
udb.c
(28.98 KB)
📄
usersmtp.c
(76.98 KB)
📄
util.c
(56.62 KB)
📄
version.c
(539 B)
Editing: timers.c
/* * Copyright (c) 1999-2001 Proofpoint, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * * Contributed by Exactis.com, Inc. * */ #include <sm/gen.h> SM_RCSID("@(#)$Id: timers.c,v 8.27 2013-11-22 20:51:57 ca Exp $") #if _FFR_TIMERS # include <sys/types.h> # include <sm/time.h> # include "sendmail.h" # include <sys/resource.h> /* Must be after sendmail.h for NCR MP-RAS */ static TIMER BaseTimer; /* current baseline */ static int NTimers; /* current pointer into stack */ static TIMER *TimerStack[MAXTIMERSTACK]; static void # ifdef __STDC__ warntimer(const char *msg, ...) # else /* __STDC__ */ warntimer(msg, va_alist) const char *msg; va_dcl # endif /* __STDC__ */ { char buf[MAXLINE]; SM_VA_LOCAL_DECL # if 0 if (!tTd(98, 30)) return; # endif SM_VA_START(ap, msg); (void) sm_vsnprintf(buf, sizeof(buf), msg, ap); SM_VA_END(ap); sm_syslog(LOG_NOTICE, CurEnv->e_id, "%s; e_timers=0x%lx", buf, (unsigned long) &CurEnv->e_timers); } static void zerotimer(ptimer) TIMER *ptimer; { memset(ptimer, '\0', sizeof(*ptimer)); } static void addtimer(ta, tb) TIMER *ta; TIMER *tb; { tb->ti_wall_sec += ta->ti_wall_sec; tb->ti_wall_usec += ta->ti_wall_usec; if (tb->ti_wall_usec > 1000000) { tb->ti_wall_sec++; tb->ti_wall_usec -= 1000000; } tb->ti_cpu_sec += ta->ti_cpu_sec; tb->ti_cpu_usec += ta->ti_cpu_usec; if (tb->ti_cpu_usec > 1000000) { tb->ti_cpu_sec++; tb->ti_cpu_usec -= 1000000; } } static void subtimer(ta, tb) TIMER *ta; TIMER *tb; { tb->ti_wall_sec -= ta->ti_wall_sec; tb->ti_wall_usec -= ta->ti_wall_usec; if (tb->ti_wall_usec < 0) { tb->ti_wall_sec--; tb->ti_wall_usec += 1000000; } tb->ti_cpu_sec -= ta->ti_cpu_sec; tb->ti_cpu_usec -= ta->ti_cpu_usec; if (tb->ti_cpu_usec < 0) { tb->ti_cpu_sec--; tb->ti_cpu_usec += 1000000; } } static int getcurtimer(ptimer) TIMER *ptimer; { struct rusage ru; struct timeval now; if (getrusage(RUSAGE_SELF, &ru) < 0 || gettimeofday(&now, NULL) < 0) return -1; ptimer->ti_wall_sec = now.tv_sec; ptimer->ti_wall_usec = now.tv_usec; ptimer->ti_cpu_sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec; ptimer->ti_cpu_usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec; if (ptimer->ti_cpu_usec > 1000000) { ptimer->ti_cpu_sec++; ptimer->ti_cpu_usec -= 1000000; } return 0; } static void getinctimer(ptimer) TIMER *ptimer; { TIMER cur; if (getcurtimer(&cur) < 0) { zerotimer(ptimer); return; } if (BaseTimer.ti_wall_sec == 0) { /* first call */ memset(ptimer, '\0', sizeof(*ptimer)); } else { *ptimer = cur; subtimer(&BaseTimer, ptimer); } BaseTimer = cur; } void flushtimers() { NTimers = 0; (void) getcurtimer(&BaseTimer); } void pushtimer(ptimer) TIMER *ptimer; { int i; int save_errno = errno; TIMER incr; /* find how much time has changed since last call */ getinctimer(&incr); /* add that into the old timers */ i = NTimers; if (i > MAXTIMERSTACK) i = MAXTIMERSTACK; while (--i >= 0) { addtimer(&incr, TimerStack[i]); if (TimerStack[i] == ptimer) { warntimer("Timer@0x%lx already on stack, index=%d, NTimers=%d", (unsigned long) ptimer, i, NTimers); errno = save_errno; return; } } errno = save_errno; /* handle stack overflow */ if (NTimers >= MAXTIMERSTACK) return; /* now add the timer to the stack */ TimerStack[NTimers++] = ptimer; } void poptimer(ptimer) TIMER *ptimer; { int i; int save_errno = errno; TIMER incr; /* find how much time has changed since last call */ getinctimer(&incr); /* add that into the old timers */ i = NTimers; if (i > MAXTIMERSTACK) i = MAXTIMERSTACK; while (--i >= 0) addtimer(&incr, TimerStack[i]); /* pop back to this timer */ for (i = 0; i < NTimers; i++) { if (TimerStack[i] == ptimer) break; } if (i != NTimers - 1) warntimer("poptimer: odd pop (timer=0x%lx, index=%d, NTimers=%d)", (unsigned long) ptimer, i, NTimers); NTimers = i; /* clean up and return */ errno = save_errno; } char * strtimer(ptimer) TIMER *ptimer; { static char buf[40]; (void) sm_snprintf(buf, sizeof(buf), "%ld.%06ldr/%ld.%06ldc", ptimer->ti_wall_sec, ptimer->ti_wall_usec, ptimer->ti_cpu_sec, ptimer->ti_cpu_usec); return buf; } #endif /* _FFR_TIMERS */
Upload File
Create Folder