Changeset 449c246 in mainline for uspace/lib/libc/generic/vfs.c
- Timestamp:
- 2007-12-30T21:32:31Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- badbd888
- Parents:
- 92688eb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/vfs.c
r92688eb r449c246 34 34 35 35 #include <vfs.h> 36 #include <unistd.h> 37 #include <fcntl.h> 36 38 #include <ipc/ipc.h> 37 39 #include <ipc/services.h> … … 141 143 } 142 144 } 143 req = async_send_1(vfs_phone, VFS_READ, 0, &answer);145 req = async_send_1(vfs_phone, VFS_READ, fildes, &answer); 144 146 if (ipc_data_read_send(vfs_phone, buf, sizeof(buf)) != EOK) { 145 147 async_wait_for(req, NULL); … … 154 156 } 155 157 158 ssize_t write(int fildes, const void *buf, size_t nbyte) 159 { 160 int res; 161 ipcarg_t rc; 162 ipc_call_t answer; 163 aid_t req; 164 165 futex_down(&vfs_phone_futex); 166 async_serialize_start(); 167 if (vfs_phone < 0) { 168 res = vfs_connect(); 169 if (res < 0) { 170 async_serialize_end(); 171 futex_up(&vfs_phone_futex); 172 return res; 173 } 174 } 175 req = async_send_1(vfs_phone, VFS_WRITE, fildes, &answer); 176 if (ipc_data_write_send(vfs_phone, buf, sizeof(buf)) != EOK) { 177 async_wait_for(req, NULL); 178 async_serialize_end(); 179 futex_up(&vfs_phone_futex); 180 return (ssize_t) rc; 181 } 182 async_wait_for(req, &rc); 183 async_serialize_end(); 184 futex_up(&vfs_phone_futex); 185 return (ssize_t) IPC_GET_ARG1(answer); 186 } 156 187 /** @} 157 188 */
Note:
See TracChangeset
for help on using the changeset viewer.