diff options
author | jkh <jkh@FreeBSD.org> | 1997-04-29 05:26:05 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-04-29 05:26:05 +0000 |
commit | e2ef6a625f0f47896ca66ad15621eef18c956c3f (patch) | |
tree | 2afb09786a097e18b5da9bfdffbd76aa576a3d78 /bin/ps/print.c | |
parent | e3a67334252e979065753f5b0a592767c576f09d (diff) | |
download | FreeBSD-src-e2ef6a625f0f47896ca66ad15621eef18c956c3f.zip FreeBSD-src-e2ef6a625f0f47896ca66ad15621eef18c956c3f.tar.gz |
Dynamically adjust size of displayed username to the longest username which
appears, not the longest _maximum_ username (this should probably also go
into 2.2, for the day when we bump up the username length there too).
Submitted-By: Terry Lambert <terry@lambert.org>
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r-- | bin/ps/print.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c index aac505a..072d0fc 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: print.c,v 1.19 1997/02/22 14:05:05 peter Exp $ + * $Id: print.c,v 1.20 1997/04/16 16:08:11 jdp Exp $ */ #ifndef lint @@ -284,6 +284,17 @@ uname(k, ve) #endif } +int +s_uname(k) + KINFO *k; +{ +#ifndef NEWVM + return (strlen(user_from_uid(KI_PROC(k)->p_uid, 0))); +#else + return (strlen(user_from_uid(KI_EPROC(k)->e_ucred.cr_uid, 0))); +#endif +} + void runame(k, ve) KINFO *k; @@ -301,6 +312,17 @@ runame(k, ve) #endif } +int +s_runame(k) + KINFO *k; +{ +#ifndef NEWVM + return (strlen(user_from_uid(KI_PROC(k)->p_ruid, 0))); +#else + return (strlen(user_from_uid(KI_EPROC(k)->e_pcred.p_ruid, 0))); +#endif +} + void tdev(k, ve) KINFO *k; |