Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 66374 Details for
Bug 80021
[PATCH] GNU/kFreeBSD support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
ttyname-based implementation
consoletype.c (text/plain), 818 bytes, created by
Robert Millan
on 2005-08-20 02:46:42 UTC
(
hide
)
Description:
ttyname-based implementation
Filename:
MIME Type:
Creator:
Robert Millan
Created:
2005-08-20 02:46:42 UTC
Size:
818 bytes
patch
obsolete
>/* consoletype.c > > simple app to figure out whether the current terminal > is serial, console (vt), or remote (pty). > > Copyright 2005 Robert Millan <robertmh@gnu.org> > Distributed under the terms of the GNU General Public License v2 >*/ > >#include <stdio.h> >#include <stdlib.h> /* exit */ >#include <unistd.h> > >main () > { > char *tty, *msg; > > tty = ttyname (0); > if (tty == NULL) > { > fprintf (stderr, "Not a tty.\n"); > exit (1); > } > > /* Nuke "/dev/" */ > tty += 5; > > if (!strncmp (tty, "ttyS", 4) || !strncmp (tty, "cuaa", 4)) > msg = "serial"; > else if (!strncmp (tty, "pts/", 4) || !strncmp (tty, "ttyp", 4)) > msg = "pty"; > else if (!strncmp (tty, "tty", 3)) > msg = "console"; > else > msg = "unknown"; > > printf ("%s\n", msg); > exit (0); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 80021
:
66374
|
78136