X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/c5e4c2cfc092317c1e3ceb0f654f880f6a8573f4..9801c8cd41fc8bd052189b1d05d275133ad4d2bc:/util.c diff --git a/util.c b/util.c index 343e956..8ba99a0 100644 --- a/util.c +++ b/util.c @@ -1,11 +1,14 @@ /* Misc util functions */ +char const *cvs_id_util = "$Id: util.c,v 1.3 2004-09-02 04:18:07 fred_nerk Exp $"; + #include "l2tpns.h" #include #include #include #include +#include char *inet_toa(unsigned long addr) { @@ -14,3 +17,13 @@ char *inet_toa(unsigned long addr) return inet_ntoa(in); } +void *shared_malloc(unsigned int size) +{ + void * p; + p = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, 0, 0); + + if (p == MAP_FAILED) + p = NULL; + + return p; +}