Changeset 449c246 in mainline
- 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
- Location:
- uspace
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/vfs/vfs1.c
r92688eb r449c246 33 33 #include <sys/types.h> 34 34 #include <vfs.h> 35 #include <unistd.h> 36 #include <fcntl.h> 35 37 #include "../tester.h" 36 38 -
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 */ -
uspace/lib/libc/include/vfs.h
r92688eb r449c246 36 36 #define LIBC_VFS_H_ 37 37 38 #include <sys/types.h>39 40 38 extern int mount(const char *, const char *, const char *); 41 extern int open(const char *, int, ...);42 extern ssize_t read(int, void *, size_t);43 39 44 40 #endif
Note:
See TracChangeset
for help on using the changeset viewer.