ReactOS 0.4.16-dev-1093-g93e9710
access.cpp
Go to the documentation of this file.
1//
2// access.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The _access() and _access_s() functions, which test file accessibility.
7//
8#include <corecrt_internal.h>
9#include <io.h>
11
12// See _waccess_s for information about this function's behavior.
13extern "C" errno_t __cdecl _access_s(char const* const path, int const access_mode)
14{
15 if (path == nullptr) {
16 return _waccess_s(nullptr, access_mode);
17 }
18
20
22
23 if (cvt != 0) {
24 return -1;
25 }
26
27 return _waccess_s(wide_path.data(), access_mode);
28}
29
30// The same as _access_s, but transforms all errors into a -1 return value.
31extern "C" int __cdecl _access(char const* const path, int const access_mode)
32{
33 return _access_s(path, access_mode) == 0 ? 0 : -1;
34}
int __cdecl _access(char const *const path, int const access_mode)
Definition: access.cpp:31
errno_t __cdecl _access_s(char const *const path, int const access_mode)
Definition: access.cpp:13
#define __cdecl
Definition: accygwin.h:79
errno_t __acrt_mbs_to_wcs_cp(char const *const null_terminated_input_string, __crt_win32_buffer< wchar_t, ResizePolicy > &win32_buffer, unsigned int const code_page)
unsigned int __acrt_get_utf8_acp_compatibility_codepage()
_Check_return_wat_ _ACRTIMP errno_t __cdecl _waccess_s(_In_z_ wchar_t const *_FileName, _In_ int _AccessMode)
static char * cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
Definition: fcvtbuf.c:45
int errno_t
Definition: corecrt.h:615