Make user_from_uid and group_from_gid return const char *, just like
NetBSD. Update man page to reflect this.
This commit is contained in:
parent
1b350b4542
commit
ae10a3fcce
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=92924
@ -70,7 +70,7 @@ int setgrent __P((void));
|
|||||||
void endgrent __P((void));
|
void endgrent __P((void));
|
||||||
void setgrfile __P((const char *));
|
void setgrfile __P((const char *));
|
||||||
int setgroupent __P((int));
|
int setgroupent __P((int));
|
||||||
char *group_from_gid __P((gid_t, int));
|
const char *group_from_gid __P((gid_t, int));
|
||||||
#endif
|
#endif
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ struct passwd *getpwent __P((void));
|
|||||||
int setpassent __P((int));
|
int setpassent __P((int));
|
||||||
void setpwent __P((void));
|
void setpwent __P((void));
|
||||||
void endpwent __P((void));
|
void endpwent __P((void));
|
||||||
char *user_from_uid __P((uid_t, int));
|
const char *user_from_uid __P((uid_t, int));
|
||||||
#endif
|
#endif
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
@ -42,10 +42,10 @@
|
|||||||
.Lb libc
|
.Lb libc
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.In pwd.h
|
.In pwd.h
|
||||||
.Ft char *
|
.Ft const char *
|
||||||
.Fn user_from_uid "unsigned long uid" "int nouser"
|
.Fn user_from_uid "unsigned long uid" "int nouser"
|
||||||
.In grp.h
|
.In grp.h
|
||||||
.Ft char *
|
.Ft const char *
|
||||||
.Fn group_from_gid "unsigned long gid" "int nogroup"
|
.Fn group_from_gid "unsigned long gid" "int nogroup"
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
|
@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#define NCACHE 64 /* power of 2 */
|
#define NCACHE 64 /* power of 2 */
|
||||||
#define MASK (NCACHE - 1) /* bits to store with */
|
#define MASK (NCACHE - 1) /* bits to store with */
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
user_from_uid(uid_t uid, int nouser)
|
user_from_uid(uid_t uid, int nouser)
|
||||||
{
|
{
|
||||||
static struct ncache {
|
static struct ncache {
|
||||||
@ -82,7 +82,7 @@ user_from_uid(uid_t uid, int nouser)
|
|||||||
return ((nouser && !cp->found) ? NULL : cp->name);
|
return ((nouser && !cp->found) ? NULL : cp->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
group_from_gid(gid_t gid, int nogroup)
|
group_from_gid(gid_t gid, int nogroup)
|
||||||
{
|
{
|
||||||
static struct ncache {
|
static struct ncache {
|
||||||
|
Loading…
Reference in New Issue
Block a user