if (ioctl(fd, BLKSSZGET, &bd->sector_size) < 0)
bd->sector_size = DEFAULT_SECTOR_SIZE;
bd->sector_size_bits = sector_size_bits(bd->sector_size);
if (ioctl(fd, BLKSSZGET, &bd->sector_size) < 0)
bd->sector_size = DEFAULT_SECTOR_SIZE;
bd->sector_size_bits = sector_size_bits(bd->sector_size);
return pwrite(fd, buf, size, offset);
}
return pwrite(fd, buf, size, offset);
}
ssize_t exfat_utf16_enc(const char *in_str, __u16 *out_str, size_t out_size)
{
size_t mbs_len, out_len, i;
ssize_t exfat_utf16_enc(const char *in_str, __u16 *out_str, size_t out_size)
{
size_t mbs_len, out_len, i;
if (mbstowcs(wcs, in_str, mbs_len+1) == (size_t)-1) {
if (errno == EINVAL || errno == EILSEQ)
exfat_err("invalid character sequence in current locale\n");
if (mbstowcs(wcs, in_str, mbs_len+1) == (size_t)-1) {
if (errno == EINVAL || errno == EILSEQ)
exfat_err("invalid character sequence in current locale\n");
memset(&ps, 0, sizeof(ps));
/* And then convert wchar_t* string to multibyte char* string */
memset(&ps, 0, sizeof(ps));
/* And then convert wchar_t* string to multibyte char* string */
c_len = wcrtomb(c_str, wcs[i], &ps);
/*
* If character is non-representable in current locale then
c_len = wcrtomb(c_str, wcs[i], &ps);
/*
* If character is non-representable in current locale then