Changeset ed5367b in mainline for uspace/lib/sysman/src/ctl.c
- Timestamp:
- 2019-08-07T10:01:13Z (6 years ago)
- Children:
- a097c50
- Parents:
- 68ae40a
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-11-05 01:52:07)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-07 10:01:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/sysman/src/ctl.c
r68ae40a red5367b 34 34 #include <sysman/sysman.h> 35 35 36 int sysman_unit_handle(const char *unit_name, unit_handle_t *handle_ptr) 37 { 38 async_exch_t *exch = sysman_exchange_begin(SYSMAN_PORT_CTL); 39 40 ipc_call_t call; 41 aid_t req = async_send_0(exch, SYSMAN_CTL_UNIT_HANDLE, &call); 42 sysarg_t rc = async_data_write_start(exch, unit_name, str_size(unit_name)); 43 sysman_exchange_end(exch); 44 45 if (rc != EOK) { 46 async_forget(req); 47 return rc; 48 } 49 50 async_wait_for(req, &rc); 51 if (rc == EOK) { 52 *handle_ptr = IPC_GET_ARG1(call); 53 } 54 return rc; 55 } 56 36 57 /* 37 58 * TODO … … 41 62 * broker knows when appropriate exposee is created and the request succeeded. 42 63 * Still though, it's necessary to centralize timeout into sysman. 64 * TODO convert to name->handle API 43 65 */ 44 66 int sysman_unit_start(const char *unit_name, int flags) … … 56 78 57 79 async_wait_for(req, &rc); 80 return rc; 81 } 82 83 int sysman_unit_stop(unit_handle_t handle, int flags) 84 { 85 async_exch_t *exch = sysman_exchange_begin(SYSMAN_PORT_CTL); 86 87 int rc = async_req_2_0(exch, SYSMAN_CTL_UNIT_STOP, handle, flags); 88 sysman_exchange_end(exch); 89 58 90 return rc; 59 91 }
Note:
See TracChangeset
for help on using the changeset viewer.