Changeset e704503 in mainline
- Timestamp:
- 2008-02-17T14:49:14Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f15cf1a6
- Parents:
- 16105cba
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/vfs.c
r16105cba re704503 136 136 int close(int fildes) 137 137 { 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; 139 158 } 140 159 -
uspace/lib/libc/include/errno.h
r16105cba re704503 44 44 #define EEXIST (-260) 45 45 #define ENOTEMPTY (-261) 46 #define EBADF (-262) 46 47 47 48 #endif -
uspace/srv/vfs/vfs.c
r16105cba re704503 94 94 vfs_open(callid, &call); 95 95 break; 96 case VFS_CLOSE: 97 vfs_close(callid, &call); 98 break; 96 99 case VFS_READ: 97 100 vfs_read(callid, &call); -
uspace/srv/vfs/vfs.h
r16105cba re704503 270 270 extern void vfs_mount(ipc_callid_t, ipc_call_t *); 271 271 extern void vfs_open(ipc_callid_t, ipc_call_t *); 272 extern void vfs_close(ipc_callid_t, ipc_call_t *); 272 273 extern void vfs_read(ipc_callid_t, ipc_call_t *); 273 274 extern void vfs_write(ipc_callid_t, ipc_call_t *); -
uspace/srv/vfs/vfs_ops.c
r16105cba re704503 388 388 } 389 389 390 void vfs_close(ipc_callid_t rid, ipc_call_t *request) 391 { 392 int fd = IPC_GET_ARG1(*request); 393 if (fd >= MAX_OPEN_FILES) { 394 ipc_answer_0(rid, EBADF); 395 return; 396 } 397 vfs_fd_free(fd); 398 ipc_answer_0(rid, EOK); 399 } 400 390 401 static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read) 391 402 {
Note:
See TracChangeset
for help on using the changeset viewer.