View | Details | Raw Unified | Return to bug 241421 | Differences between
and this patch

Collapse All | Expand All

(-)b/contrib/ntp/ntpd/ntpd.c (-1 / +16 lines)
Lines 790-795 ntpdmain( Link Here
790
	int		fd;
790
	int		fd;
791
	int		zero;
791
	int		zero;
792
# endif
792
# endif
793
	int		aslr = 0;
794
	int		aslr_len = sizeof(aslr);
795
#ifdef __LP64__
796
	char		*aslr_var = "kern.elf64.aslr.enable";
797
#else
798
	char		*aslr_var = "kern.elf32.aslr.enable";
799
#endif
793
800
794
# ifdef NEED_PTHREAD_WARMUP
801
# ifdef NEED_PTHREAD_WARMUP
795
	my_pthread_warmup();
802
	my_pthread_warmup();
Lines 998-1004 ntpdmain( Link Here
998
	/* Setup stack size in preparation for locking pages in memory. */
1005
	/* Setup stack size in preparation for locking pages in memory. */
999
# if defined(HAVE_MLOCKALL)
1006
# if defined(HAVE_MLOCKALL)
1000
#  ifdef HAVE_SETRLIMIT
1007
#  ifdef HAVE_SETRLIMIT
1001
	ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
1008
	
1009
	if ((rc = sysctlbyname(aslr_var, aslr, &aslr_len, NULL, 0)) != 0))
1010
		msyslog(LOG_ERR,
1011
			"sysctlbyname: %s: %s",
1012
			aslr_var,
1013
			strerror(rc));
1014
1015
	if (aslr == 0)
1016
		ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k");
1002
#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1
1017
#   if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1
1003
	/*
1018
	/*
1004
	 * The default RLIMIT_MEMLOCK is very low on Linux systems.
1019
	 * The default RLIMIT_MEMLOCK is very low on Linux systems.

Return to bug 241421