{"thread":{"id":"31424","subject":"RE: [PATCH v2] Support for setitimer() on platforms lacking it","startedAt":"2012-09-04T10:45:34Z","lastAt":"2012-09-04T10:45:34Z","messageCount":1,"participants":["Joachim Schmitz"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"198292","messageId":"002401cd8a8a$6a43ca80$3ecb5f80$@schmitz-digital.de","threadId":"31424","inReplyTo":null,"subject":"RE: [PATCH v2] Support for setitimer() on platforms lacking it","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-09-04T10:45:34Z","receivedAt":"2012-09-04T10:45:34Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]\n> Sent: Tuesday, September 04, 2012 12:31 PM\n> To: 'Junio C Hamano'\n> Cc: 'git@vger.kernel.org'\n> Subject: RE: [PATCH v2] Support for setitimer() on platforms lacking it\n> \n> \n> Poor man's getitimer(), simply based on alarm().\n> \n> Currently needed on HP NonStop (\"#ifdef __TANDEM\"),\n> which does provide \"struct itimerval\", but no setitimer().\n> Alarm times are rounded up to the next full second.\n> \n> Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>\n> ---\n> Revert/remove my previous 2 patches for this first (from 'pu').\n\nActually: https://github.com/git/git/commit/55c96a1325\n\n>  git-compat-util.h | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/git-compat-util.h b/git-compat-util.h\n> index 18089f0..55b9421 100644\n> --- a/git-compat-util.h\n> +++ b/git-compat-util.h@@ -163,6 +163,10 @@\n>  #define probe_utf8_pathname_composition(a,b)\n>  #endif\n> \n> +#ifdef NO_SETITIMER /* poor man's setitimer() */\n> +#define setitimer(w,v,o) alarm((v)->it_value.tv_sec+((v)->it_value.tv_usec>0))\n> +#endif\n> +\n>  #ifdef MKDIR_WO_TRAILING_SLASH\n>  #define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))\n>  extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);\n> --\n> 1.7.12\n\nBye, Jojo\n"}]}