diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh index 8f7b8cb1..71ac5a62 100644 --- a/build-aux/configure-lib.sh +++ b/build-aux/configure-lib.sh @@ -375,6 +375,7 @@ lib/stub/frexp.c lib/stub/getgrgid.c lib/stub/getgrnam.c lib/stub/getlogin.c +lib/stub/getpagesize.c lib/stub/getpgid.c lib/stub/getpgrp.c lib/stub/getpwnam.c diff --git a/include/limits.h b/include/limits.h index 9cbbf97a..8ef34dc8 100644 --- a/include/limits.h +++ b/include/limits.h @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -33,6 +33,7 @@ #define MB_CUR_MAX 1 #define NAME_MAX 255 +#define PAGE_SIZE 4096 #define PATH_MAX 512 #define _POSIX_OPEN_MAX 16 diff --git a/include/unistd.h b/include/unistd.h index 2b1ac6cf..da566fbb 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -74,6 +74,7 @@ int setgid (gid_t newgid); int setuid (uid_t newuid); uid_t geteuid (void); gid_t getegid (void); +int getpagesize (void); pid_t getpgrp (void); pid_t getpid (void); pid_t getppid (void); diff --git a/lib/stub/getpagesize.c b/lib/stub/getpagesize.c new file mode 100644 index 00000000..3e69dc7a --- /dev/null +++ b/lib/stub/getpagesize.c @@ -0,0 +1,32 @@ +/* -*-comment-start: "//";comment-end:""-*- + * GNU Mes --- Maxwell Equations of Software + * Copyright © 2022 Jan (janneke) Nieuwenhuizen + * + * This file is part of GNU Mes. + * + * GNU Mes is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or (at + * your option) any later version. + * + * GNU Mes is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Mes. If not, see . + */ + +#include +#include + +int +getpagesize (void) +{ + static int stub = 0; + if (__mes_debug () && !stub) + eputs ("getpagesize stub\n"); + stub = 1; + return PAGE_SIZE; +}