Changeset 32fef47 in mainline
- Timestamp:
- 2012-04-23T17:37:39Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7719958, b1bd89ea
- Parents:
- 6aae539d
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/net/modules.c
r6aae539d r32fef47 93 93 } 94 94 95 /** Connect to the needed module. 96 * 97 * @param[in] need Needed module service. 98 * 99 * @return Session to the needed service. 100 * @return NULL if the connection timeouted. 101 * 102 */ 103 static async_sess_t *connect_to_service(services_t need) 104 { 105 return service_connect_blocking(EXCHANGE_SERIALIZE, need, 0, 0); 106 } 107 95 108 /** Create bidirectional connection with the needed module service and register 96 109 * the message receiver. … … 129 142 } 130 143 131 /** Connect to the needed module.132 *133 * @param[in] need Needed module service.134 *135 * @return Session to the needed service.136 * @return NULL if the connection timeouted.137 *138 */139 async_sess_t *connect_to_service(services_t need)140 {141 return service_connect_blocking(EXCHANGE_SERIALIZE, need, 0, 0);142 }143 144 /** Reply the data to the other party.145 *146 * @param[in] data The data buffer to be sent.147 * @param[in] data_length The buffer length.148 *149 * @return EOK on success.150 * @return EINVAL if the client does not expect the data.151 * @return EOVERFLOW if the client does not expect all the data.152 * Only partial data are transfered.153 * @return Other error codes as defined for the154 * async_data_read_finalize() function.155 *156 */157 int data_reply(void *data, size_t data_length)158 {159 size_t length;160 ipc_callid_t callid;161 162 /* Fetch the request */163 if (!async_data_read_receive(&callid, &length))164 return EINVAL;165 166 /* Check the requested data size */167 if (length < data_length) {168 async_data_read_finalize(callid, data, length);169 return EOVERFLOW;170 }171 172 /* Send the data */173 return async_data_read_finalize(callid, data, data_length);174 }175 176 144 /** Refresh answer structure and argument count. 177 145 * -
uspace/lib/c/include/net/modules.h
r6aae539d r32fef47 46 46 #include <sys/time.h> 47 47 48 /** Connect to module function type definition.49 *50 * @return Session to the service.51 *52 */53 typedef async_sess_t *connect_module_t(services_t);54 55 48 extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t); 56 49 extern async_sess_t *bind_service(services_t, sysarg_t, sysarg_t, sysarg_t, 57 50 async_client_conn_t); 58 extern async_sess_t *connect_to_service(services_t);59 extern int data_reply(void *, size_t);60 51 extern void refresh_answer(ipc_call_t *, size_t *); 61 52
Note:
See TracChangeset
for help on using the changeset viewer.