diff --git a/lib/linux/lseek.c b/lib/linux/lseek.c index f71af59f..b8ebffc5 100644 --- a/lib/linux/lseek.c +++ b/lib/linux/lseek.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. * @@ -24,23 +24,25 @@ #include #include -#if !__MESC__ /* FIXME: We want bin/mes-mescc's x86-linux sha256sum to stay the same. */ +#if !__MESC__ && !__M2__ off_t _lseek (int filedes, off_t offset, int whence) { - return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence); + long long_offset = offset; + return _sys_call3 (SYS_lseek, filedes, long_offset, whence); } #endif off_t lseek (int filedes, off_t offset, int whence) { -#if !__MESC__ /* FIXME: We want bin/mes-mescc's x86-linux sha256sum to stay the same. */ +#if !__MESC__ && !__M2__ if (_lseek (filedes, 0, SEEK_CUR) == -1) return -1; #endif + long long_offset = offset; size_t skip = __buffered_read_clear (filedes); if (whence == SEEK_CUR) offset -= skip; - return _sys_call3 (SYS_lseek, (int) filedes, (long) offset, (int) whence); + return _sys_call3 (SYS_lseek, filedes, long_offset, whence); }