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

Changeset f74392f in mainline


Ignore:
Timestamp:
2010-02-18T15:28:56Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
bc9da2a
Parents:
c7315dd
Message:

Add async framework wrappers for IPC_M_CONNECT_ME_TO.

Location:
uspace/lib/libc
Files:
2 edited

Legend:

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

    rc7315dd rf74392f  
    11011101}
    11021102
     1103/** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
     1104 *
     1105 * Ask through phone for a new connection to some service.
     1106 *
     1107 * @param phoneid       Phone handle used for contacting the other side.
     1108 * @param arg1          User defined argument.
     1109 * @param arg2          User defined argument.
     1110 * @param arg3          User defined argument.
     1111 *
     1112 * @return              New phone handle on success or a negative error code.
     1113 */
     1114int
     1115async_connect_me_to(int phoneid, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3)
     1116{
     1117        int rc;
     1118        ipcarg_t newphid;
     1119
     1120        rc = async_req_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, NULL,
     1121            NULL, NULL, NULL, &newphid);
     1122       
     1123        if (rc != EOK) 
     1124                return rc;
     1125
     1126        return newphid;
     1127}
     1128
     1129/** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
     1130 *
     1131 * Ask through phone for a new connection to some service and block until
     1132 * success.
     1133 *
     1134 * @param phoneid       Phone handle used for contacting the other side.
     1135 * @param arg1          User defined argument.
     1136 * @param arg2          User defined argument.
     1137 * @param arg3          User defined argument.
     1138 *
     1139 * @return              New phone handle on success or a negative error code.
     1140 */
     1141int
     1142async_connect_me_to_blocking(int phoneid, ipcarg_t arg1, ipcarg_t arg2,
     1143    ipcarg_t arg3)
     1144{
     1145        int rc;
     1146        ipcarg_t newphid;
     1147
     1148        rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
     1149            IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid);
     1150       
     1151        if (rc != EOK) 
     1152                return rc;
     1153
     1154        return newphid;
     1155}
     1156
    11031157/** Wrapper for making IPC_M_SHARE_IN calls using the async framework.
    11041158 *
  • uspace/lib/libc/include/async.h

    rc7315dd rf74392f  
    259259}
    260260
     261extern int async_connect_me_to(int, ipcarg_t, ipcarg_t, ipcarg_t);
     262extern int async_connect_me_to_blocking(int, ipcarg_t, ipcarg_t, ipcarg_t);
     263
    261264/*
    262265 * User-friendly wrappers for async_share_in_start().
Note: See TracChangeset for help on using the changeset viewer.