aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2009-12-19 19:35:53 +0000
committerAttilio Rao <attilio@FreeBSD.org>2009-12-19 19:35:53 +0000
commitacd3c01512155cf09c7cad3d9527d3e5fa9a11a6 (patch)
tree3cea1d4fa212cfbc4b3fec355e0bd05c96969c9a /crypto
parentebc5dece54faced5f8546348e2ef8a1f7cfe86f9 (diff)
Notes
Diffstat (limited to 'crypto')
-rw-r--r--crypto/openssh/sshd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c
index 75ab86ccf12a..1d44fc8d9b9f 100644
--- a/crypto/openssh/sshd.c
+++ b/crypto/openssh/sshd.c
@@ -47,6 +47,7 @@ __RCSID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ioctl.h>
+#include <sys/mman.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
@@ -1292,6 +1293,10 @@ main(int ac, char **av)
/* Initialize configuration options to their default values. */
initialize_server_options(&options);
+ /* Avoid killing the process in high-pressure swapping environments. */
+ if (madvise(NULL, 0, MADV_PROTECT) != 0)
+ debug("madvise(): %.200s", strerror(errno));
+
/* Parse command-line arguments. */
while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:C:dDeiqrtQRT46")) != -1) {
switch (opt) {