tech-kern archive

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

Re: Length of wmesg for condvar?



On Mon, 9 Aug 2010, Matthew Mondor wrote:

On Mon, 9 Aug 2010 22:21:02 +0100
David Laight <david%l8s.co.uk@localhost> wrote:

On Mon, Aug 09, 2010 at 02:02:51PM -0700, Paul Goyette wrote:

Does anyone object to my going through and coming up with shorter names
(<= 8 chars) for these condvars?

It is worth chcking whether they are displayed with a "%.8s" format
(or similar) so that they don't need to be 0 terminated.
Otherwise the names must be strictly less than 8 bytes.

        David

--
David Laight: david%l8s.co.uk@localhost


That is worthy of concern, so I checked top and ps:

top uses
char wmesg[KI_WMESGLEN + 1];
strlcpy(wmesg, pp->p_wmesg, sizeof(wmesg));

ps uses
strprintorsetwidth(v, l->l_wmesg, mode);
v->width = min(v->width, KI_WMESGLEN);


Thanks for checking!

I'll plan on cleaning up at least some of these over the next few days, unless someone objects.


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index