X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=mm%2Fmlock.c;h=4d3fea267e0dabde457091a2618a0efe8dba864d;hb=dda034bcb51a0a28318046d74d664e0fc5f7d1d4;hp=3446b7ef731e6c419cc0cf2656829eeca6fea5a7;hpb=21b4e736922f546e0f1aa7b9d6c442f309a2444a;p=linux-2.6-omap-h63xx.git diff --git a/mm/mlock.c b/mm/mlock.c index 3446b7ef731..4d3fea267e0 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -10,7 +10,18 @@ #include #include #include +#include +#include +int can_do_mlock(void) +{ + if (capable(CAP_IPC_LOCK)) + return 1; + if (current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur != 0) + return 1; + return 0; +} +EXPORT_SYMBOL(can_do_mlock); static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev, unsigned long start, unsigned long end, unsigned int newflags)