[comp.unix.wizards] How big is BUFSIZ on your system?

lm@slovax.Eng.Sun.COM (Larry McVoy) (04/09/91)

Hi-
	I'm tryng to figure out if BUFSIZ == 1024 on all the machines
out there.  If you were to reply to this mesage, and (from vi) say:

!!grep BUFSIZ /usr/include/stdio.h

as well as (from vi)

!!cat /etc/motd

I would appreciate it a lot.  If /etc/motd does not identify the 
machine/OS you are running, could you add that as well?

Thanks much,
---
Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm@sun.com

gwyn@smoke.brl.mil (Doug Gwyn) (04/09/91)

In article <539@appserv.Eng.Sun.COM> bufsiz@slovax.sun.com writes:
>I'm tryng to figure out if BUFSIZ == 1024 on all the machines out there.

Certainly not.  I've seen it vary from 512 to 8192.

gamiddle@watmath.waterloo.edu (Guy Middleton) (04/11/91)

In article <539@appserv.Eng.Sun.COM> bufsiz@slovax.sun.com writes:
> 	I'm tryng to figure out if BUFSIZ == 1024 on all the machines
> out there.  If you were to reply to this mesage, and (from vi) say:
> 
> !!grep BUFSIZ /usr/include/stdio.h

Not very helpful here:

% grep BUFSIZ /usr/include/stdio.h
#define BUFSIZ	4096
#define BUFSIZ	4096
#define BUFSIZ	1024
#define BUFSIZ	512

tim@mismpc.dal.fsd.mot.com (Tim Dawson) (04/12/91)

gamiddle@watmath.waterloo.edu (Guy Middleton) writes:

>In article <539@appserv.Eng.Sun.COM> bufsiz@slovax.sun.com writes:
>> 	I'm tryng to figure out if BUFSIZ == 1024 on all the machines
>> out there.  If you were to reply to this mesage, and (from vi) say:
>> 
>> !!grep BUFSIZ /usr/include/stdio.h

On the Motorola family of systems BUFSIZ is set to 4096 for the 88K (RISC) 
systems and to 1024 on the 680x0 systems.

clewis@ferret.ocunix.on.ca (Chris Lewis) (04/12/91)

In article <539@appserv.Eng.Sun.COM> bufsiz@slovax.sun.com writes:
>	I'm tryng to figure out if BUFSIZ == 1024 on all the machines
>out there.  If you were to reply to this mesage, and (from vi) say:

>!!grep BUFSIZ /usr/include/stdio.h

#define BUFSIZ	4096
#define BUFSIZ	1024
#define BUFSIZ	512
#define BUFSIZ 1024

>as well as (from vi)

>!!cat /etc/motd

Welcome to Chris's Machine

>I would appreciate it a lot.

Does this help? ;-)

It would have been a lot simpler if you just asked: "if you're
stdio buffer size != 1024, please tell me what your machine/OS
is."  Being overly helpful in how the information is retrieved
will just confuse you.  Most System V's have stdio.h's that look
like this - the BUFSIZ's are ifdef'd for various machines.

My BUFSIZ (3b1 3.5.1.4) is really 1024.  V7's are usually 512
and that 4096 you see up there is some flavour of S/370 UNIX.
-- 
Chris Lewis, Phone: (613) 832-0541, Internet: clewis@ferret.ocunix.on.ca
UUCP: uunet!mitel!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request@eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!

rmc@snitor.UUCP (Russell Crook) (04/12/91)

In article <1396@ecicrl.ocunix.on.ca> clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
>In article <539@appserv.Eng.Sun.COM> bufsiz@slovax.sun.com writes:
>>	I'm tryng to figure out if BUFSIZ == 1024 on all the machines
>>out there....
Chris Lewis Replies:
>
>My BUFSIZ (3b1 3.5.1.4) is really 1024.  V7's are usually 512
>and that 4096 you see up there is some flavour of S/370 UNIX.

It gets worse.  In our environment, we have three BUFSIZ's
to contend with: 4096 on our MIPS 2030s, 2048 on the Targon/35s
(Pyramid 90x in other clothes), and 1024 on everything else
(five other machine/OS types).  I wouldn't be surprised if something like
UNICOS uses something even bigger (8192 or even 16384).

512 is likely to the rarest of the lot.  There aren't many V7s around.

-- 
Russell Crook, Siemens Nixdorf Information Systems Sietec Open Systems Division
2235 Sheppard Ave. E., Willowdale, Ontario Canada M2J 5B5   +1 416 496 8510
      "... technology so advanced, even we don't know what it does."
CAN/EU/USA rmc.tor@sni.ca/rmc.tor@sni.de/rmc.tor@sni-usa.com or uunet!snitor!rmc

dik@cwi.nl (Dik T. Winter) (04/14/91)

In article <1991Apr12.164916.12188@snitor.uucp> rmc@snitor.UUCP (Russell Crook) writes:
 > It gets worse.  In our environment, we have three BUFSIZ's
 > to contend with: 4096 on our MIPS 2030s, 2048 on the Targon/35s
 > (Pyramid 90x in other clothes), and 1024 on everything else
 > (five other machine/OS types).  I wouldn't be surprised if something like
 > UNICOS uses something even bigger (8192 or even 16384).
Having access to an YMP I cannot let this go.  It is true:
#define	BUFSIZ	(4096*8)
(you do the arithmetic yourself!).
--
dik t. winter, cwi, amsterdam, nederland
dik@cwi.nl

slootman@dri.nl (Paul Slootman) (04/15/91)

In article <3320@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes:
>Having access to an YMP I cannot let this go.  It is true:
>#define	BUFSIZ	(4096*8)
>(you do the arithmetic yourself!).

For those who can't handle the arithmetic, we have *the* machine:
a ICL DRS500 running a SysV.2-ish system on top of a tahoe kernel:
	/usr/include/nstdio.h:#define BUFSIZ	(8*1024)
	/usr/include/stdio.h:#define BUFSIZ	(1*1024)
I guess "nstdio.h" are for the sufficiently advanced users :-)

Paul.
-- 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
: slootman@dri.nl           : You are wise, witty and wonderful, but you      :
: ...!hp4nl!dri500!slootman : spend too much time reading this sort of trash. :
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

rbj@uunet.UU.NET (Root Boy Jim) (04/23/91)

Someone asked how big BUFSIZ. On BSD systems, it doesn't really matter,
as stdio stat's the file to find the optimum blocksize for each file.
BLKSIZ is only used when this info is not available.
-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane

guy@auspex.auspex.com (Guy Harris) (04/24/91)

>BLKSIZ is only used when this info is not available.

Or if you use "setbuf()", in which case the info, even though it's
available, isn't usable; "setbuf()" is, for historical and other
reasons, obliged to assume that the buffer you've handed it is BUFSIZ
"char"s in size.