Ejemplo n.º 1
0
int LittleFileSystem::mkdir(const char *name, mode_t mode)
{
    _mutex.lock();
    LFS_INFO("mkdir(\"%s\", 0x%lx)", name, mode);
    int err = lfs_mkdir(&_lfs, name);
    LFS_INFO("mkdir -> %d", lfs_toerror(err));
    _mutex.unlock();
    return lfs_toerror(err);
}
Ejemplo n.º 2
0
static int _mkdir(vfs_mount_t *mountp, const char *name, mode_t mode)
{
    (void)mode;
    littlefs_desc_t *fs = mountp->private_data;

    mutex_lock(&fs->lock);

    DEBUG("littlefs: mkdir: mountp=%p, name=%s, mode=%" PRIu32 "\n",
          (void *)mountp, name, (uint32_t)mode);

    int ret = lfs_mkdir(&fs->fs, name);
    mutex_unlock(&fs->lock);

    return littlefs_err_to_errno(ret);
}