1361fc4cbSmaya/**************************************************************************
2361fc4cbSmaya *
3361fc4cbSmaya * Copyright 2009 VMware, Inc.
4361fc4cbSmaya * All Rights Reserved.
5361fc4cbSmaya *
6361fc4cbSmaya * Permission is hereby granted, free of charge, to any person obtaining a
7361fc4cbSmaya * copy of this software and associated documentation files (the
8361fc4cbSmaya * "Software"), to deal in the Software without restriction, including
9361fc4cbSmaya * without limitation the rights to use, copy, modify, merge, publish,
10361fc4cbSmaya * distribute, sub license, and/or sell copies of the Software, and to
11361fc4cbSmaya * permit persons to whom the Software is furnished to do so, subject to
12361fc4cbSmaya * the following conditions:
13361fc4cbSmaya *
14361fc4cbSmaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15361fc4cbSmaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16361fc4cbSmaya * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17361fc4cbSmaya * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18361fc4cbSmaya * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19361fc4cbSmaya * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20361fc4cbSmaya * USE OR OTHER DEALINGS IN THE SOFTWARE.
21361fc4cbSmaya *
22361fc4cbSmaya * The above copyright notice and this permission notice (including the
23361fc4cbSmaya * next paragraph) shall be included in all copies or substantial portions
24361fc4cbSmaya * of the Software.
25361fc4cbSmaya *
26361fc4cbSmaya **************************************************************************/
27361fc4cbSmaya
28361fc4cbSmaya
29361fc4cbSmaya#ifndef U_FILE_H_
30361fc4cbSmaya#define U_FILE_H_
31361fc4cbSmaya
32361fc4cbSmaya#if defined(PIPE_OS_UNIX)
33361fc4cbSmaya#include <unistd.h>
34361fc4cbSmaya#endif
35361fc4cbSmaya#if defined(PIPE_OS_WINDOWS)
36361fc4cbSmaya#include <io.h>
37361fc4cbSmaya#endif
38361fc4cbSmaya
39361fc4cbSmaya#ifdef	__cplusplus
40361fc4cbSmayaextern "C" {
41361fc4cbSmaya#endif
42361fc4cbSmaya
43361fc4cbSmayastatic inline int
44361fc4cbSmayau_file_access(const char *path, int mode) {
45361fc4cbSmaya#if defined(PIPE_OS_UNIX)
46361fc4cbSmaya	return access(path, mode);
47361fc4cbSmaya#elif defined(PIPE_OS_WINDOWS)
48361fc4cbSmaya	return _access(path, mode);
49361fc4cbSmaya#else
50361fc4cbSmaya	return 0;
51361fc4cbSmaya#endif
52361fc4cbSmaya}
53361fc4cbSmaya
54361fc4cbSmaya#ifdef	__cplusplus
55361fc4cbSmaya}
56361fc4cbSmaya#endif
57361fc4cbSmaya
58361fc4cbSmaya#endif /* U_FILE_H_ */
59