Changeset 007e6efa in mainline for uspace/app/klog/klog.c
- Timestamp:
- 2011-01-28T15:44:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4db1fbf
- Parents:
- ae0300b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
rae0300b5 r007e6efa 37 37 #include <stdio.h> 38 38 #include <ipc/ipc.h> 39 #include <ipc/ns.h> 39 40 #include <async.h> 40 41 #include <ipc/services.h> … … 79 80 int main(int argc, char *argv[]) 80 81 { 81 size_t klog_pages; 82 if (sysinfo_get_value("klog.pages", &klog_pages) != EOK) { 83 printf("%s: Error getting klog address\n", NAME); 84 return -1; 85 } 86 87 size_t klog_size = klog_pages * PAGE_SIZE; 88 klog_length = klog_size / sizeof(wchar_t); 89 90 klog = (wchar_t *) as_get_mappable_page(klog_size); 82 klog = service_klog_share_in(&klog_length); 91 83 if (klog == NULL) { 92 printf("%s: Error allocating memory area\n", NAME); 93 return -1; 94 } 95 96 int res = async_share_in_start_1_0(PHONE_NS, (void *) klog, 97 klog_size, SERVICE_MEM_KLOG); 98 if (res != EOK) { 99 printf("%s: Error initializing memory area\n", NAME); 84 printf("%s: Error accessing to klog\n", NAME); 100 85 return -1; 101 86 } … … 109 94 * Mode "a" would be definitively much better here, but it is 110 95 * not well supported by the FAT driver. 111 *112 96 */ 113 97 log = fopen(LOG_FNAME, "w");
Note:
See TracChangeset
for help on using the changeset viewer.