openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/glib/gstdio.c
int g_access(const gchar* filename, int mode)
{
#ifdef G_OS_WIN32
    wchar_t* wfilename = g_utf8_to_utf16(filename, -1, NULL, NULL, NULL);
    int retval;
    int save_errno;

    if (wfilename == NULL)
    {
        errno = EINVAL;
        return -1;
    }

#ifndef X_OK
#define X_OK 1
#endif

    retval = _waccess(wfilename, mode & ~X_OK);
    save_errno = errno;

    g_free(wfilename);

    errno = save_errno;
    return retval;
#else
    return access(filename, mode);
#endif
}
/**
 * g_access:
 * @filename: (type filename): a pathname in the GLib file name encoding
 *     (UTF-8 on Windows)
 * @mode: as in access()
 *
 * A wrapper for the POSIX access() function. This function is used to
 * test a pathname for one or several of read, write or execute
 * permissions, or just existence.
 *
 * On Windows, the file protection mechanism is not at all POSIX-like,
 * and the underlying function in the C library only checks the
 * FAT-style READONLY attribute, and does not look at the ACL of a
 * file at all. This function is this in practise almost useless on
 * Windows. Software that needs to handle file permissions on Windows
 * more exactly should use the Win32 API.
 *
 * See your C library manual for more details about access().
 *
 * Returns: zero if the pathname refers to an existing file system
 *     object that has all the tested permissions, or -1 otherwise
 *     or on error.
 *
 * Since: 2.8
 */
@filename: (type filename): a pathname in the GLib file name encoding
(UTF-8 on Windows)
@mode: as in access()

A wrapper for the POSIX access() function. This function is used to
test a pathname for one or several of read, write or execute
permissions, or just existence.

On Windows, the file protection mechanism is not at all POSIX-like,
and the underlying function in the C library only checks the
FAT-style READONLY attribute, and does not look at the ACL of a
file at all. This function is this in practise almost useless on
Windows. Software that needs to handle file permissions on Windows
more exactly should use the Win32 API.

See your C library manual for more details about access().

zero if the pathname refers to an existing file system
object that has all the tested permissions, or -1 otherwise
or on error.


@filename : ( type filename ) : a pathname in the GLib file name encoding ( UTF - 8 on Windows ) @mode : as in access () A wrapper for the POSIX access () function . This function is used to test a pathname for one or several of read write or execute permissions or just existence . On Windows the file protection mechanism is not at all POSIX - like and the underlying function in the C library only checks the FAT - style READONLY attribute and does not look at the ACL of a file at all . This function is this in practise almost useless on Windows . Software that needs to handle file permissions on Windows more exactly should use the Win32 API . See your C library manual for more details about access () . zero if the pathname refers to an existing file system object that has all the tested permissions or - 1 otherwise or on error .
int g_access(const gchar* filename, int mode)
{
#ifdef G_OS_WIN32
    wchar_t* wfilename = g_utf8_to_utf16(filename, -1, NULL, NULL, NULL);
    int retval;
    int save_errno;
    if (wfilename == NULL)
    {
        errno = EINVAL;
        return -1;
    }
#ifndef X_OK
#define X_OK 1
#endif
    retval = _waccess(wfilename, mode & ~X_OK);
    save_errno = errno;
    g_free(wfilename);
    errno = save_errno;
    return retval;
#else
    return access(filename, mode);
#endif
}
int g_access ( const gchar * filename , int mode ) { #ifdef G_OS_WIN32 wchar_t * wfilename = g_utf8_to_utf16 ( filename , -1 , NULL , NULL , NULL ) ; int retval ; int save_errno ; if ( wfilename == NULL ) { errno = EINVAL ; return -1 ; } #ifndef X_OK #define X_OK  1 #endif retval = _waccess ( wfilename , mode & ~ X_OK ) ; save_errno = errno ; g_free ( wfilename ) ; errno = save_errno ; return retval ; #else return access ( filename , mode ) ; #endif }
g_access:
 @filename: (type filename): a pathname in the GLib file name encoding
     (UTF-8 on Windows)
 @mode: as in access()
g_access : @filename : ( type filename ) : a pathname in the GLib file name encoding ( UTF - 8 on Windows ) @mode : as in access ()