Changeset 7719958 in mainline for uspace/lib/c/generic/net/modules.c


Ignore:
Timestamp:
2012-04-23T22:51:36Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6a3808e
Parents:
3293a94 (diff), 32fef47 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/modules.c

    r3293a94 r7719958  
    9393}
    9494
     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 */
     103static async_sess_t *connect_to_service(services_t need)
     104{
     105        return service_connect_blocking(EXCHANGE_SERIALIZE, need, 0, 0);
     106}
     107
    95108/** Create bidirectional connection with the needed module service and register
    96109 * the message receiver.
     
    129142}
    130143
    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 the
    154  *         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 
    176144/** Refresh answer structure and argument count.
    177145 *
Note: See TracChangeset for help on using the changeset viewer.