mirror of
https://github.com/token2/fido2-manage.git
synced 2026-04-09 10:45:39 +00:00
Add files via upload
This commit is contained in:
27
openbsd-compat/bsd-getpagesize.c
Normal file
27
openbsd-compat/bsd-getpagesize.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/* Placed in the public domain */
|
||||
|
||||
#include "openbsd-compat.h"
|
||||
|
||||
#if !defined(HAVE_GETPAGESIZE)
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#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 /* !defined(HAVE_GETPAGESIZE) */
|
||||
Reference in New Issue
Block a user