Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset d768d4c in mainline


Ignore:
Timestamp:
2013-03-23T13:55:17Z (7 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
master
Children:
37ea333
Parents:
a4165561
Message:

libc: Add call preserving data read handlers.

Location:
uspace/lib/c
Files:
2 edited

Legend:

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

    ra4165561 rd768d4c  
    22792279bool async_data_read_receive(ipc_callid_t *callid, size_t *size)
    22802280{
     2281        ipc_call_t data;
     2282        return async_data_read_receive_call(callid, &data, size);
     2283}
     2284
     2285/** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework.
     2286 *
     2287 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ
     2288 * calls so that the user doesn't have to remember the meaning of each IPC
     2289 * argument.
     2290 *
     2291 * So far, this wrapper is to be used from within a connection fibril.
     2292 *
     2293 * @param callid Storage for the hash of the IPC_M_DATA_READ.
     2294 * @param size   Storage for the maximum size. Can be NULL.
     2295 *
     2296 * @return True on success, false on failure.
     2297 *
     2298 */
     2299bool async_data_read_receive_call(ipc_callid_t *callid, ipc_call_t *data,
     2300    size_t *size)
     2301{
    22812302        assert(callid);
    2282        
    2283         ipc_call_t data;
    2284         *callid = async_get_call(&data);
    2285        
    2286         if (IPC_GET_IMETHOD(data) != IPC_M_DATA_READ)
     2303        assert(data);
     2304       
     2305        *callid = async_get_call(data);
     2306       
     2307        if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_READ)
    22872308                return false;
    22882309       
    22892310        if (size)
    2290                 *size = (size_t) IPC_GET_ARG2(data);
     2311                *size = (size_t) IPC_GET_ARG2(*data);
    22912312       
    22922313        return true;
  • uspace/lib/c/include/async.h

    ra4165561 rd768d4c  
    399399extern int async_data_read_start(async_exch_t *, void *, size_t);
    400400extern bool async_data_read_receive(ipc_callid_t *, size_t *);
     401extern bool async_data_read_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    401402extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    402403
Note: See TracChangeset for help on using the changeset viewer.