mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: bottchen@earthlink.net, linux-kernel@vger.kernel.org
Cc: marcelo@conectiva.com.br, torvalds@transmeta.com
Subject: Re: Sorry to be annoying, but "PATCH for shmdt"
Date: Mon, 10 Dec 2001 23:53:00 GMT	[thread overview]
Message-ID: <UTC200112102353.XAA288298.aeb@cwi.nl> (raw)

    From: <bottchen@earthlink.net>

        Unfortunately the patch I submitted for shmdt has been overlooked.
    It's not a very exciting patch, but it does bring the code into agreement
    with the manpage.  Here is an version of the patch updated for 2.4.16.

Yes, I agree. Referring to POSIX would have been more convincing,
but it is true that shmdt is supposed to return EINVAL when the
memory to be detached is not found.

Andries


    --- linux-2.4.16old/ipc/shm.c   Mon Dec  10 11:53:12 2001
    +++ linux-2.4.16/ipc/shm.c      Mon Dec  10 15:08:51 2001
    @@ -651,16 +651,19 @@
     {
            struct mm_struct *mm = current->mm;
            struct vm_area_struct *shmd, *shmdnext;
    +       int retcode = -EINVAL;

            down_write(&mm->mmap_sem);
            for (shmd = mm->mmap; shmd; shmd = shmdnext) {
                    shmdnext = shmd->vm_next;
                    if (shmd->vm_ops == &shm_vm_ops
    -                   && shmd->vm_start - (shmd->vm_pgoff << PAGE_SHIFT) == (ulong) shmaddr)
    +                   && shmd->vm_start - (shmd->vm_pgoff << PAGE_SHIFT) == (ulong) shmaddr) {
                            do_munmap(mm, shmd->vm_start, shmd->vm_end - shmd->vm_start);
    +                       retcode = 0;
    +               }
            }
            up_write(&mm->mmap_sem);
    -       return 0;
    +       return retcode;
     }

     #ifdef CONFIG_PROC_FS


             reply	other threads:[~2001-12-10 23:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-10 23:53 Andries.Brouwer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-12-10 21:57 bottchen

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=UTC200112102353.XAA288298.aeb@cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=bottchen@earthlink.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®