sleepy_penguin RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: sleepy.penguin@librelist.org
Subject: Re: [sleepy.penguin] [PATCH] Support for broken system without clock_gettime.
Date: Tue, 24 Sep 2013 18:09:01 +0000	[thread overview]
Message-ID: <20130924180901.GA8085@dcvr.yhbt.net> (raw)
In-Reply-To: <1380012947-91938-1-git-send-email-godfat@godfat.org>

Lin Jen-Shin <godfat@godfat.org> wrote:
> Fallback mechanism was copied from clogger:
> 
>     http://clogger.rubyforge.org/
> 
> This would also make sleepy_penguin compiles on Mac OS X,
> which is lacking clock_gettime. All tests passed for me.

Pushed with the following commit addendum:

[ew: fixed indentation
 Note: this project does not and will never officially support
 non-Free OSes, but there are likely other systems without
 clock_gettime but has kqueue (perhaps via libkqueue).]

Signed-off-by: Eric Wong <normalperson@yhbt.net>

> +++ b/ext/sleepy_penguin/missing_clock_gettime.h
> +static int fake_clock_gettime(clockid_t clk_id, struct timespec *res)
> +{
> +  struct timeval tv;
> +  int r = gettimeofday(&tv, NULL);
> +
> +  assert(0 == r && "gettimeofday() broke!?");

I'm not sure why you switched to spaces for indentation.  I just changed
it back to match the original clogger code.
(my preferred C indentation style is based on Linux kernel conventions)


  reply	other threads:[~2013-09-24 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24  8:55 [sleepy.penguin] [PATCH] Support for broken system without clock_gettime Lin Jen-Shin
2013-09-24 18:09 ` Eric Wong [this message]
2013-09-24 18:15   ` Lin Jen-Shin (godfat)
2013-09-24 21:05     ` Eric Wong
2013-09-25 11:43       ` Lin Jen-Shin (godfat)
2013-09-25 17:37         ` Eric Wong

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

  List information: https://yhbt.net/sleepy_penguin/

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

  git send-email \
    --in-reply-to=20130924180901.GA8085@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=sleepy.penguin@librelist.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.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/sleepy_penguin.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).