aboutsummaryrefslogtreecommitdiffstats
path: root/util/secmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/secmem.c')
-rw-r--r--util/secmem.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/util/secmem.c b/util/secmem.c
index 3f253d6db..54836cbcf 100644
--- a/util/secmem.c
+++ b/util/secmem.c
@@ -58,7 +58,7 @@ struct memblock_struct {
static void *pool;
static volatile int pool_okay; /* may be checked in an atexit function */
-static int pool_is_mmapped;
+static volatile int pool_is_mmapped;
static size_t poolsize; /* allocated length */
static size_t poollen; /* used length */
static MEMBLOCK *unused_blocks;
@@ -97,8 +97,11 @@ lock_pool( void *p, size_t n )
#ifdef EAGAIN /* OpenBSD returns this */
&& errno != EAGAIN
#endif
+ #ifdef ENOSYS /* Some SCOs return this (function not implemented) */
+ && errno != ENOSYS
+ #endif
)
- log_error("can�t lock memory: %s\n", strerror(err));
+ log_error("can't lock memory: %s\n", strerror(err));
show_warning = 1;
}
@@ -134,11 +137,20 @@ lock_pool( void *p, size_t n )
#ifdef EAGAIN /* OpenBSD returns this */
&& errno != EAGAIN
#endif
+ #ifdef ENOSYS /* Some SCOs return this (function not implemented) */
+ && errno != ENOSYS
+ #endif
)
- log_error("can�t lock memory: %s\n", strerror(err));
+ log_error("can't lock memory: %s\n", strerror(err));
show_warning = 1;
}
+ #elif defined ( __QNX__ )
+ /* QNX does not page at all, so the whole secure memory stuff does
+ * not make much sense. However it is still of use because it
+ * wipes out the memory on a free().
+ * Therefore it is sufficient to suppress the warning
+ */
#else
log_info("Please note that you don't have secure memory on this system\n");
#endif
@@ -374,7 +386,7 @@ m_is_secure( const void *p )
/****************
* Warning: This code might be called by an interrupt handler
- * and frankly, thre should really be such a handler,
+ * and frankly, there should really be such a handler,
* to make sure that the memory is wiped out.
* We hope that the OS wipes out mlocked memory after
* receiving a SIGKILL - it really should do so, otherwise