Changeset 2703b824 in mainline
- Timestamp:
- 2012-04-15T22:36:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 709476f4
- Parents:
- f6af126
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/device/clock_dev.c
rf6af126 r2703b824 75 75 } 76 76 77 /** Set the current time 78 * 79 * @param sess Session of the device 80 * @param t The current time that will be written to the device 81 * 82 * @return EOK on success or a negative error code 83 */ 84 int 85 clock_dev_time_set(async_sess_t *sess, struct tm *t) 86 { 87 ipc_call_t answer; 88 aid_t req; 89 int ret; 90 91 async_exch_t *exch = async_exchange_begin(sess); 92 93 req = async_send_1(exch, DEV_IFACE_ID(CLOCK_DEV_IFACE), 94 CLOCK_DEV_TIME_SET, &answer); 95 ret = async_data_write_start(exch, t, sizeof(*t)); 96 97 async_exchange_end(exch); 98 99 sysarg_t rc; 100 if (ret != EOK) { 101 async_wait_for(req, &rc); 102 if (rc == EOK) 103 return ret; 104 } 105 106 async_wait_for(req, &rc); 107 if ((int) rc != EOK) 108 return ret; 109 110 return (int) IPC_GET_ARG1(answer); 111 } 112 77 113 /** @} 78 114 */ -
uspace/lib/c/include/device/clock_dev.h
rf6af126 r2703b824 45 45 46 46 extern int clock_dev_time_get(async_sess_t *, struct tm *); 47 extern int clock_dev_time_set(async_sess_t *, struct tm *); 47 48 48 49 #endif
Note:
See TracChangeset
for help on using the changeset viewer.