struct group * (*)(gid_t));
#endif
#if __XSI_VISIBLE
/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */
void setgrent(void);
int setgrent(void);
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
int getgrgid_r(gid_t, struct group *, char *, size_t,
unsigned short
*seed48(unsigned short[3]);
#ifndef _SETKEY_DECLARED
int setkey(const char *);
void setkey(const char *);
#define _SETKEY_DECLARED
char *setstate(/* const */ char *);
void sethostid(long);
int sethostname(const char *, int);
int setlogin(const char *);
locale_t duplocale(locale_t base);
int freelocale(locale_t loc);
void freelocale(locale_t loc);
locale_t newlocale(int mask, const char *locale, locale_t base);
const char *querylocale(int mask, locale_t loc);
locale_t uselocale(locale_t loc);
"WARNING! setkey(3) not present in the system!");
/* ARGSUSED */
int
void
setkey(const char *key __unused)
{
fprintf(stderr, "WARNING! setkey(3) not present in the system!\n");
return (0);
}
__warn_references(encrypt,
.\" From: @(#)getgrent.3 8.2 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
.Dd April 16, 2003
.Dd July 26, 2016
.Dt GETGRENT 3
.Os
.Sh NAME
.Fn getgrgid_r "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result"
.Ft int
.Fn setgroupent "int stayopen"
.Ft void
.Fn setgrent void
.Fn endgrent void
.Dv NULL
and the return value is 0, no matching entry exists.)
.Pp
The functions
The function
.Fn setgroupent
and
returns the value 1 if successful, otherwise the value
.Fn setgrent
return the value 1 if successful, otherwise the value
0 is returned.
.Fn endgrent
.Fn endgrent ,
.Fn setgrfile
have no return value.
return (rv);
setgrent(void)
(void)_nsdispatch(NULL, setgrent_dtab, NSDB_GROUP, "setgrent", defaultsrc, 0);
return (1);
.\" SUCH DAMAGE.
.Dd September 17, 2011
.Dt FREELOCALE 3
.Lb libc
.Sh SYNOPSIS
.In locale.h
.Fn freelocale "locale_t locale"
.Sh DESCRIPTION
Frees a
This relinquishes any resources held exclusively by this locale.
Note that locales share reference-counted components,
so a call to this function is not guaranteed to free all of the components.
.Sh RETURN VALUES
Returns 0 on success or -1 on error.
.Sh SEE ALSO
.Xr duplocale 3 ,
.Xr localeconv 3 ,
.Xr uselocale 3 ,
.Xr xlocale 3
.Sh STANDARDS
The
This function conforms to
.Fn freelocale
.St -p1003.1-2008 .
function
differs from
.St -p1003.1-2008
in that its return type is
.Vt int
rather than
.Vt void .
* Free a locale_t. This is quite a poorly named function. It actually
* disclaims a reference to a locale_t, rather than freeing it.
*/
freelocale(locale_t loc)
/* Fail if we're passed something that isn't a locale. */
if ((NULL == loc) || (LC_GLOBAL_LOCALE == loc)) {
/*
return (-1);
* Fail if we're passed something that isn't a locale. If we're
* passed the global locale, pretend that we freed it but don't
/* If we're passed the global locale, pretend that we freed it but don't
* actually do anything.
* actually do anything. */
if (&__xlocale_global_locale == loc) {
if (loc != NULL && loc != LC_GLOBAL_LOCALE &&
loc != &__xlocale_global_locale)
xlocale_release(loc);