[comp.unix.aix] Strange behaviour of statfs

liesert@nixdorf.de (Hansi) (11/27/90)

Hi out there,

I had a problem using statfs(). In a C-program I tried to evaluate the
block size of a filesystem by calling statfs() (surely I made all the
stuff needed like includes etc.). Although all my filesystems have block
of 512 bytes, statfs() reports block size 2048. Am I wrong, or is it AIX?

Thanks for your help
--
| Hans Joachim Liesert, Dep. STO-SI 35   | Email:  liesert.pad@sni.de      |
| Siemens-Nixdorf Informationssysteme AG | Outside Europe:                 |
| Pontanusstrasse 55                     |         liesert.pad@nixdorf.com |
| W-4790 Paderborn, Germany              | Disc.: I don't speak for SNI!!! |

dcm@nostromo.austin.ibm.com (craig miller) (11/28/90)

In article <liesert.659704660@peun33> liesert@nixdorf.de (Hansi) writes:
>Hi out there,

	Howdy. (fake Texas accent here...)

>I had a problem using statfs(). In a C-program I tried to evaluate the
>block size of a filesystem by calling statfs() (surely I made all the
>stuff needed like includes etc.). Although all my filesystems have block
>of 512 bytes, statfs() reports block size 2048. Am I wrong, or is it AIX?

	I'm only about 98% sure about this, but I think AIXV2.2.1 runs a
	2K filesystem.  Even though various programs such as df talk in
	1/2K blocks, I'm pretty sure block allocations are done 2K at a
	time.  I think statfs() is correct.  To test (on a quiet /tmp):

	df /tmp				# note "free" column (in 1/2K blocks)
	echo "hello world" > /tmp/t	# allocate 1 'filesystem' block
	df /tmp				# note "free" dropped by 4 blocks (2K)


>Thanks for your help
>--
>| Hans Joachim Liesert, Dep. STO-SI 35   | Email:  liesert.pad@sni.de      |
>| Siemens-Nixdorf Informationssysteme AG | Outside Europe:                 |
>| Pontanusstrasse 55                     |         liesert.pad@nixdorf.com |
>| W-4790 Paderborn, Germany              | Disc.: I don't speak for SNI!!! |

	Sure.  Hope it helped...

		Craig Miller
------
	Craig Miller
	Locus Computing Corporation, Austin, TX.
	UUCP: ..!cs.utexas.edu!ibmchs!auschs!slaughter!dcm
	"I do not represent LCC or IBM.  I represent myself (usually)."