hurd: Add stubs for missing libc+tcc functions.

* lib/stub/close.c: New file.
* lib/stub/rmdir.c: New file.
* lib/stub/stat.c: New file.
* build-aux/configure-lib.sh (libc_tcc_SOURCES)[gnu]: Add them.
This commit is contained in:
Jan Nieuwenhuizen 2019-04-27 06:21:10 -04:00
parent 49ff9a7edd
commit 72c76d6b3a
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
4 changed files with 111 additions and 0 deletions

View File

@ -267,6 +267,14 @@ lib/linux/stat.c
"
fi
if test $mes_kernel = gnu; then
libc_tcc_SOURCES="$libc_tcc_SOURCES
lib/stub/close.c
lib/stub/rmdir.c
lib/stub/stat.c
"
fi
libc_gnu_SOURCES="
$libc_tcc_SOURCES
lib/ctype/isalnum.c

34
lib/stub/close.c Normal file
View File

@ -0,0 +1,34 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2019 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 <errno.h>
#include <stdio.h>
int
close (int filedes)
{
static int stub = 0;
if (__mes_debug () && !stub)
eputs ("close\n");
stub = 1;
errno = 0;
return 0;
}

34
lib/stub/rmdir.c Normal file
View File

@ -0,0 +1,34 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2019 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 <errno.h>
#include <unistd.h>
int
rmdir (char const *file_name)
{
static int stub = 0;
if (__mes_debug () && !stub)
eputs ("rmdir\n");
stub = 1;
errno = 0;
return 0;
}

35
lib/stub/stat.c Normal file
View File

@ -0,0 +1,35 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2019 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 <errno.h>
#include <stdio.h>
#include <sys/stat.h>
int
stat (char const *file_name, struct stat *statbuf)
{
static int stub = 0;
if (__mes_debug () && !stub)
eputs ("stat\n");
stub = 1;
errno = 0;
return 0;
}