DRAFT lib: Add sysconf stub.

* lib/stub/sysconf.c: New file.
* include/unistd.h (sysconf): Add prototype.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-10-26 15:33:12 +02:00
parent 3d6af32247
commit c5cfca2617
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
3 changed files with 35 additions and 1 deletions

View File

@ -399,6 +399,7 @@ lib/stub/sin.c
lib/stub/sqrt.c
lib/stub/strftime.c
lib/stub/sys_siglist.c
lib/stub/sysconf.c
lib/stub/system.c
lib/stub/times.c
lib/stub/ttyname.c

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -90,6 +90,7 @@ char *sbrk (ptrdiff_t delta);
void *sbrk (intptr_t delta);
#endif
int symlink (char const *old_name, char const *new_name);
long sysconf (int name);
int unlink (char const *file_name);
ssize_t write (int filedes, void const *buffer, size_t size);

32
lib/stub/sysconf.c Normal file
View File

@ -0,0 +1,32 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <mes/lib.h>
#include <unistd.h>
long
sysconf (int name)
{
static int stub = 0;
if (__mes_debug () && !stub)
eputs ("sysconf stub\n");
stub = 1;
return -1;
}