003 File Manager
Current Path:
/usr/src/contrib/ntp/libntp
usr
/
src
/
contrib
/
ntp
/
libntp
/
📁
..
📄
Makefile.am
(3.27 KB)
📄
Makefile.in
(105.83 KB)
📄
README
(272 B)
📄
a_md5encrypt.c
(6.76 KB)
📄
adjtime.c
(10.29 KB)
📄
adjtimex.c
(334 B)
📄
atoint.c
(801 B)
📄
atolfp.c
(1.88 KB)
📄
atouint.c
(885 B)
📄
audio.c
(13.09 KB)
📄
authkeys.c
(19.92 KB)
📄
authreadkeys.c
(9.06 KB)
📄
authusekey.c
(748 B)
📄
bsd_strerror.c
(1.35 KB)
📄
buftvtots.c
(643 B)
📄
caljulian.c
(891 B)
📄
caltontp.c
(2.25 KB)
📄
calyearstart.c
(2.1 KB)
📄
clocktime.c
(4.49 KB)
📄
clocktypes.c
(3.69 KB)
📄
decodenetnum.c
(3.93 KB)
📄
dofptoa.c
(2.19 KB)
📄
dolfptoa.c
(3.14 KB)
📄
emalloc.c
(3.4 KB)
📄
findconfig.c
(1.46 KB)
📄
getopt.c
(2.21 KB)
📄
hextoint.c
(673 B)
📄
hextolfp.c
(1.35 KB)
📄
humandate.c
(1.1 KB)
📄
icom.c
(4.22 KB)
📄
iosignal.c
(12.27 KB)
📄
is_ip_address.c
(2.02 KB)
📄
lib_strbuf.c
(633 B)
📄
libssl_compat.c
(6.13 KB)
📄
machines.c
(13.05 KB)
📄
mktime.c
(8.29 KB)
📄
modetoa.c
(507 B)
📄
mstolfp.c
(2.01 KB)
📄
msyslog.c
(12.67 KB)
📄
netof.c
(1.17 KB)
📄
ntp_calendar.c
(58.49 KB)
📄
ntp_calgps.c
(15.73 KB)
📄
ntp_crypto_rnd.c
(2.11 KB)
📄
ntp_intres.c
(28.64 KB)
📄
ntp_libopts.c
(1.27 KB)
📄
ntp_lineedit.c
(3.88 KB)
📄
ntp_random.c
(17.63 KB)
📄
ntp_rfc2553.c
(14.85 KB)
📄
ntp_worker.c
(7.21 KB)
📄
numtoa.c
(963 B)
📄
numtohost.c
(908 B)
📄
octtoint.c
(578 B)
📄
prettydate.c
(5.53 KB)
📄
recvbuff.c
(7.3 KB)
📄
refidsmear.c
(1.05 KB)
📄
refnumtoa.c
(673 B)
📄
snprintf.c
(52.56 KB)
📄
socket.c
(4.88 KB)
📄
socktoa.c
(2.88 KB)
📄
socktohost.c
(2.54 KB)
📄
ssl_init.c
(5.09 KB)
📄
statestr.c
(11.4 KB)
📄
strdup.c
(854 B)
📄
strl_obsd.c
(3.65 KB)
📄
syssignal.c
(2.69 KB)
📄
systime.c
(17.51 KB)
📄
systime_s.c
(33 B)
📄
timespecops.c
(4.27 KB)
📄
timetoa.c
(2.75 KB)
📄
timevalops.c
(12.97 KB)
📄
timexsup.c
(1.17 KB)
📄
uglydate.c
(958 B)
📄
vint64ops.c
(5.1 KB)
📄
work_fork.c
(12.73 KB)
📄
work_thread.c
(22.88 KB)
📄
xsbprintf.c
(2.06 KB)
📄
ymd2yd.c
(582 B)
Editing: emalloc.c
/* * emalloc - return new memory obtained from the system. Belch if none. */ #include <config.h> #include "ntp_types.h" #include "ntp_malloc.h" #include "ntp_syslog.h" #include "ntp_stdlib.h" /* * When using the debug MS CRT allocator, each allocation stores the * callsite __FILE__ and __LINE__, which is then displayed at process * termination, to track down leaks. We don't want all of our * allocations to show up as coming from emalloc.c, so we preserve the * original callsite's source file and line using macros which pass * __FILE__ and __LINE__ as parameters to these routines. * Other debug malloc implementations can be used by defining * EREALLOC_IMPL() as ports/winnt/include/config.h does. */ void * ereallocz( void * ptr, size_t newsz, size_t priorsz, int zero_init #ifdef EREALLOC_CALLSITE /* ntp_malloc.h */ , const char * file, int line #endif ) { char * mem; size_t allocsz; if (0 == newsz) allocsz = 1; else allocsz = newsz; mem = EREALLOC_IMPL(ptr, allocsz, file, line); if (NULL == mem) { msyslog_term = TRUE; #ifndef EREALLOC_CALLSITE msyslog(LOG_ERR, "fatal out of memory (%lu bytes)", (u_long)newsz); #else msyslog(LOG_ERR, "fatal out of memory %s line %d (%lu bytes)", file, line, (u_long)newsz); #endif exit(1); } if (zero_init && newsz > priorsz) zero_mem(mem + priorsz, newsz - priorsz); return mem; } /* oreallocarray.c is licensed under the following: * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW */ #define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) void * oreallocarrayxz( void *optr, size_t nmemb, size_t size, size_t extra #ifdef EREALLOC_CALLSITE /* ntp_malloc.h */ , const char * file, int line #endif ) { if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && nmemb > 0 && SIZE_MAX / nmemb < size) { #ifndef EREALLOC_CALLSITE msyslog(LOG_ERR, "fatal allocation size overflow"); #else msyslog(LOG_ERR, "fatal allocation size overflow %s line %d", file, line); #endif exit(1); } #ifndef EREALLOC_CALLSITE return ereallocz(optr, extra + (size * nmemb), 0, TRUE); #else return ereallocz(optr, extra + (size * nmemb), 0, TRUE, file, line); #endif } char * estrdup_impl( const char * str #ifdef EREALLOC_CALLSITE , const char * file, int line #endif ) { char * copy; size_t bytes; bytes = strlen(str) + 1; copy = ereallocz(NULL, bytes, 0, FALSE #ifdef EREALLOC_CALLSITE , file, line #endif ); memcpy(copy, str, bytes); return copy; } #if 0 #ifndef EREALLOC_CALLSITE void * emalloc(size_t newsz) { return ereallocz(NULL, newsz, 0, FALSE); } #endif #endif
Upload File
Create Folder