/* npth.h - a lightweight implementation of pth over pthread. * Configured for: x86_64-pc-linux-gnu. * Copyright (C) 2011, 2012, 2015, 2017, 2024 g10 Code GmbH * * This file is part of nPth. * * nPth is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * nPth 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see . */ /* Changes to GNU Pth: * * Return value and arguments follow strictly the pthread format: * * - Return the error number instead of setting errno, * * - have timedlock function instead of extra event argument, * * - have trylock function instead of extra event argument. Can't mix * timed and try. * * - No _new functions. Use _init functions instead. * * - Attributes are set by specific instead of generic getter/setter * functions. * * - Offers replacement functions for sendmsg and recvmsg. */ #ifndef _NPTH_H #define _NPTH_H #include #include #include #include #include #define _npth_socklen_t socklen_t #include #include #include #undef _NPTH_NO_RWLOCK #ifdef __ANDROID__ #include #if __ANDROID_API__ < 9 /* Android 8 and earlier are missing rwlocks. We punt to mutexes in that case. */ #define _NPTH_NO_RWLOCK 1 #endif #endif #ifdef __cplusplus extern "C" { #if 0 /* (Keep Emacsens' auto-indent happy.) */ } #endif #endif /* The version and the version number of this header should match the * one of the library. Use the latter in your application to test for * minor API changes. Use npth_get_version for the lib version. */ #define NPTH_VERSION "1.8-unknown" #define NPTH_VERSION_NUMBER 0x010800