LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-06-2007, 11:38 PM   #1
d2e2004
LQ Newbie
 
Registered: Jul 2005
Location: palakkad
Posts: 11

Rep: Reputation: 0
Why the 'N_TTY_BUF_SIZE' is restricted as 4096?


Hi All,

I have one doubt in linux kernel. I.e. Why the 'N_TTY_BUF_SIZE' is defined as 4096 in 'tty.h' file. I have checked linux kernels from 2.6.10 to 2.6.23 in all these sources the tty buffer size value is defined as 4096. Due to this i couldnt able to read more than 4096 bytes from a serial device which is connected in 'ttyUSB0' using a single read operation.

If any one knows the reason pls share the same.

Thanks.
 
Old 12-07-2007, 05:16 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by d2e2004 View Post
I have one doubt in linux kernel. I.e. Why the 'N_TTY_BUF_SIZE' is defined as 4096 in 'tty.h' file.
Why not? It’s a nice big, round number (4K). There’s nothing inherently “special” about it.
Quote:
Originally Posted by d2e2004 View Post
I have checked linux kernels from 2.6.10 to 2.6.23 in all these sources the tty buffer size value is defined as 4096.
It is in fact this way all the way back until kernel 1.1.13 (when the tty line discipline was introduced). Prior to 1.1.13, the equivalent macro was 1024.
Quote:
Originally Posted by d2e2004 View Post
Due to this i couldnt able to read more than 4096 bytes from a serial device which is connected in 'ttyUSB0' using a single read operation.
Then use two read operations…
 
Old 12-08-2007, 03:38 AM   #3
d2e2004
LQ Newbie
 
Registered: Jul 2005
Location: palakkad
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you for your response...

why i asked about 4096 means when i changed the value of 'N_TTY_BUF_SIZE' to 8192 then also it works fine and reads 8192 bytes for a single read operation.
whether this change is legal and also whether it will produce any performance degradation?

And also with multiple read operations i couldn't able to read more than 5500 bytes from the device.

so pls specify the feasible option for reading large no of bytes from the device.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
4096 Limit RonGG Linux - Software 1 08-02-2007 02:19 PM
Directories always 4096 bytes? riwaJR Debian 4 04-03-2006 01:16 PM
connection reset after 4096 bytes when using FTP to access remote server socrates71 Linux - Networking 2 10-20-2005 08:37 AM
ls -la 4096 mikeshn Linux - General 4 08-31-2003 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration