Changeset 5ae1c51 in mainline for uspace/lib/c/generic/async.c


Ignore:
Timestamp:
2013-03-23T13:10:28Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
71780e0
Parents:
939871a
Message:

libc: Add data write handler that preserves call data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    r939871a r5ae1c51  
    23832383bool async_data_write_receive(ipc_callid_t *callid, size_t *size)
    23842384{
     2385        ipc_call_t data;
     2386        return async_data_write_receive_call(callid, &data, size);
     2387}
     2388
     2389/** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework.
     2390 *
     2391 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE
     2392 * calls so that the user doesn't have to remember the meaning of each IPC
     2393 * argument.
     2394 *
     2395 * So far, this wrapper is to be used from within a connection fibril.
     2396 *
     2397 * @param callid Storage for the hash of the IPC_M_DATA_WRITE.
     2398 * @param data   Storage for the ipc call data.
     2399 * @param size   Storage for the suggested size. May be NULL.
     2400 *
     2401 * @return True on success, false on failure.
     2402 *
     2403 */
     2404bool async_data_write_receive_call(ipc_callid_t *callid, ipc_call_t *data,
     2405    size_t *size)
     2406{
    23852407        assert(callid);
    2386        
    2387         ipc_call_t data;
    2388         *callid = async_get_call(&data);
    2389        
    2390         if (IPC_GET_IMETHOD(data) != IPC_M_DATA_WRITE)
     2408        assert(data);
     2409       
     2410        *callid = async_get_call(data);
     2411       
     2412        if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_WRITE)
    23912413                return false;
    23922414       
    23932415        if (size)
    2394                 *size = (size_t) IPC_GET_ARG2(data);
     2416                *size = (size_t) IPC_GET_ARG2(*data);
    23952417       
    23962418        return true;
Note: See TracChangeset for help on using the changeset viewer.