Line data Source code
1 : /* 2 : Copyright 2018-2022, Barcelona Supercomputing Center (BSC), Spain 3 : Copyright 2015-2022, Johannes Gutenberg Universitaet Mainz, Germany 4 : 5 : This software was partially supported by the 6 : EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu). 7 : 8 : This software was partially supported by the 9 : ADA-FS project under the SPPEXA project funded by the DFG. 10 : 11 : This file is part of GekkoFS' POSIX interface. 12 : 13 : GekkoFS' POSIX interface is free software: you can redistribute it and/or 14 : modify it under the terms of the GNU Lesser General Public License as 15 : published by the Free Software Foundation, either version 3 of the License, 16 : or (at your option) any later version. 17 : 18 : GekkoFS' POSIX interface is distributed in the hope that it will be useful, 19 : but WITHOUT ANY WARRANTY; without even the implied warranty of 20 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 : GNU Lesser General Public License for more details. 22 : 23 : You should have received a copy of the GNU Lesser General Public License 24 : along with GekkoFS' POSIX interface. If not, see 25 : <https://www.gnu.org/licenses/>. 26 : 27 : SPDX-License-Identifier: LGPL-3.0-or-later 28 : */ 29 : #ifndef SYSCALL_BYPASS_HPP 30 : #define SYSCALL_BYPASS_HPP 31 : 32 : static inline int 33 0 : syscall_error_code(long result) { 34 0 : if(result < 0 && result >= -0x1000) 35 0 : return (int) -result; 36 : 37 : return 0; 38 : } 39 : 40 : extern "C" { 41 : long 42 : syscall_no_intercept(long syscall_number, ...); 43 : } 44 : 45 : #endif