From f6d1fef2d7177863b018fa2210a7869375256029 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 20 Mar 2019 13:09:34 +0000 Subject: [PATCH] Handle not defining PIPE_BUF. According to POSIX, this can legally not be defined 'where the [...] value is equal to or greater than the stated minimum, but where the value can vary depending on the file to which it is applied'. So if limits.h hasn't defined PIPE_BUF, we define it ourself to the stated minimum, to wit, _POSIX_PIPE_BUF. Apparently it is actually undefined by on GNU/Hurd: Debian has been carrying this patch downstream for that reason. --- unix/uxshare.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unix/uxshare.c b/unix/uxshare.c index 2de65b52..0c5265bf 100644 --- a/unix/uxshare.c +++ b/unix/uxshare.c @@ -22,6 +22,9 @@ #define CONNSHARE_SOCKETDIR_PREFIX "/tmp/putty-connshare" #define SALT_FILENAME "salt" #define SALT_SIZE 64 +#ifndef PIPE_BUF +#define PIPE_BUF _POSIX_PIPE_BUF +#endif static char *make_parentdir_name(void) {