From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Henry Bausley <hbausley@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] ENXIO error with large shared memory
Date: Tue, 17 Mar 2009 17:08:11 +0100 [thread overview]
Message-ID: <49BFCAEB.8080007@domain.hid> (raw)
In-Reply-To: <49BFBF48.7080102@domain.hid>
Gilles Chanteperdrix wrote:
> Henry Bausley wrote:
>> ftruncate returns 0
>
> Ok. I think I understood what the problem is, I will try to send a patch
> tonight.
>
The following not very subtil patch seems to fix the issue:
Index: include/nucleus/heap.h
===================================================================
--- include/nucleus/heap.h (revision 4692)
+++ include/nucleus/heap.h (working copy)
@@ -156,6 +156,7 @@
static inline size_t xnheap_rounded_size(size_t hsize, size_t psize)
{
+ size_t rounded_size;
/*
* Account for the minimum heap size (i.e. 2 * page size) plus
* overhead so that the actual heap space is large enough to
@@ -167,7 +168,10 @@
if (hsize < 2 * psize)
hsize = 2 * psize;
hsize += xnheap_overhead(hsize, psize);
- return xnheap_align(hsize, psize);
+ rounded_size = xnheap_align(hsize, psize);
+ while (rounded_size - xnheap_overhead(rounded_size, psize) < hsize)
+ rounded_size += psize;
+ return rounded_size;
}
#ifdef __cplusplus
--
Gilles.
next prev parent reply other threads:[~2009-03-17 16:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 22:08 [Xenomai-help] ENXIO error with large shared memory Henry Bausley
2009-03-16 21:31 ` Gilles Chanteperdrix
2009-03-17 0:49 ` Henry Bausley
2009-03-17 15:18 ` Gilles Chanteperdrix
2009-03-17 16:08 ` Gilles Chanteperdrix [this message]
2009-03-17 19:16 ` Henry Bausley
2009-03-17 18:21 ` Gilles Chanteperdrix
2009-08-13 23:12 ` Henry Bausley
2009-03-17 18:23 ` Gilles Chanteperdrix
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=49BFCAEB.8080007@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=hbausley@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.