From 0864dd31db882d82d57d0453c5ece4ef5af51818 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 24 May 2011 10:03:34 +0000 Subject: [PATCH] * pinfo.h (struct _pinfo): Reduce size of progname array slightly. Explain why. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/pinfo.h | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f1c058220..1d3e2b9fb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2011-05-24 Corinna Vinschen + + * pinfo.h (struct _pinfo): Reduce size of progname array slightly. + Explain why. + 2011-05-23 Eric Blake * errno.cc (strerror): Print unknown errno as int. diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index ed8a4aecf..72dc52237 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -64,8 +64,12 @@ public: signals. */ DWORD dwProcessId; - /* Used to spawn a child for fork(), among other things. */ - WCHAR progname[NT_MAX_PATH]; + /* Used to spawn a child for fork(), among other things. The other + members of _pinfo take only a bit over 200 bytes. So cut off a + couple of bytes from progname to allow the _pinfo structure not + to exceed 64K. Otherwise it blocks another 64K block of VM for + the process. */ + WCHAR progname[NT_MAX_PATH - 512]; /* User information. The information is derived from the GetUserName system call,