[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Why isn't STREAM_MAX == FOPEN_MAX?



 [ sent to debian-devel, and bcc'd to the local user's group ]

 Please direct me to where I ought to be asking this question so that
 I'm most likely going to get an answer, if here's not the place.


 I'm working the examples in "Advanced Programming in the UNIX
 Environment", by W. Richard Stevens.  In chapter 2, "Unix
 Standardization and Implementations", the first program is one that
 calls on the `sysconf' and `pathconf' functions to print various
 limits.

 On my system, which has several kernel patches and one patch to
 "types.h" applied[1] (hence the large value for OPEN_MAX), the
 program produces the following output:

504$ ./print-limits .
ARG_MAX                 = 131072
CHILD_MAX               = 999
clock ticks/second      = 100
NGROUPS_MAX             = 32
OPEN_MAX                = 3000
STREAM_MAX              = 8       <==== Isn't this too low?
TZNAME_MAX              = 3
_POSIX_JOB_CONTROL      = 1
_POSIX_SAVED_IDS        = 1
_POSIX_VERSION          = 199309
MAX_CANON               = 255
MAX_INPUT               = 255
_POSIX_VDISABLE         = 0
LINK_MAX                = 127
NAME_MAX                = 255
PATH_MAX                = 1024
PIPE_BUF                = 4096
_POSIX_NO_TRUNC         = 1
_POSIX_CHOWN_RESTRICTED = 1

 On page 36, there is a table (figure 2.5), and in that table, it
 says, under STREAM_MAX, that "if defined, it must have the same value
 as FOPEN_MAX".  A `gid' search for FOPEN_MAX turned it up in
 "stdio_lim.h", defined as 256.  STREAM_MAX is defined in
 "xopen_lim.h" as _POSIX_STREAM_MAX, which in turn is defined in
 "posix1_lim.h" as 8.

 Q: Shouldn't STREAM_MAX = FOPEN_MAX, as stated in "APUE"?

 I'm just a beginner, and have no way of knowing how these defines are
 used in real life, or whether the values are reasonable or not.

Footnotes: 
[1]  I've applied the patches from www.linuxhq.org for max num
     subprocesses, max open files, and max socket conn.  The
     "types.h" patch changes __FD_SET_SIZE.
     


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: