All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Krzysztof Benedyczak <golbi@mat.uni.torun.pl>
Cc: linux-kernel@vger.kernel.org, Manfred Spraul <manfred@colorfullife.com>
Subject: Re: [PATCH][RESEND] POSIX message queues, 2.5.50
Date: Tue, 3 Dec 2002 15:12:40 +0000	[thread overview]
Message-ID: <20021203151238.A14315@infradead.org> (raw)
In-Reply-To: <Pine.GSO.4.40.0212031542100.11660-100000@Juliusz>; from golbi@mat.uni.torun.pl on Tue, Dec 03, 2002 at 03:56:58PM +0100

On Tue, Dec 03, 2002 at 03:56:58PM +0100, Krzysztof Benedyczak wrote:
> +#ifndef _LINUX_MQUEUE_H
> +#define _LINUX_MQUEUE_H
> +
> +#include <linux/init.h>

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?


  reply	other threads:[~2002-12-03 15:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-03 14:56 [PATCH][RESEND] POSIX message queues, 2.5.50 Krzysztof Benedyczak
2002-12-03 15:12 ` Christoph Hellwig [this message]
2002-12-13 13:24   ` Krzysztof Benedyczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021203151238.A14315@infradead.org \
    --to=hch@infradead.org \
    --cc=golbi@mat.uni.torun.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.