You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
3.3 KiB
106 lines
3.3 KiB
Index: makedefs |
|
--- makedefs.orig 2019-02-11 00:11:21.000000000 +0100 |
|
+++ makedefs 2019-02-28 09:04:04.516504000 +0100 |
|
@@ -298,6 +298,15 @@ |
|
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} |
|
: ${PLUGIN_LD="${CC} -shared"} |
|
;; |
|
+ FreeBSD.12*) SYSTYPE=FREEBSD12 |
|
+ : ${CC=cc} |
|
+ : ${SHLIB_SUFFIX=.so} |
|
+ : ${SHLIB_CFLAGS=-fPIC} |
|
+ : ${SHLIB_LD="${CC} -shared"' -Wl,-soname,${LIB}'} |
|
+ : ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'} |
|
+ : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} |
|
+ : ${PLUGIN_LD="${CC} -shared"} |
|
+ ;; |
|
DragonFly.*) SYSTYPE=DRAGONFLY |
|
;; |
|
OpenBSD.2*) SYSTYPE=OPENBSD2 |
|
Index: src/util/file_limit.c |
|
--- src/util/file_limit.c.orig 2003-10-22 20:48:36.000000000 +0200 |
|
+++ src/util/file_limit.c 2019-02-28 09:04:04.516644000 +0100 |
|
@@ -80,12 +80,21 @@ |
|
void set_file_limit(off_t limit) |
|
{ |
|
#ifdef USE_ULIMIT |
|
+#ifdef USE_SOFTLIMITONLY |
|
+#error "USE_ULIMIT and USE_SOFTLIMITONLY are mutual exclusive" |
|
+#endif |
|
if (ulimit(UL_SETFSIZE, limit / ULIMIT_BLOCK_SIZE) < 0) |
|
msg_fatal("ulimit: %m"); |
|
#else |
|
struct rlimit rlim; |
|
|
|
+#ifdef USE_SOFTLIMITONLY |
|
+ if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) |
|
+ rlim.rlim_max = RLIM_INFINITY; |
|
+ rlim.rlim_cur = limit; |
|
+#else |
|
rlim.rlim_cur = rlim.rlim_max = limit; |
|
+#endif |
|
if (setrlimit(RLIMIT_FSIZE, &rlim) < 0) |
|
msg_fatal("setrlimit: %m"); |
|
#ifdef SIGXFSZ |
|
Index: src/util/msg_syslog.c |
|
--- src/util/msg_syslog.c.orig 2019-01-29 23:24:42.000000000 +0100 |
|
+++ src/util/msg_syslog.c 2019-02-28 09:04:04.516791000 +0100 |
|
@@ -63,6 +63,11 @@ |
|
#include <syslog.h> |
|
#include <string.h> |
|
#include <time.h> |
|
+#ifdef USE_SOFTLIMITONLY |
|
+#include <sys/time.h> |
|
+#include <sys/resource.h> |
|
+#include <signal.h> |
|
+#endif |
|
|
|
/* Application-specific. */ |
|
|
|
@@ -159,6 +164,9 @@ |
|
|
|
static void msg_syslog_print(int level, const char *text) |
|
{ |
|
+#ifdef USE_SOFTLIMITONLY |
|
+ struct rlimit save, rlim; |
|
+#endif |
|
static int log_level[] = { |
|
LOG_INFO, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_CRIT, |
|
}; |
|
@@ -172,6 +180,15 @@ |
|
if (level < 0 || level >= (int) (sizeof(log_level) / sizeof(log_level[0]))) |
|
msg_panic("msg_syslog_print: invalid severity level: %d", level); |
|
|
|
+#ifdef USE_SOFTLIMITONLY |
|
+ if (getrlimit(RLIMIT_FSIZE, &save) < 0) { |
|
+ save.rlim_cur = RLIM_INFINITY; |
|
+ save.rlim_max = RLIM_INFINITY; |
|
+ } |
|
+ rlim.rlim_cur = save.rlim_max; |
|
+ rlim.rlim_max = save.rlim_max; |
|
+ (void)setrlimit(RLIMIT_FSIZE, &rlim); |
|
+#endif |
|
if (level == MSG_INFO) { |
|
syslog(msg_syslog_facility | log_level[level], "%.*s", |
|
(int) MSG_SYSLOG_RECLEN, text); |
|
@@ -179,6 +196,9 @@ |
|
syslog(msg_syslog_facility | log_level[level], "%s: %.*s", |
|
severity_name[level], (int) MSG_SYSLOG_RECLEN, text); |
|
} |
|
+#ifdef USE_SOFTLIMITONLY |
|
+ (void)setrlimit(RLIMIT_FSIZE, &save); |
|
+#endif |
|
} |
|
|
|
/* msg_syslog_init - initialize */ |
|
Index: src/util/sys_defs.h |
|
--- src/util/sys_defs.h.orig 2019-02-28 09:04:04.517140000 +0100 |
|
+++ src/util/sys_defs.h 2019-02-28 09:05:41.830662000 +0100 |
|
@@ -31,6 +31,7 @@ |
|
|| defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ |
|
|| defined(FREEBSD8) || defined(FREEBSD9) || defined(FREEBSD10) \ |
|
|| defined(FREEBSD11) \ |
|
+ || defined(FREEBSD12) \ |
|
|| defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ |
|
|| defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ |
|
|| defined(OPENBSD5) || defined(OPENBSD6) \
|
|
|