summaryrefslogtreecommitdiff
path: root/usr/src/cmd/prstat
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/prstat')
-rw-r--r--usr/src/cmd/prstat/prtable.c13
-rw-r--r--usr/src/cmd/prstat/prtable.h9
2 files changed, 10 insertions, 12 deletions
diff --git a/usr/src/cmd/prstat/prtable.c b/usr/src/cmd/prstat/prtable.c
index f94766f786..e0fe3ded13 100644
--- a/usr/src/cmd/prstat/prtable.c
+++ b/usr/src/cmd/prstat/prtable.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -49,7 +48,7 @@ lwpid_init()
(void) memset(&plwp_tbl, 0, sizeof (plwp_t *) * PLWP_TBL_SZ);
}
-static int
+static uid_t
pwd_getid(char *name)
{
struct passwd *pwd;
@@ -60,12 +59,12 @@ pwd_getid(char *name)
}
void
-pwd_getname(int uid, char *name, int length)
+pwd_getname(uid_t uid, char *name, int length)
{
struct passwd *pwd;
if ((pwd = getpwuid(uid)) == NULL) {
- (void) snprintf(name, length, "%d", uid);
+ (void) snprintf(name, length, "%u", uid);
} else {
(void) snprintf(name, length, "%s", pwd->pw_name);
}
diff --git a/usr/src/cmd/prstat/prtable.h b/usr/src/cmd/prstat/prtable.h
index 9911c90e43..e33ea9e2d0 100644
--- a/usr/src/cmd/prstat/prtable.h
+++ b/usr/src/cmd/prstat/prtable.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -76,7 +75,7 @@ typedef struct plwp { /* linked list of pointers to lwps */
struct plwp *l_next;
} plwp_t;
-extern void pwd_getname(int, char *, int);
+extern void pwd_getname(uid_t, char *, int);
extern void add_uid(nametbl_t *, char *);
extern int has_uid(nametbl_t *, uid_t);
extern void add_element(table_t *, long);