Changeset 9f1328cd in mainline for uspace/app/date/date.c
- Timestamp:
- 2012-04-03T15:01:31Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d73a56d
- Parents:
- aeef318
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/date/date.c
raeef318 r9f1328cd 33 33 #include <errno.h> 34 34 #include <loc.h> 35 #include <time.h> 35 36 36 37 #define NAME "date" … … 45 46 char *svc_name = NULL; 46 47 char *devpath; 48 devman_handle_t devh; 49 struct tm t; 47 50 48 51 /* Get the id of the clock category */ … … 88 91 printf("Found device %s\n", devpath); 89 92 93 /* Get the device's handle */ 94 rc = devman_fun_get_handle("/hw/pci0/00:01.0/cmos-rtc/a", &devh, IPC_FLAG_BLOCKING); 95 if (rc != EOK) { 96 printf(NAME ": Cannot open the device\n"); 97 goto exit; 98 } 99 100 printf("OPEN!\n"); 101 102 /* Now connect to the device */ 103 async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, 104 devh, IPC_FLAG_BLOCKING); 105 if (!sess) { 106 printf(NAME ": Cannot connect to the device\n"); 107 goto exit; 108 } 109 110 printf("CONNECTED!\n"); 111 112 /* Read the current date */ 113 rc = clock_dev_time_get(sess, &t); 114 if (rc != EOK) { 115 printf(NAME ": Cannot read the current time\n"); 116 goto exit; 117 } 118 119 printf("SUCCESS!\n"); 120 fflush(stdout); 121 90 122 exit: 91 123 free(svc_name);
Note:
See TracChangeset
for help on using the changeset viewer.