Changeset 77ad86c in mainline for uspace/lib/c/generic/inet.c
- Timestamp:
- 2012-06-01T19:00:32Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b713ff80
- Parents:
- 4e5dabf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inet.c
r4e5dabf r77ad86c 44 44 { 45 45 async_exch_t *exch = async_exchange_begin(inet_sess); 46 46 47 47 ipc_call_t answer; 48 48 aid_t req = async_send_0(exch, INET_CALLBACK_CREATE, &answer); 49 49 int rc = async_connect_to_me(exch, 0, 0, 0, inet_cb_conn, NULL); 50 50 async_exchange_end(exch); 51 51 52 52 if (rc != EOK) 53 53 return rc; 54 54 55 55 sysarg_t retval; 56 56 async_wait_for(req, &retval); 57 if (retval != EOK) 58 return retval; 59 60 return EOK; 57 58 return retval; 61 59 } 62 60 63 61 static int inet_set_proto(uint8_t protocol) 64 62 { 65 int rc;66 67 63 async_exch_t *exch = async_exchange_begin(inet_sess); 68 rc = async_req_1_0(exch, INET_SET_PROTO, protocol);64 int rc = async_req_1_0(exch, INET_SET_PROTO, protocol); 69 65 async_exchange_end(exch); 70 66 71 67 return rc; 72 68 } … … 80 76 assert(inet_ev_ops == NULL); 81 77 assert(inet_protocol == 0); 82 78 83 79 rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc, 84 80 IPC_FLAG_BLOCKING); 85 81 if (rc != EOK) 86 82 return ENOENT; 87 83 88 84 inet_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc, 89 85 IPC_FLAG_BLOCKING); 90 86 if (inet_sess == NULL) 91 87 return ENOENT; 92 88 93 89 if (inet_set_proto(protocol) != EOK) { 94 90 async_hangup(inet_sess); … … 96 92 return EIO; 97 93 } 98 94 99 95 if (inet_callback_create() != EOK) { 100 96 async_hangup(inet_sess); … … 102 98 return EIO; 103 99 } 104 100 105 101 inet_protocol = protocol; 106 102 inet_ev_ops = ev_ops;
Note:
See TracChangeset
for help on using the changeset viewer.