Re: [PATCH] per-user signal pending and message queue limits

From: Manfred Spraul
Date: Tue Apr 27 2004 - 13:28:45 EST


Marcelo Tosatti wrote:

@@ -849,6 +892,10 @@ asmlinkage long sys_mq_timedsend(mqd_t m
goto out_fput;
}

+ if(current->user->msg_queues + msg_len
+ >= current->rlim[RLIMIT_MSGQUEUE].rlim_cur)
+ goto out_fput;
+

I don't like that:
The opengroup manpage doesn't mention out of memory as an error code for mq_send(). I'd prefer if mq_open would check that ->mq_maxmsg*->mq_msgsize is below the limit and reserve the memory, without further checks at send/receive time.

--
Manfred

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/