LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2007, 03:17 AM   #1
d2e2004
LQ Newbie
 
Registered: Jul 2005
Location: palakkad
Posts: 11

Rep: Reputation: 0
Lightbulb 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. but when i increased the value 'N_TTY_BUF_SIZE' in tty.h file it reads characters upto increased values.

If any one knows the reason for restricting the 'N_TTY_BUF_SIZE' to 4096pls share the same.

Thanks.
 
Old 12-07-2007, 10:05 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I can't answer your question, but fail to see how this (can't
read more than 4096 bytes in one operation) is a problem. There
has to be some arbitrary value, and I *guess* that 4096 may be
something to do with the block-size for LZW compression.



Cheers,
Tink
 
Old 12-10-2007, 03:36 AM   #3
d2e2004
LQ Newbie
 
Registered: Jul 2005
Location: palakkad
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for your response!!!

what i am saying is as of now with a single read operation i can read only 4096 bytes from the device. To read more than 4096 bytes i have to use multiple read operations. using this also i couldnt able to read more than 5500 bytes.

so i have increased the value of 'N_TTY_BUF_SIZE'.
please say whether this change will cause any performance degradation. If so what is the optimal solution for reading large no of data from the device.

Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Why the 'N_TTY_BUF_SIZE' is restricted as 4096? d2e2004 Linux - Hardware 2 12-08-2007 03:38 AM
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
ls -la 4096 mikeshn Linux - General 4 08-31-2003 08:27 PM


All times are GMT -5. The time now is 09:14 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration