From 9b9d37ee956750e56fca2d5ab01508939fd9e28f Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 27 Apr 2019 12:59:43 +0200 Subject: [PATCH] hurd: Add stubs for missing libmes functions. * lib/stub/lseek.c: New file. * build-aux/configure-lib.sh (libmes_SOURCES)[gnu]: Add it. --- build-aux/configure-lib.sh | 5 +++++ lib/stub/lseek.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 lib/stub/lseek.c diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh index 2a6946ea..fa5d8db6 100644 --- a/build-aux/configure-lib.sh +++ b/build-aux/configure-lib.sh @@ -103,6 +103,11 @@ lib/ctype/isxdigit.c lib/posix/write.c lib/stdlib/atoi.c " + if test $mes_kernel = gnu; then + libmes_SOURCES="$libmes_SOURCES +lib/stub/lseek.c +" + fi if test $mes_kernel = linux; then libmes_SOURCES="$libmes_SOURCES lib/linux/lseek.c diff --git a/lib/stub/lseek.c b/lib/stub/lseek.c new file mode 100644 index 00000000..45037554 --- /dev/null +++ b/lib/stub/lseek.c @@ -0,0 +1,35 @@ +/* -*-comment-start: "//";comment-end:""-*- + * GNU Mes --- Maxwell Equations of Software + * Copyright © 2019 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 +#include +#include + +off_t +lseek (int filedes, off_t offset, int whence) +{ + static int stub = 0; + if (__mes_debug () && !stub) + eputs ("lseek stub\n"); + stub = 1; + errno = 0; + return 0; +}