mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 07:15:58 +08:00
Update to FreeBSD head 2018-11-15
Git mirror commit a18b0830c4be01b39489a891b63d6023ada6358a. Update #3472.
This commit is contained in:
@@ -351,6 +351,7 @@ static int
|
||||
nss_configure(void)
|
||||
{
|
||||
static time_t confmod;
|
||||
static int already_initialized = 0;
|
||||
struct stat statbuf;
|
||||
int result, isthreaded;
|
||||
const char *path;
|
||||
@@ -368,6 +369,16 @@ nss_configure(void)
|
||||
if (path == NULL)
|
||||
#endif
|
||||
path = _PATH_NS_CONF;
|
||||
#ifndef NS_REREAD_CONF
|
||||
/*
|
||||
* Define NS_REREAD_CONF to have nsswitch notice changes
|
||||
* to nsswitch.conf(5) during runtime. This involves calling
|
||||
* stat(2) every time, which can result in performance hit.
|
||||
*/
|
||||
if (already_initialized)
|
||||
return (0);
|
||||
already_initialized = 1;
|
||||
#endif /* NS_REREAD_CONF */
|
||||
if (stat(path, &statbuf) != 0)
|
||||
return (0);
|
||||
if (statbuf.st_mtime <= confmod)
|
||||
|
@@ -136,6 +136,35 @@ caph_enter(void)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
caph_rights_limit(int fd, const cap_rights_t *rights)
|
||||
{
|
||||
|
||||
if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS)
|
||||
return (-1);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
caph_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds)
|
||||
{
|
||||
|
||||
if (cap_ioctls_limit(fd, cmds, ncmds) < 0 && errno != ENOSYS)
|
||||
return (-1);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
caph_fcntls_limit(int fd, uint32_t fcntlrights)
|
||||
{
|
||||
|
||||
if (cap_fcntls_limit(fd, fcntlrights) < 0 && errno != ENOSYS)
|
||||
return (-1);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
caph_enter_casper(void)
|
||||
|
Reference in New Issue
Block a user