mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-12-24 10:52:05 +00:00
f21455a084
The configure script checks for getpagesize() and sets HAVE_GETPAGESIZE in config.h, but bsd-getpagesize.c forgot to include includes.h (which indirectly includes config.h) so the checks always fails, causing linker issues when linking statically on systems with getpagesize(). Patch from Peter Korsgaard <peter at korsgaard.com>
26 lines
463 B
C
26 lines
463 B
C
/* Placed in the public domain */
|
|
|
|
#include "includes.h"
|
|
|
|
#ifndef HAVE_GETPAGESIZE
|
|
|
|
#include <unistd.h>
|
|
#include <limits.h>
|
|
|
|
int
|
|
getpagesize(void)
|
|
{
|
|
#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
|
|
long r = sysconf(_SC_PAGESIZE);
|
|
if (r > 0 && r < INT_MAX)
|
|
return (int)r;
|
|
#endif
|
|
/*
|
|
* This is at the lower end of common values and appropriate for
|
|
* our current use of getpagesize() in recallocarray().
|
|
*/
|
|
return 4096;
|
|
}
|
|
|
|
#endif /* HAVE_GETPAGESIZE */
|