aboutsummaryrefslogtreecommitdiff
path: root/console-client/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'console-client/console.c')
-rw-r--r--console-client/console.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/console-client/console.c b/console-client/console.c
index 019ea3f1..06a8c1ac 100644
--- a/console-client/console.c
+++ b/console-client/console.c
@@ -64,6 +64,24 @@ static char *console_node;
/* Callbacks for input source drivers. */
+/* Returns current console ID. */
+error_t
+console_current_id (int *cur)
+{
+ vcons_t vcons;
+
+ mutex_lock (&global_lock);
+ vcons = active_vcons;
+ if (!vcons)
+ {
+ mutex_unlock (&global_lock);
+ return ENODEV;
+ }
+ *cur = vcons->id;
+ mutex_unlock (&global_lock);
+ return 0;
+}
+
/* Switch the active console to console ID or DELTA (relative to the
active console). */
error_t