git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH v2] Support for setitimer() on platforms lacking it
@ 2012-09-04 10:30 Joachim Schmitz
  0 siblings, 0 replies; 2+ messages in thread
From: Joachim Schmitz @ 2012-09-04 10:30 UTC (permalink / raw)
  To: 'Junio C Hamano'; +Cc: git


Poor man's getitimer(), simply based on alarm().

Currently needed on HP NonStop ("#ifdef __TANDEM"),
which does provide "struct itimerval", but no setitimer().
Alarm times are rounded up to the next full second.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
---
Revert/remove my previous 2 patches for this first (from 'pu').

 git-compat-util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/git-compat-util.h b/git-compat-util.h
index 18089f0..55b9421 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h@@ -163,6 +163,10 @@
 #define probe_utf8_pathname_composition(a,b)
 #endif

+#ifdef NO_SETITIMER /* poor man's setitimer() */
+#define setitimer(w,v,o) alarm((v)->it_value.tv_sec+((v)->it_value.tv_usec>0))
+#endif
+
 #ifdef MKDIR_WO_TRAILING_SLASH
 #define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))
 extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);
-- 
1.7.12

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH v2] Support for setitimer() on platforms lacking it
@ 2012-09-04 10:45 Joachim Schmitz
  0 siblings, 0 replies; 2+ messages in thread
From: Joachim Schmitz @ 2012-09-04 10:45 UTC (permalink / raw)
  To: 'Junio C Hamano'; +Cc: git

> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]
> Sent: Tuesday, September 04, 2012 12:31 PM
> To: 'Junio C Hamano'
> Cc: 'git@vger.kernel.org'
> Subject: RE: [PATCH v2] Support for setitimer() on platforms lacking it
> 
> 
> Poor man's getitimer(), simply based on alarm().
> 
> Currently needed on HP NonStop ("#ifdef __TANDEM"),
> which does provide "struct itimerval", but no setitimer().
> Alarm times are rounded up to the next full second.
> 
> Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
> ---
> Revert/remove my previous 2 patches for this first (from 'pu').

Actually: https://github.com/git/git/commit/55c96a1325

>  git-compat-util.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 18089f0..55b9421 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h@@ -163,6 +163,10 @@
>  #define probe_utf8_pathname_composition(a,b)
>  #endif
> 
> +#ifdef NO_SETITIMER /* poor man's setitimer() */
> +#define setitimer(w,v,o) alarm((v)->it_value.tv_sec+((v)->it_value.tv_usec>0))
> +#endif
> +
>  #ifdef MKDIR_WO_TRAILING_SLASH
>  #define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))
>  extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);
> --
> 1.7.12

Bye, Jojo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-04 10:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-04 10:30 [PATCH v2] Support for setitimer() on platforms lacking it Joachim Schmitz
  -- strict thread matches above, loose matches on Subject: below --
2012-09-04 10:45 Joachim Schmitz

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 NNTP newsgroup(s).