diff options
Diffstat (limited to 'src/ck-sysdeps-solaris.c')
-rw-r--r-- | src/ck-sysdeps-solaris.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/ck-sysdeps-solaris.c b/src/ck-sysdeps-solaris.c index c1b1b64..ba7d5aa 100644 --- a/src/ck-sysdeps-solaris.c +++ b/src/ck-sysdeps-solaris.c @@ -379,3 +379,38 @@ ck_get_max_num_consoles (guint *num) return ret; } + +char * +ck_get_console_device_for_num (guint num) +{ + char *device; + + device = g_strdup_printf ("/dev/vt/%u", num); + + return device; +} + +gboolean +ck_get_console_num_from_device (const char *device, + guint *num) +{ + guint n; + gboolean ret; + + n = 0; + ret = FALSE; + + if (device == NULL) { + return FALSE; + } + + if (sscanf (device, "/dev/vt/%u", &n) == 1) { + ret = TRUE; + } + + if (num != NULL) { + *num = n; + } + + return ret; +} |