Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 3 Dec 2002 10:05:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 3 Dec 2002 10:05:19 -0500 Received: from phoenix.mvhi.com ([195.224.96.167]:11539 "EHLO phoenix.infradead.org") by vger.kernel.org with ESMTP id ; Tue, 3 Dec 2002 10:05:18 -0500 Date: Tue, 3 Dec 2002 15:12:40 +0000 From: Christoph Hellwig To: Krzysztof Benedyczak Cc: linux-kernel@vger.kernel.org, Manfred Spraul Subject: Re: [PATCH][RESEND] POSIX message queues, 2.5.50 Message-ID: <20021203151238.A14315@infradead.org> Mail-Followup-To: Christoph Hellwig , Krzysztof Benedyczak , linux-kernel@vger.kernel.org, Manfred Spraul References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from golbi@mat.uni.torun.pl on Tue, Dec 03, 2002 at 03:56:58PM +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1503 Lines: 48 On Tue, Dec 03, 2002 at 03:56:58PM +0100, Krzysztof Benedyczak wrote: > +#ifndef _LINUX_MQUEUE_H > +#define _LINUX_MQUEUE_H > + > +#include I don't think you need this.. > +struct mq_attr { > + long mq_flags; /* message queue flags */ > + long mq_maxmsg; /* maximum number of messages */ > + long mq_msgsize; /* maximum message size */ > + long mq_curmsgs; /* number of messages currently queued */ Please don't use longs as ioctl arguments, better s32. (and why can't this be unsigned, btw?) > --- linux-2.5.50-org/ipc/mqueue.c Thu Jan 1 01:00:00 1970 > +++ linux-2.5.50-patched/ipc/mqueue.c Mon Dec 2 21:17:28 2002 No copyright statement at all? > + if (*off>=FILENT_SIZE) > + return 0; > + buffer = kmalloc(FILENT_SIZE,GFP_KERNEL); > + if (buffer==NULL) > + return -ENOMEM; > + > + *((long *)buffer) = info->qsize; > + *((pid_t *)(buffer+sizeof(long))) = info->notify_pid; > + *((int *)(buffer+sizeof(long)+sizeof(pid_t))) = > + info->notify.sigev_signo; > + *((int *)(buffer+sizeof(long)+sizeof(pid_t)+sizeof(int))) = > + info->notify.sigev_notify; > + retval = FILENT_SIZE - *off; > + if (copy_to_user(data,buffer+*off,retval)) > + return -EFAULT; > + *off += retval; > + return retval; Where is the buffer freed? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/