All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Nathaniel.J.Villaume@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rt_heap_delete in asynchronous context
Date: Mon, 29 May 2006 14:45:36 +0200	[thread overview]
Message-ID: <17530.60656.867991.966403@domain.hid> (raw)
In-Reply-To: <1148860914-13365.00015.03228-smmsdV2.1.4@domain.hid>

Nathaniel J Villaume wrote:
 > Hi, 
 > 
 > I have a simple user-space program (see below) that tries to
 > create a heap. If the heap already exists, then the program tries
 > to delete it. I have no other threads binding to the heap.
 > 
 > I can create, but not delete the heap. The error returned is
 > -EPERM. According to the API manual, this means the call occurred
 > in an asynchronous context. What does this mean, exactly? How
 > should I delete this heap? 
 > 
 > Any advice?

You should not try and delete a heap if you did not succeed in creating
or binding it. The contents of the RT_HEAP object are uninitialized
when rt_heap_create fails, rt_heap_delete call munmap passing the
contents of this uninitialized object, and munmap returns -1 with errno
set to EINVAL. rt_heap_delete should be fixed to return -errno in this
case, but you should bind the heap before deleting it.

-- 


					    Gilles Chanteperdrix.


  reply	other threads:[~2006-05-29 12:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-29  0:01 [Xenomai-help] rt_heap_delete in asynchronous context Nathaniel J Villaume
2006-05-29 12:45 ` Gilles Chanteperdrix [this message]
2006-05-29 18:19   ` Nathaniel J Villaume

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=17530.60656.867991.966403@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Nathaniel.J.Villaume@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.