Changeset 007e6efa in mainline for uspace/app/klog/klog.c


Ignore:
Timestamp:
2011-01-28T15:44:39Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4db1fbf
Parents:
ae0300b5
Message:
  • libc routines for registering services and connecting to services via NS
  • async_connect_to_me()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/klog/klog.c

    rae0300b5 r007e6efa  
    3737#include <stdio.h>
    3838#include <ipc/ipc.h>
     39#include <ipc/ns.h>
    3940#include <async.h>
    4041#include <ipc/services.h>
     
    7980int main(int argc, char *argv[])
    8081{
    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);
    9183        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);
    10085                return -1;
    10186        }
     
    10994         * Mode "a" would be definitively much better here, but it is
    11095         * not well supported by the FAT driver.
    111          *
    11296         */
    11397        log = fopen(LOG_FNAME, "w");
Note: See TracChangeset for help on using the changeset viewer.