summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-03-22 02:35:47 +0000
committerimp <imp@FreeBSD.org>2002-03-22 02:35:47 +0000
commitbb8112f72f4be228031dbf39fdda008479370138 (patch)
tree1896b3c9e45afc5d3a9cdc4a5309f9ba61f9262b
parentd8370f667da0469f2618c75d4827cd30d389f233 (diff)
downloadFreeBSD-src-bb8112f72f4be228031dbf39fdda008479370138.zip
FreeBSD-src-bb8112f72f4be228031dbf39fdda008479370138.tar.gz
Make user_from_uid and group_from_gid return const char *, just like
NetBSD. Update man page to reflect this.
-rw-r--r--include/grp.h2
-rw-r--r--include/pwd.h2
-rw-r--r--lib/libc/gen/pwcache.34
-rw-r--r--lib/libc/gen/pwcache.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/include/grp.h b/include/grp.h
index 8ac0371..e8a0702 100644
--- a/include/grp.h
+++ b/include/grp.h
@@ -70,7 +70,7 @@ int setgrent __P((void));
void endgrent __P((void));
void setgrfile __P((const char *));
int setgroupent __P((int));
-char *group_from_gid __P((gid_t, int));
+const char *group_from_gid __P((gid_t, int));
#endif
__END_DECLS
diff --git a/include/pwd.h b/include/pwd.h
index 9a9398d..ca8c42f 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -106,7 +106,7 @@ struct passwd *getpwent __P((void));
int setpassent __P((int));
void setpwent __P((void));
void endpwent __P((void));
-char *user_from_uid __P((uid_t, int));
+const char *user_from_uid __P((uid_t, int));
#endif
__END_DECLS
diff --git a/lib/libc/gen/pwcache.3 b/lib/libc/gen/pwcache.3
index eb2f9e0..dc8c77c 100644
--- a/lib/libc/gen/pwcache.3
+++ b/lib/libc/gen/pwcache.3
@@ -42,10 +42,10 @@
.Lb libc
.Sh SYNOPSIS
.In pwd.h
-.Ft char *
+.Ft const char *
.Fn user_from_uid "unsigned long uid" "int nouser"
.In grp.h
-.Ft char *
+.Ft const char *
.Fn group_from_gid "unsigned long gid" "int nogroup"
.Sh DESCRIPTION
The
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
index e5ed90b..cb2aa42 100644
--- a/lib/libc/gen/pwcache.c
+++ b/lib/libc/gen/pwcache.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
#define NCACHE 64 /* power of 2 */
#define MASK (NCACHE - 1) /* bits to store with */
-char *
+const char *
user_from_uid(uid_t uid, int nouser)
{
static struct ncache {
@@ -82,7 +82,7 @@ user_from_uid(uid_t uid, int nouser)
return ((nouser && !cp->found) ? NULL : cp->name);
}
-char *
+const char *
group_from_gid(gid_t gid, int nogroup)
{
static struct ncache {
OpenPOWER on IntegriCloud