/* Returns 0 if current has the requested access, error code otherwise  */
static int smack_msg_queue_msgctl(struct msg_queue *msq, int cmd)
/* Returns 0 if current has the requested access, error code otherwise  */
static int smack_msg_queue_msgctl(struct msg_queue *msq, int cmd)
{
	int may;
	switch (cmd) {
	case IPC_STAT:
	case MSG_STAT:
		may = MAY_READ;
		break;
	case IPC_SET:
	case IPC_RMID:
		may = MAY_READWRITE;
		break;
	case IPC_INFO:
	case MSG_INFO:
		return 0;
	default:
		return -EINVAL;
	}
	return smk_curacc_msq(msq, may);
}