NameDateSize

..Today173

catman.8H A D15-Aug-20213.2 KiB

catman.cH A D13-Oct-201915 KiB

MakefileH A D29-Jun-2023327

pathnames.hH A D22-Dec-20161.8 KiB

README.hardlinksH A D29-May-20161.3 KiB

TODOH A D04-Apr-199929

README.hardlinks

1# $NetBSD: README.hardlinks,v 1.1 2016/05/29 22:32:03 dholland Exp $
2#
3
4catman.8 notes that this code doesn't handle hard links.
5
6To fix this, one might proceed as follows:
7
8(1) Add an additional data structure mapping (fsid_t, ino_t) pairs
9from stat to filenames.
10
11(2) In scanmandir(), in the readdir loop, next to the code that checks
12for a symlink, check if the page's linkcount > 1 (manstat.st_nlink > 1)
13and if so:
14   a. Check the new data structure to see if this file's been seen before.
15      If so, use the saved name of the page to construct a hard link in the
16      cat directory, and continue to the next directory entry.
17   b. If not, add to the new data structure to remember this page and
18      process it as normal.
19
20One might clear the data structure for each mandir or not; probably
21for each man tree is best. The size of the structure isn't
22prohibitive; but the chances of ever seeing the same hardlinked page
23in two different man trees (e.g. in both /usr/share/man and
24/usr/pkg/man) are pretty well zero.
25
26All of this seems like a SMOP, but it doesn't really seem worth doing
27at the moment given that we don't build catpages at all by default and
28they aren't particularly useful to have any more except on the slowest
29of slow hardware. I've left this note so that someone else can take it
30up if they see fit.
31
32 - dholland 20160529
33