--- parser3/src/include/pa_os.h 2020/12/15 17:10:31 1.12 +++ parser3/src/include/pa_os.h 2026/10/23 20:48:48 1.17 @@ -1,20 +1,20 @@ /** @file Parser: commonly used functions. - Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_OS_H #define PA_OS_H -#define IDENT_PA_OS_H "$Id: pa_os.h,v 1.12 2020/12/15 17:10:31 moko Exp $" +#define IDENT_PA_OS_H "$Id: pa_os.h,v 1.17 2026/10/23 20:48:48 moko Exp $" #define PA_LOCK_ATTEMPTS 20 #define PA_LOCK_WAIT_TIMEOUT_SECS 0 #define PA_LOCK_WAIT_TIMEOUT_USECS 500000 -extern unsigned int pa_lock_attempts; +extern unsigned int pa_lock_attempts; // not thread local: never changes // 'blocking' mean we will wait till other process release lock // but we'll make PA_LOCK_ATTEMPTS attempts with PA_LOCK_WAIT_TIMEOUT secs delaus between attempts @@ -28,4 +28,9 @@ int pa_unlock(int fd); /// yields to OS for secs secs and usecs microseconds (1E-6) int pa_sleep(unsigned long secs, unsigned long usecs); +#ifdef _MSC_VER +/// sets errno from GetLastError(), as CRT does, if the passed windows api call result is zero; returns it +int pa_set_errno(int status); +#endif + #endif