From: devzero@web.de
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: serial console _after_ boot ? - was: Redirect kernel console
Date: Thu, 03 Jan 2008 17:02:56 +0100 [thread overview]
Message-ID: <83883214@web.de> (raw)
> This errno is so out of place.
yes, that was stupid.
anyway:
# strace ./mytiocons
--snipp--
open("/dev/ttyS0", O_RDWR) = 3
ioctl(0, TIOCCONS) = -1 EBUSY (Device or resource busy)
ioctl(3, TIOCCONS) = -1 EBUSY (Device or resource busy)
--snipp--
man tty_ioctl is telling:
Redirecting console output
TIOCCONS void
Redirect output that would have gone to
/dev/console or /dev/tty0 to the given tty. If that was a pty master, send it to the slave. Anybody can do this as long as the output was not redirected yet. If it was redirected already EBUSY is returned, but root may stop redirection by using this ioctl with fd pointing at /dev/console or /dev/tty0.
but it doesn`t seem to make any difference if i do that ioctl on /dev/console or /dev/tty0 , because i`m getting EBUSY there, too
>
>
> On Jan 3 2008 15:39, devzero@web.de wrote:
> >fantastic, thanks!
> >
> >unfortunately......
> >
> >opensuse103:/home/roland/serialcons # ./mytioccons
> >ioctl: Device or resource busy
> >
> >but i`m not deep enough into programming to understand this.
> >
>
> >int main(void)
> >{
> >int fd = open("/dev/ttyS0", O_RDWR);
> >int errno;
>
> This errno is so out of place.
>
> >
> >ioctl(0, TIOCCONS, NULL);
> >
> >if (ioctl(fd, TIOCCONS, NULL) < 0)
> > printf("ioctl: %s\n", strerror(errno));
> >}
>
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
next reply other threads:[~2008-01-03 16:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-03 16:02 devzero [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-03 20:29 serial console _after_ boot ? - was: Redirect kernel console devzero
2008-01-03 14:39 devzero
2008-01-03 15:04 ` Jan Engelhardt
2008-01-03 12:43 devzero
2008-01-03 13:27 ` Jan Engelhardt
2008-01-03 17:55 ` Miquel van Smoorenburg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83883214@web.de \
--to=devzero@web.de \
--cc=jengelh@computergmbh.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox