Changeset 72bde81 in mainline for uspace/lib
- Timestamp:
- 2008-01-27T14:59:32Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2db4ac8
- Parents:
- 1fe186f
- Location:
- uspace/lib/libc
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/vfs.c
r1fe186f r72bde81 38 38 #include <dirent.h> 39 39 #include <fcntl.h> 40 #include <sys/stat.h> 41 #include <sys/types.h> 40 42 #include <ipc/ipc.h> 41 43 #include <ipc/services.h> … … 132 134 } 133 135 136 int close(int fildes) 137 { 138 return 0; /* TODO */ 139 } 140 134 141 ssize_t read(int fildes, void *buf, size_t nbyte) 135 142 { … … 210 217 off_t newoffs; 211 218 rc = async_req_3_1(vfs_phone, VFS_SEEK, fildes, offset, whence, 212 &newoffs);219 (ipcarg_t)&newoffs); 213 220 214 221 async_serialize_end(); … … 275 282 } 276 283 277 int close(int fildes) 278 { 279 return 0; /* TODO */ 284 int mkdir(const char *path, mode_t mode) 285 { 286 int res; 287 ipcarg_t rc; 288 ipc_call_t answer; 289 aid_t req; 290 291 futex_down(&vfs_phone_futex); 292 async_serialize_start(); 293 if (vfs_phone < 0) { 294 res = vfs_connect(); 295 if (res < 0) { 296 async_serialize_end(); 297 futex_up(&vfs_phone_futex); 298 return res; 299 } 300 } 301 req = async_send_1(vfs_phone, VFS_MKDIR, mode, &answer); 302 rc = ipc_data_write_start(vfs_phone, path, strlen(path)); 303 if (rc != EOK) { 304 async_wait_for(req, NULL); 305 async_serialize_end(); 306 futex_up(&vfs_phone_futex); 307 return (int) rc; 308 } 309 async_wait_for(req, &rc); 310 async_serialize_end(); 311 futex_up(&vfs_phone_futex); 312 return EOK; 280 313 } 281 314 -
uspace/lib/libc/include/sys/types.h
r1fe186f r72bde81 41 41 typedef signed long ssize_t; 42 42 typedef long off_t; 43 typedef int mode_t; 43 44 44 45 #endif
Note:
See TracChangeset
for help on using the changeset viewer.