From 90a520160bb80d062719cf7671e67b5b6573c709 Mon Sep 17 00:00:00 2001 From: "roberto@localhost.localdomain" Date: Mon, 23 Nov 2009 09:48:15 +0100 Subject: [PATCH] support for unbit syscall 357 and uidsec_struct --- uwsgi.c | 13 +++++++++++++ uwsgi.h | 1 + 2 files changed, 14 insertions(+) diff --git a/uwsgi.c b/uwsgi.c index d66ed92a..ad9dc292 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -584,6 +584,10 @@ int main(int argc, char *argv[], char *envp[]) { struct rlimit rl ; #endif +#ifdef UNBIT + struct uidsec_struct us; +#endif + int socket_type; socklen_t socket_type_len; @@ -1671,6 +1675,15 @@ clean: goodbye_cruel_world(); } +#ifdef UNBIT + if (syscall(357,&us,0) > 0) { + if (us.memory_errors > 0) { + fprintf(stderr,"Unbit Kernel found a memory allocation error for process %d.\n", mypid); + goodbye_cruel_world(); + } + } +#endif + } if (manage_next_request == 0) { diff --git a/uwsgi.h b/uwsgi.h index 495d06f7..5d7eeb98 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -31,6 +31,7 @@ #ifdef UNBIT #undef _XOPEN_SOURCE +#include "unbit.h" #endif #ifdef _POSIX_C_SOURCE