{"thread":{"id":"31477","subject":"RE: [PATCH v4] Support for setitimer() on platforms lacking it","startedAt":"2012-09-08T16:54:34Z","lastAt":"2012-09-09T04:47:19Z","messageCount":2,"participants":["Joachim Schmitz","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":null},"messages":[{"id":"198570","messageId":"001e01cd8de2$a07f3930$e17dab90$@schmitz-digital.de","threadId":"31477","inReplyTo":null,"subject":"RE: [PATCH v4] Support for setitimer() on platforms lacking it","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-09-08T16:54:34Z","receivedAt":"2012-09-08T16:54:34Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"HP NonStop (currently) doesn't have setitimer().\nAs setitimer() is only used in cases of perceived latency and it doesn't affect\ncorrectness, it gets disabled entirely if NO_SETITIMER is set.\nHP NonStop does provide struct itimerval, but other platforms may not, so this\nis taken care of in this commit too, by setting NO_STRUCT_ITIMERVAL.\n\nSigned-off-by: Joachim Schmitz <jojo@schmitz-digital.de>\n---\n Makefile          | 12 ++++++++++++\n git-compat-util.h | 11 +++++++++++\n 2 files changed, 23 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex ac49320..7be555b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -157,6 +157,11 @@ all::\n # Define NO_PREAD if you have a problem with pread() system call (e.g.\n # cygwin1.dll before v1.5.22).\n #\n+# Define NO_SETITIMER if you don't have setitimer()\n+#\n+# Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval\n+# This also implies NO_SETITIMER\n+#\n # Define NO_THREAD_SAFE_PREAD if your pread() implementation is not\n # thread-safe. (e.g. compat/pread.c or cygwin)\n #\n@@ -1647,6 +1652,13 @@\n ifdef OBJECT_CREATION_USES_RENAMES\n \tCOMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1\n endif\n+ifdef NO_STRUCT_ITIMERVAL\n+\tCOMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL\n+\tNO_SETITIMER=YesPlease\n+endif\n+ifdef NO_SETITIMER\n+\tCOMPAT_CFLAGS += -DNO_SETITIMER\n+endif\n ifdef NO_PREAD\n \tCOMPAT_CFLAGS += -DNO_PREAD\n \tCOMPAT_OBJS += compat/pread.o\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 18089f0..4628d7a 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -162,6 +162,17 @@\n #define probe_utf8_pathname_composition(a,b)\n #endif\n \n+#ifdef NO_STRUCT_ITIMERVAL\n+struct itimerval {\n+\tstruct timeval it_interval;\n+\tstruct timeval it_value;\n+}\n+#endif\n+\n+#ifdef NO_SETITIMER\n+#define setitimer(which,value,ovalue)\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"},{"id":"198591","messageId":"7vk3w3u7jc.fsf@alter.siamese.dyndns.org","threadId":"31477","inReplyTo":"001e01cd8de2$a07f3930$e17dab90$@schmitz-digital.de","subject":"Re: [PATCH v4] Support for setitimer() on platforms lacking it","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-09T04:47:19Z","receivedAt":"2012-09-09T04:47:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Will queue (together with the latest MKDIR one).  Thanks.\n"}]}