All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Bernhard Walle <bernhard.walle@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Sleep return value
Date: Sat, 09 Sep 2006 12:28:02 +0200	[thread overview]
Message-ID: <45029732.8030008@domain.hid> (raw)
In-Reply-To: <20060909010745.GD1192@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]

Bernhard Walle wrote:
> Hello,
> 
> sorry for the late reply.
> 
> * Jan Kiszka <jan.kiszka@domain.hid> [2006-09-06 15:52]:
>> Bernhard Walle wrote:
>>> Hello,
>>>
>>> ,----
>>> | int rtdm_task_sleep (uint64_t delay);
>>> | int rtdm_task_sleep_until (uint64_t wakeup_time);
>>> `----
>>>
>>> wouldn't it make sense to return 0 on success and in error case the
>>> number of nanoseconds that are remaining to the originally requested
>>> sleep period just as the Linux sleeping function behave?
>> Do you have a use-case for this? Would you consider this as the normal
>> scenario?
> 
> I must confess that I don't have one. I just compared the Linux API
> with the RTDM API for that use case. I'll dig into sources of Linux
> drivers and see if there are reasonable use cases. But this may take
> some days as I'm a bit busy now.
> 
>> Also note that changing the return type would take away to possibility
>> to pass the error code.
> 
> Not really. You can
> 
>   < 0 : error code (in this case -EPERM)
>   == 0 : success
>   > 0 : remaining time
> 
> Or simple
> 
>   int rtdm_task_sleep(uint64_t delay, uint64_t *time_left);
> 
> That would make it more compatible with the current API since the user
> can simply replace
> 
>   ret = rtdm_task_sleep(delay);
> 
> with 
> 
>   ret = rtdm_task_sleep(delay, NULL);
> 
>>> Of course that would introduce an incompatibility to current code.
>> Given a reasonably urging use-case or brokenness of the original
>> interface, API revisions may actually take place in RTDM (see the
>> history). But they will surely not happen without thorough
>> considerations of pros and cons. :)
> 
> Because the missing information can be easily gathered from outside,
> it would be only worth changing if you plan some other changes in
> these functions so that this can be done in one in one step.
> 

You exactly hit the point. :->

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

  reply	other threads:[~2006-09-09 10:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06 13:41 [Xenomai-core] Sleep return value Bernhard Walle
2006-09-06 13:52 ` Jan Kiszka
2006-09-09  1:07   ` Bernhard Walle
2006-09-09 10:28     ` Jan Kiszka [this message]
2006-09-09 10:58       ` Bernhard Walle

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=45029732.8030008@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=bernhard.walle@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.