git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH v2] Support for setitimer() on platforms lacking it

From
Joachim Schmitz <jojo@schmitz-digital.de>
Date
Sep 4, 2012, 10:30 UTC
Message-ID
<002001cd8a88$58e43ab0$0aacb010$@schmitz-digital.de>
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
Message 1 of 1 in “RE: [PATCH v2] Support for setitimer() on platforms lacking it”
  1. Joachim SchmitzSep 4, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.