From a3cf7781e296adb6565c42dea6e09d787a74535a Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Tue, 3 May 2022 18:03:49 +0200 Subject: [PATCH] lib: linux/_open3: Support M2-Planet. * lib/linux/_open3.c (_open3): Use function casting. Also call __ungetc_init. * lib/stub/__buffered_read.c: New file. --- lib/linux/_open3.c | 6 ++++-- lib/stub/__buffered_read.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 lib/stub/__buffered_read.c diff --git a/lib/linux/_open3.c b/lib/linux/_open3.c index cfad689a..b67da57a 100644 --- a/lib/linux/_open3.c +++ b/lib/linux/_open3.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen + * Copyright © 2016,2017,2018,2019,2022 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -26,7 +26,9 @@ int _open3 (char const *file_name, int flags, int mask) { - int r = _sys_call3 (SYS_open, (long) file_name, (int) flags, (int) mask); + long long_file_name = cast_charp_to_long (file_name); + int r = _sys_call3 (SYS_open, long_file_name, flags, mask); + __ungetc_init (); if (r > 2) { __ungetc_clear (r); diff --git a/lib/stub/__buffered_read.c b/lib/stub/__buffered_read.c new file mode 100644 index 00000000..aaa00247 --- /dev/null +++ b/lib/stub/__buffered_read.c @@ -0,0 +1,33 @@ +/* -*-comment-start: "//";comment-end:""-*- + * GNU Mes --- Maxwell Equations of Software + * Copyright © 2019,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 +#include + +void +__buffered_read_init (int filedes) +{ +} + +size_t +__buffered_read_clear (int filedes) +{ +}