1 /******************************************************************************* 2 * Copyright (c) 2016, 2017 logi.cals GmbH 3 * 4 * All rights reserved. This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License v1.0 6 * and Eclipse Distribution License v1.0 which accompany this distribution. 7 * 8 * The Eclipse Public License is available at 9 * http://www.eclipse.org/legal/epl-v10.html 10 * and the Eclipse Distribution License is available at 11 * http://www.eclipse.org/org/documents/edl-v10.php. 12 * 13 * Contributors: 14 * Gunter Raidl - timer support for VxWorks 15 * Rainer Poisel - reusability 16 *******************************************************************************/ 17 18 #if !defined(OSWRAPPER_H) 19 #define OSWRAPPER_H 20 21 #if defined(_WRS_KERNEL) 22 #include <time.h> 23 24 #define lstat stat 25 26 typedef unsigned long useconds_t; 27 void usleep(useconds_t useconds); 28 29 #define timersub(a, b, result) \ 30 do \ 31 { \ 32 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ 33 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ 34 if ((result)->tv_usec < 0) \ 35 { \ 36 --(result)->tv_sec; \ 37 (result)->tv_usec += 1000000L; \ 38 } \ 39 } while (0) 40 #endif /* defined(_WRS_KERNEL) */ 41 42 #endif /* OSWRAPPER_H */ 43