--- libaitsess/src/aitsess.c 2008/09/30 20:19:48 1.1.1.1.2.1 +++ libaitsess/src/aitsess.c 2008/10/13 18:22:01 1.1.1.1.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsess.c,v 1.1.1.1.2.1 2008/09/30 20:19:48 misho Exp $ +* $Id: aitsess.c,v 1.1.1.1.2.2 2008/10/13 18:22:01 misho Exp $ * *************************************************************************/ #include "global.h" @@ -395,6 +395,19 @@ inline void ipc_detachSession(tagSess * __restrict s) shmdt(s->addr); s->addr = NULL; } +} + +/* + * isAttached() Check for mapped/(attached) shared memory + * @s = Session item + * return: -1 null session item, 0 not attached, 1 attached memory +*/ +inline int isAttached(tagSess * __restrict s) +{ + if (!s) + return -1; + + return (s->addr ? 1 : 0); }