- Timestamp:
- 2011-05-16T13:38:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4e1a2f5
- Parents:
- e0f52bf
- Location:
- uspace
- Files:
-
- 3 edited
-
app/klog/klog.c (modified) (3 diffs)
-
lib/c/generic/event.c (modified) (1 diff)
-
lib/c/include/event.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
re0f52bf rf9061b4 74 74 fsync(fileno(log)); 75 75 } 76 77 event_unmask(EVENT_KLOG); 76 78 } 77 79 … … 111 113 } 112 114 113 rc = event_subscribe(EVENT_KLOG, 0);114 if (rc != EOK) {115 fprintf(stderr, "%s: Unable to register klog notifications\n",116 NAME);117 return rc;118 }119 120 115 log = fopen(LOG_FNAME, "a"); 121 116 if (log == NULL) … … 124 119 125 120 async_set_interrupt_received(interrupt_received); 121 rc = event_subscribe(EVENT_KLOG, 0); 122 if (rc != EOK) { 123 fclose(log); 124 fprintf(stderr, "%s: Unable to register klog notifications\n", 125 NAME); 126 return rc; 127 } 128 129 event_unmask(EVENT_KLOG); 130 126 131 klog_update(); 127 132 async_manager(); -
uspace/lib/c/generic/event.c
re0f52bf rf9061b4 41 41 #include <kernel/ipc/event_types.h> 42 42 43 /** Subscribe forevent notifications.43 /** Subscribe event notifications. 44 44 * 45 * @param evno Event number.46 * @param method Use thismethod for notifying me.45 * @param evno Event type to subscribe. 46 * @param imethod Use this interface and method for notifying me. 47 47 * 48 48 * @return Value returned by the kernel. 49 * 49 50 */ 50 int event_subscribe(event_type_t e , sysarg_tmethod)51 int event_subscribe(event_type_t evno, sysarg_t imethod) 51 52 { 52 return __SYSCALL2(SYS_EVENT_SUBSCRIBE, (sysarg_t) e, (sysarg_t) method); 53 return __SYSCALL2(SYS_EVENT_SUBSCRIBE, (sysarg_t) evno, 54 (sysarg_t) imethod); 55 } 56 57 /** Unmask event notifications. 58 * 59 * @param evno Event type to unmask. 60 * 61 * @return Value returned by the kernel. 62 * 63 */ 64 int event_unmask(event_type_t evno) 65 { 66 return __SYSCALL1(SYS_EVENT_UNMASK, (sysarg_t) evno); 53 67 } 54 68 -
uspace/lib/c/include/event.h
re0f52bf rf9061b4 39 39 40 40 extern int event_subscribe(event_type_t, sysarg_t); 41 extern int event_unmask(event_type_t); 41 42 42 43 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
