lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 7 Mar 2007 17:32:29 +0100 (CET)
From:	Jiri Kosina <jikos@...os.cz>
To:	Jon Ringle <JRingle@...tical.com>
cc:	linux-kernel@...r.kernel.org
Subject: Re: tiny tty driver sample

On Wed, 7 Mar 2007, Jon Ringle wrote:

> I'm trying to write a tty driver and I'm using 
> http://lwn.net/images/pdf/LDD3/ch18.pdf as a guide. The sample tiny tty 
> driver includes the following code:
>             for (i = 0; i < data_size; ++i) {
>                         if (tty->flip.count >= TTY_FLIPBUF_SIZE)
>                                     tty_flip_buffer_push(tty);
>                         tty_insert_flip_char(tty, data[i], TTY_NORMAL);
>             }
>             tty_flip_buffer_push(tty);
> This doesn't compile against Linux 2.6.16 kernel I'm using, because 
> tty->flip.count doesn't exist anymore. How should this sample be 
> re-coded?

I guess something like

	tty_buffer_request_room(tty, data_size);
	for (i = 0; i < data_size; ++i)
		work += tty_insert_flip_char(tty, data[i], TTY_NORMAL);
	if (work)
		tty_flip_buffer_push(tty);

will do.

-- 
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ