{"thread":{"id":"31423","subject":"RE: [PATCH v2] Support for setitimer() on platforms lacking it","startedAt":"2012-09-04T10:30:46Z","lastAt":"2012-09-04T10:30:46Z","messageCount":1,"participants":["Joachim Schmitz"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"198291","messageId":"002001cd8a88$58e43ab0$0aacb010$@schmitz-digital.de","threadId":"31423","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:30:46Z","receivedAt":"2012-09-04T10:30:46Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"\nPoor man's getitimer(), simply based on alarm().\n\nCurrently needed on HP NonStop (\"#ifdef __TANDEM\"),\nwhich does provide \"struct itimerval\", but no setitimer().\nAlarm times are rounded up to the next full second.\n\nSigned-off-by: Joachim Schmitz <jojo@schmitz-digital.de>\n---\nRevert/remove my previous 2 patches for this first (from 'pu').\n\n git-compat-util.h | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 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-- \n1.7.12\n"}]}