Subversion Repositories HelenOS

Rev

Rev 4585 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4585 Rev 4587
Line 386... Line 386...
386
    futex_up(&vfs_phone_futex);
386
    futex_up(&vfs_phone_futex);
387
 
387
 
388
    return rc;
388
    return rc;
389
}
389
}
390
 
390
 
-
 
391
int stat(const char *path, struct stat *stat)
-
 
392
{
-
 
393
    ipcarg_t rc;
-
 
394
    aid_t req;
-
 
395
   
-
 
396
    size_t pa_size;
-
 
397
    char *pa = absolutize(path, &pa_size);
-
 
398
    if (!pa)
-
 
399
        return ENOMEM;
-
 
400
   
-
 
401
    futex_down(&vfs_phone_futex);
-
 
402
    async_serialize_start();
-
 
403
    vfs_connect();
-
 
404
   
-
 
405
    req = async_send_0(vfs_phone, VFS_IN_STAT, NULL);
-
 
406
    rc = ipc_data_write_start(vfs_phone, pa, pa_size);
-
 
407
    if (rc != EOK) {
-
 
408
        async_wait_for(req, NULL);
-
 
409
        async_serialize_end();
-
 
410
        futex_up(&vfs_phone_futex);
-
 
411
        free(pa);
-
 
412
        return (int) rc;
-
 
413
    }
-
 
414
    rc = ipc_data_read_start(vfs_phone, stat, sizeof(struct stat));
-
 
415
    if (rc != EOK) {
-
 
416
        async_wait_for(req, NULL);
-
 
417
        async_serialize_end();
-
 
418
        futex_up(&vfs_phone_futex);
-
 
419
        free(pa);
-
 
420
        return (int) rc;
-
 
421
    }
-
 
422
    async_wait_for(req, &rc);
-
 
423
    async_serialize_end();
-
 
424
    futex_up(&vfs_phone_futex);
-
 
425
    free(pa);
-
 
426
    return rc;
-
 
427
}
-
 
428
 
391
DIR *opendir(const char *dirname)
429
DIR *opendir(const char *dirname)
392
{
430
{
393
    DIR *dirp = malloc(sizeof(DIR));
431
    DIR *dirp = malloc(sizeof(DIR));
394
    if (!dirp)
432
    if (!dirp)
395
        return NULL;
433
        return NULL;