Changeset 0b18364 in mainline for uspace/lib/c/generic/vfs/vfs.c


Ignore:
Timestamp:
2013-07-24T20:43:38Z (11 years ago)
Author:
Ji?? Z?rev?cky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9a8c188
Parents:
cb65bbe
Message:

Implement client side of walk and open.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/vfs/vfs.c

    rcb65bbe r0b18364  
    9090{
    9191        async_exchange_end(exch);
     92}
     93
     94int _vfs_walk(int parent, const char *path, int flags)
     95{
     96        async_exch_t *exch = vfs_exchange_begin();
     97       
     98        // TODO: assume this is done at a higher level.
     99        char *precanon = str_dup(path);
     100        size_t canon_size;
     101        char *canon = canonify(precanon, &canon_size);
     102       
     103        ipc_call_t answer;
     104        aid_t req = async_send_2(exch, VFS_IN_WALK, parent, flags, &answer);
     105        sysarg_t rc = async_data_write_start(exch, canon, canon_size);
     106       
     107        free(precanon);
     108        vfs_exchange_end(exch);
     109               
     110        sysarg_t rc_orig;
     111        async_wait_for(req, &rc_orig);
     112
     113        if (rc_orig != EOK) {
     114                return (int) rc_orig;
     115        }
     116               
     117        if (rc != EOK) {
     118                return (int) rc;
     119        }
     120       
     121        return (int) IPC_GET_ARG1(answer);
     122}
     123
     124int _vfs_open(int fildes, int mode)
     125{
     126        async_exch_t *exch = vfs_exchange_begin();
     127        sysarg_t rc = async_req_2_0(exch, VFS_IN_OPEN2, fildes, mode);
     128        vfs_exchange_end(exch);
     129       
     130        return (int) rc;
    92131}
    93132
Note: See TracChangeset for help on using the changeset viewer.