Rev 2684 | Rev 2694 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2684 | Rev 2693 | ||
---|---|---|---|
Line 92... | Line 92... | ||
92 | futex_up(&vfs_phone_futex); |
92 | futex_up(&vfs_phone_futex); |
93 | return (int) rc; |
93 | return (int) rc; |
94 | } |
94 | } |
95 | 95 | ||
96 | 96 | ||
97 | int open(const char *name, int oflag, ...) |
97 | int open(const char *path, int oflag, ...) |
98 | { |
98 | { |
99 | int res; |
99 | int res; |
100 | ipcarg_t rc; |
100 | ipcarg_t rc; |
101 | ipc_call_t answer; |
101 | ipc_call_t answer; |
102 | aid_t req; |
102 | aid_t req; |
Line 110... | Line 110... | ||
110 | futex_up(&vfs_phone_futex); |
110 | futex_up(&vfs_phone_futex); |
111 | return res; |
111 | return res; |
112 | } |
112 | } |
113 | } |
113 | } |
114 | req = async_send_2(vfs_phone, VFS_OPEN, oflag, 0, &answer); |
114 | req = async_send_2(vfs_phone, VFS_OPEN, oflag, 0, &answer); |
115 | rc = ipc_data_write_start(vfs_phone, name, strlen(name)); |
115 | rc = ipc_data_write_start(vfs_phone, path, strlen(path)); |
116 | if (rc != EOK) { |
116 | if (rc != EOK) { |
117 | async_wait_for(req, NULL); |
117 | async_wait_for(req, NULL); |
118 | async_serialize_end(); |
118 | async_serialize_end(); |
119 | futex_up(&vfs_phone_futex); |
119 | futex_up(&vfs_phone_futex); |
120 | return (int) rc; |
120 | return (int) rc; |
Line 212... | Line 212... | ||
212 | return (off_t) -1; |
212 | return (off_t) -1; |
213 | 213 | ||
214 | return newoffs; |
214 | return newoffs; |
215 | } |
215 | } |
216 | 216 | ||
- | 217 | int ftruncate(int fildes, off_t length) |
|
- | 218 | { |
|
- | 219 | int res; |
|
- | 220 | ipcarg_t rc; |
|
- | 221 | ||
- | 222 | futex_down(&vfs_phone_futex); |
|
- | 223 | async_serialize_start(); |
|
- | 224 | if (vfs_phone < 0) { |
|
- | 225 | res = vfs_connect(); |
|
- | 226 | if (res < 0) { |
|
- | 227 | async_serialize_end(); |
|
- | 228 | futex_up(&vfs_phone_futex); |
|
- | 229 | return res; |
|
- | 230 | } |
|
- | 231 | } |
|
- | 232 | rc = async_req_2_0(vfs_phone, VFS_TRUNCATE, fildes, length); |
|
- | 233 | async_serialize_end(); |
|
- | 234 | futex_up(&vfs_phone_futex); |
|
- | 235 | return (int) rc; |
|
- | 236 | } |
|
- | 237 | ||
217 | /** @} |
238 | /** @} |
218 | */ |
239 | */ |