The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] question about V7 ls(1) vs. sys/stat.h and ls.c
@ 2003-05-23  3:44 Michael Sokolov
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Sokolov @ 2003-05-23  3:44 UTC (permalink / raw)


Chris Palmer <chris at nodewarrior.org> wrote:

> What's with that "511" in there?

To divide by N rounding up you first add N-1, then divide by N.

MS



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [TUHS] question about V7 ls(1) vs. sys/stat.h and ls.c
@ 2003-05-25 16:22 Kirk McKusick
  0 siblings, 0 replies; 6+ messages in thread
From: Kirk McKusick @ 2003-05-25 16:22 UTC (permalink / raw)


The st_blocks field was first added to the stat structure in 4.2BSD
(4.1b really) as part of the overhaul to add the new filesystem. I
added it because the variable filesystem blocksize made it difficult
to compute the amount of storage dedicated to a file.

	Kirk McKusick



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [TUHS] question about V7 ls(1) vs. sys/stat.h and ls.c
@ 2003-05-22  9:24 Aharon Robbins
  2003-05-23  3:32 ` Chris Palmer
  0 siblings, 1 reply; 6+ messages in thread
From: Aharon Robbins @ 2003-05-22  9:24 UTC (permalink / raw)


Greetings all.

The V7 ls(1) man page says that the -s option, which prints total
blocks, includes any indirect blocks.

However, the V7 struct stat didn't have the st_blocks member in the
struct stat, and the code in ls.c uses

	long
	nblock(size)
	long size;
	{
		return((size+511)>>9);
	}

So, is this just a case of the man page being mistaken?

When did the struct stat acquire the st_blocks member?

While I'm at it, the V7 ls -a option only adds . and .. to the
list; apparently all other dot files were printed by default.
When did ls change such that -a applied to all dot files?

Thanks,

Arnold Robbins



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-25 16:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-23  3:44 [TUHS] question about V7 ls(1) vs. sys/stat.h and ls.c Michael Sokolov
  -- strict thread matches above, loose matches on Subject: below --
2003-05-25 16:22 Kirk McKusick
2003-05-22  9:24 Aharon Robbins
2003-05-23  3:32 ` Chris Palmer
2003-05-23  4:02   ` M. Warner Losh
2003-05-23  4:17   ` Greg 'groggy' Lehey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).