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_chmod(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;
    }

    retval = _wchmod(wfilename, mode);
    save_errno = errno;

    g_free(wfilename);

    errno = save_errno;
    return retval;
#else
    return chmod(filename, mode);
#endif
}
/**
 * g_chmod:
 * @filename: (type filename): a pathname in the GLib file name encoding
 *     (UTF-8 on Windows)
 * @mode: as in chmod()
 *
 * A wrapper for the POSIX chmod() function. The chmod() function is
 * used to set the permissions of a file system object.
 *
 * On Windows the file protection mechanism is not at all POSIX-like,
 * and the underlying chmod() function in the C library just sets or
 * clears the FAT-style READONLY attribute. It does not touch any
 * ACL. Software that needs to manage file permissions on Windows
 * exactly should use the Win32 API.
 *
 * See your C library manual for more details about chmod().
 *
 * Returns: 0 if the operation succeeded, -1 on error
 *
 * Since: 2.8
 */
@filename: (type filename): a pathname in the GLib file name encoding
(UTF-8 on Windows)
@mode: as in chmod()

A wrapper for the POSIX chmod() function. The chmod() function is
used to set the permissions of a file system object.

On Windows the file protection mechanism is not at all POSIX-like,
and the underlying chmod() function in the C library just sets or
clears the FAT-style READONLY attribute. It does not touch any
ACL. Software that needs to manage file permissions on Windows
exactly should use the Win32 API.

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

0 if the operation succeeded, -1 on error


@filename : ( type filename ) : a pathname in the GLib file name encoding ( UTF - 8 on Windows ) @mode : as in chmod () A wrapper for the POSIX chmod () function . The chmod () function is used to set the permissions of a file system object . On Windows the file protection mechanism is not at all POSIX - like and the underlying chmod () function in the C library just sets or clears the FAT - style READONLY attribute . It does not touch any ACL . Software that needs to manage file permissions on Windows exactly should use the Win32 API . See your C library manual for more details about chmod () . 0 if the operation succeeded - 1 on error
int g_chmod(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;
    }
    retval = _wchmod(wfilename, mode);
    save_errno = errno;
    g_free(wfilename);
    errno = save_errno;
    return retval;
#else
    return chmod(filename, mode);
#endif
}
int g_chmod ( 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 ; } retval = _wchmod ( wfilename , mode ) ; save_errno = errno ; g_free ( wfilename ) ; errno = save_errno ; return retval ; #else return chmod ( filename , mode ) ; #endif }
g_chmod:
 @filename: (type filename): a pathname in the GLib file name encoding
     (UTF-8 on Windows)
 @mode: as in chmod()
g_chmod : @filename : ( type filename ) : a pathname in the GLib file name encoding ( UTF - 8 on Windows ) @mode : as in chmod ()