|
Lines 138-154
Link Here
|
| 138 |
# include <seccomp.h> |
138 |
# include <seccomp.h> |
| 139 |
#endif /* LIBSECCOMP and KERN_SECCOMP */ |
139 |
#endif /* LIBSECCOMP and KERN_SECCOMP */ |
| 140 |
|
140 |
|
| 141 |
#ifdef __FreeBSD__ |
|
|
| 142 |
#include <sys/procctl.h> |
| 143 |
#ifndef PROC_STACKGAP_CTL |
| 144 |
/* |
| 145 |
* Even if we compile on an older system we can still run on a newer one. |
| 146 |
*/ |
| 147 |
#define PROC_STACKGAP_CTL 17 |
| 148 |
#define PROC_STACKGAP_DISABLE 0x0002 |
| 149 |
#endif |
| 150 |
#endif |
| 151 |
|
| 152 |
#ifdef HAVE_DNSREGISTRATION |
141 |
#ifdef HAVE_DNSREGISTRATION |
| 153 |
# include <dns_sd.h> |
142 |
# include <dns_sd.h> |
| 154 |
DNSServiceRef mdns; |
143 |
DNSServiceRef mdns; |
|
Lines 413-430
Link Here
|
| 413 |
char *argv[] |
402 |
char *argv[] |
| 414 |
) |
403 |
) |
| 415 |
{ |
404 |
{ |
| 416 |
#ifdef __FreeBSD__ |
|
|
| 417 |
{ |
| 418 |
/* |
| 419 |
* We Must disable ASLR stack gap on FreeBSD to avoid a |
| 420 |
* segfault. See PR/241421 and PR/241960. |
| 421 |
*/ |
| 422 |
int aslr_var = PROC_STACKGAP_DISABLE; |
| 423 |
|
| 424 |
pid_t my_pid = getpid(); |
| 425 |
procctl(P_PID, my_pid, PROC_STACKGAP_CTL, &aslr_var); |
| 426 |
} |
| 427 |
#endif |
| 428 |
return ntpdmain(argc, argv); |
405 |
return ntpdmain(argc, argv); |
| 429 |
} |
406 |
} |
| 430 |
#endif /* !SYS_WINNT */ |
407 |
#endif /* !SYS_WINNT */ |
|
Lines 1022-1028
Link Here
|
| 1022 |
# if defined(HAVE_MLOCKALL) |
999 |
# if defined(HAVE_MLOCKALL) |
| 1023 |
# ifdef HAVE_SETRLIMIT |
1000 |
# ifdef HAVE_SETRLIMIT |
| 1024 |
ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); |
1001 |
ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); |
| 1025 |
# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 |
1002 |
# ifdef RLIMIT_MEMLOCK |
| 1026 |
/* |
1003 |
/* |
| 1027 |
* The default RLIMIT_MEMLOCK is very low on Linux systems. |
1004 |
* The default RLIMIT_MEMLOCK is very low on Linux systems. |
| 1028 |
* Unless we increase this limit malloc calls are likely to |
1005 |
* Unless we increase this limit malloc calls are likely to |