Changeset 82405266 in mainline
- Timestamp:
- 2008-06-03T15:05:07Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d51db07
- Parents:
- eda8b8b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/vfs/vfs.c
reda8b8b r82405266 49 49 #include <errno.h> 50 50 #include <string.h> 51 #include <ipc/devmap.h> 51 52 #include "../../srv/vfs/vfs.h" 52 53 … … 103 104 } 104 105 106 static int device_get_handle(char *name, dev_handle_t *handle) 107 { 108 int phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, DEVMAP_CLIENT, 0); 109 if (phone < 0) 110 return phone; 111 112 ipc_call_t answer; 113 aid_t req = async_send_2(phone, DEVMAP_DEVICE_GET_HANDLE, 0, 0, 114 &answer); 115 116 ipcarg_t retval = ipc_data_write_start(phone, name, strlen(name) + 1); 117 118 if (retval != EOK) { 119 async_wait_for(req, NULL); 120 ipc_hangup(phone); 121 return retval; 122 } 123 124 async_wait_for(req, &retval); 125 126 if (handle != NULL) 127 *handle = -1; 128 129 if (retval == EOK) { 130 if (handle != NULL) 131 *handle = (dev_handle_t) IPC_GET_ARG1(answer); 132 } 133 134 ipc_hangup(phone); 135 return retval; 136 } 137 105 138 int mount(const char *fs_name, const char *mp, const char *dev) 106 139 { … … 108 141 ipcarg_t rc; 109 142 aid_t req; 110 111 dev_handle_t dev_handle = 0; /* TODO */ 112 143 dev_handle_t dev_handle; 144 145 res = device_get_handle(dev, &dev_handle); 146 if (res != EOK) 147 return res; 148 113 149 size_t mpa_len; 114 150 char *mpa = absolutize(mp, &mpa_len);
Note:
See TracChangeset
for help on using the changeset viewer.