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

[PATCH jk/push-client-deadlock-fix] Windows: add pthread_sigmask() that does nothing

From
Johannes Sixt <j6t@kdbg.org>
Date
May 1, 2016, 19:08 UTC
Message-ID
<57265425.9050205@kdbg.org>
In-Reply-To
<20160501174535.GB17321@sigill.intra.peff.net>

A previous change introduced a call to pthread_sigmask() in order to block SIGPIPE in a thread. Since there are no signal facilities on Windows that are similar to POSIX signals, just ignore the request to block the signal. In the particular case, the effect of blocking SIGPIPE on POSIX is that write() calls return EPIPE when the reader closes the pipe. This is how write() behaves on Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 compat/mingw.h         | 1 +
 compat/win32/pthread.h | 5 +++++
 2 files changed, 6 insertions(+)
diff --git a/compat/mingw.h b/compat/mingw.h
index a950ae2..0f272fd 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -142,6 +142,7 @@ static inline int fcntl(int fd, int cmd, ...)
 #define sigemptyset(x) (void)0
 static inline int sigaddset(sigset_t *set, int signum)
 { return 0; }
+#define SIG_BLOCK 0
 #define SIG_UNBLOCK 0
 static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
 { return 0; }
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index b6ed9e7..d336451 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -104,4 +104,9 @@ static inline void *pthread_getspecific(pthread_key_t key)
 	return TlsGetValue(key);
 }
 
+static inline int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
+{
+	return 0;
+}
+
 #endif /* PTHREAD_H */
-- 
2.7.0.118.g90056ae
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “pthread_sigmask() on windows (wine actualy)”
  1. Duy NguyenMay 1, 2016
  2. Jeff KingMay 1, 2016
  3. Windows: add pthread_sigmask() that does nothingJohannes Sixt, May 1, 2016
  4. Jeff KingMay 3, 2016

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.