Ignore:
File:
1 edited

Legend:

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

    r38db6288 r35a35651  
    4343#include <stdio.h>
    4444#include <sys/stat.h>
    45 #include <sys/statfs.h>
    4645#include <sys/types.h>
    4746#include <ipc/services.h>
     
    342341}
    343342
    344 ssize_t read(int fildes, void *buf, size_t nbyte)
     343ssize_t read(int fildes, void *buf, size_t nbyte) 
    345344{
    346345        sysarg_t rc;
     
    348347        aid_t req;
    349348       
    350         if (nbyte > DATA_XFER_LIMIT)
    351                 nbyte = DATA_XFER_LIMIT;
    352        
    353349        async_exch_t *exch = vfs_exchange_begin();
    354350       
    355351        req = async_send_1(exch, VFS_IN_READ, fildes, &answer);
    356         rc = async_data_read_start(exch, (void *) buf, nbyte);
     352        rc = async_data_read_start(exch, (void *)buf, nbyte);
    357353        if (rc != EOK) {
    358354                vfs_exchange_end(exch);
     
    380376        aid_t req;
    381377       
    382         if (nbyte > DATA_XFER_LIMIT)
    383                 nbyte = DATA_XFER_LIMIT;
    384        
    385378        async_exch_t *exch = vfs_exchange_begin();
    386379       
    387380        req = async_send_1(exch, VFS_IN_WRITE, fildes, &answer);
    388         rc = async_data_write_start(exch, (void *) buf, nbyte);
     381        rc = async_data_write_start(exch, (void *)buf, nbyte);
    389382        if (rc != EOK) {
    390383                vfs_exchange_end(exch);
     
    742735}
    743736
    744 int remove(const char *path)
    745 {
    746         return unlink(path);
    747 }
    748 
    749737int chdir(const char *path)
    750738{
     
    904892}
    905893
    906 int statfs(const char *path, struct statfs *st)
    907 {
    908         sysarg_t rc, rc_orig;
    909         aid_t req;
    910         size_t pa_size;
    911 
    912         char *pa = absolutize(path, &pa_size);
    913         if (!pa)
    914                 return ENOMEM;
    915 
    916         async_exch_t *exch = vfs_exchange_begin();
    917 
    918         req = async_send_0(exch, VFS_IN_STATFS, NULL);
    919         rc = async_data_write_start(exch, pa, pa_size);
    920         if (rc != EOK)
    921                 goto exit;
    922 
    923         rc = async_data_read_start(exch, (void *) st, sizeof(*st));
    924 
    925 exit:
    926         vfs_exchange_end(exch);
    927         free(pa);
    928         async_wait_for(req, &rc_orig);
    929         return (int) (rc_orig != EOK ? rc_orig : rc);
    930 }
    931 
    932894/** @}
    933895 */
Note: See TracChangeset for help on using the changeset viewer.