Changeset e704503 in mainline for uspace/lib


Ignore:
Timestamp:
2008-02-17T14:49:14Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f15cf1a6
Parents:
16105cba
Message:

Support for close().

Location:
uspace/lib/libc
Files:
2 edited

Legend:

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

    r16105cba re704503  
    136136int close(int fildes)
    137137{
    138         return 0;       /* TODO */
     138        int res;
     139        ipcarg_t rc;
     140
     141        futex_down(&vfs_phone_futex);
     142        async_serialize_start();
     143        if (vfs_phone < 0) {
     144                res = vfs_connect();
     145                if (res < 0) {
     146                        async_serialize_end();
     147                        futex_up(&vfs_phone_futex);
     148                        return res;
     149                }
     150        }
     151               
     152        rc = async_req_1_0(vfs_phone, VFS_CLOSE, fildes);
     153
     154        async_serialize_end();
     155        futex_up(&vfs_phone_futex);
     156       
     157        return (int)rc;
    139158}
    140159
  • uspace/lib/libc/include/errno.h

    r16105cba re704503  
    4444#define EEXIST          (-260)
    4545#define ENOTEMPTY       (-261)
     46#define EBADF           (-262)
    4647
    4748#endif
Note: See TracChangeset for help on using the changeset viewer.