mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 01:42:56 +08:00
Update to FreeBSD 8.4
This commit is contained in:
@@ -76,6 +76,19 @@ void _rtld_error(const char *fmt, ...);
|
||||
#define FLOCKFILE(fp) if (__isthreaded) _FLOCKFILE(fp)
|
||||
#define FUNLOCKFILE(fp) if (__isthreaded) _funlockfile(fp)
|
||||
|
||||
struct _spinlock;
|
||||
extern struct _spinlock __stdio_thread_lock;
|
||||
#define STDIO_THREAD_LOCK() \
|
||||
do { \
|
||||
if (__isthreaded) \
|
||||
_SPINLOCK(&__stdio_thread_lock); \
|
||||
} while (0)
|
||||
#define STDIO_THREAD_UNLOCK() \
|
||||
do { \
|
||||
if (__isthreaded) \
|
||||
_SPINUNLOCK(&__stdio_thread_lock); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Indexes into the pthread jump table.
|
||||
*
|
||||
@@ -226,4 +239,7 @@ extern int __sys_fcntl(int, int, ...);
|
||||
/* execve() with PATH processing to implement posix_spawnp() */
|
||||
int _execvpe(const char *, char * const *, char * const *);
|
||||
|
||||
struct dl_phdr_info;
|
||||
int __elf_phdr_match_addr(struct dl_phdr_info *, void *);
|
||||
|
||||
#endif /* _LIBC_PRIVATE_H_ */
|
||||
|
@@ -847,8 +847,6 @@ set_source(struct ai_order *aio, struct policyhead *ph)
|
||||
struct in6_ifreq ifr6;
|
||||
u_int32_t flags6;
|
||||
|
||||
/* XXX: interface name should not be hardcoded */
|
||||
strncpy(ifr6.ifr_name, "lo0", sizeof(ifr6.ifr_name));
|
||||
memset(&ifr6, 0, sizeof(ifr6));
|
||||
memcpy(&ifr6.ifr_addr, ai.ai_addr, ai.ai_addrlen);
|
||||
if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) {
|
||||
@@ -1576,7 +1574,8 @@ ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid)
|
||||
if (*scope == '\0')
|
||||
return -1;
|
||||
|
||||
if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
|
||||
if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
|
||||
IN6_IS_ADDR_MC_NODELOCAL(a6)) {
|
||||
/*
|
||||
* We currently assume a one-to-one mapping between links
|
||||
* and interfaces, so we simply use interface indices for
|
||||
|
@@ -461,7 +461,7 @@ inet6_opt_append(void *extbuf, socklen_t extlen, int offset, u_int8_t type,
|
||||
int
|
||||
inet6_opt_finish(void *extbuf, socklen_t extlen, int offset)
|
||||
{
|
||||
int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0;;
|
||||
int updatelen = offset > 0 ? (1 + ((offset - 1) | 7)) : 0;
|
||||
|
||||
if (extbuf) {
|
||||
u_int8_t *padp;
|
||||
|
@@ -200,6 +200,7 @@ static struct hostent *_hpmapv6(struct hostent *, int *);
|
||||
#endif
|
||||
static struct hostent *_hpsort(struct hostent *, res_state);
|
||||
|
||||
#ifdef INET6
|
||||
static struct hostent *_hpreorder(struct hostent *);
|
||||
static int get_addrselectpolicy(struct policyhead *);
|
||||
static void free_addrselectpolicy(struct policyhead *);
|
||||
@@ -209,6 +210,7 @@ static void set_source(struct hp_order *, struct policyhead *);
|
||||
static int matchlen(struct sockaddr *, struct sockaddr *);
|
||||
static int comp_dst(const void *, const void *);
|
||||
static int gai_addr2scopetype(struct sockaddr *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions defined in RFC2553
|
||||
@@ -285,8 +287,10 @@ getipnodebyname(const char *name, int af, int flags, int *errp)
|
||||
|
||||
hp = gethostbyname2(name, af);
|
||||
hp = _hpcopy(hp, errp);
|
||||
|
||||
#ifdef INET6
|
||||
if (af == AF_INET6)
|
||||
hp = _hpreorder(hp);
|
||||
|
||||
if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) &&
|
||||
MAPADDRENABLED(flags)) {
|
||||
struct hostent *hp2 = gethostbyname2(name, AF_INET);
|
||||
@@ -309,7 +313,7 @@ getipnodebyname(const char *name, int af, int flags, int *errp)
|
||||
*errp = statp->res_h_errno;
|
||||
|
||||
statp->options = options;
|
||||
return _hpreorder(_hpsort(hp, statp));
|
||||
return _hpsort(hp, statp);
|
||||
}
|
||||
|
||||
struct hostent *
|
||||
@@ -632,6 +636,7 @@ _hpsort(struct hostent *hp, res_state statp)
|
||||
return hp;
|
||||
}
|
||||
|
||||
#ifdef INET6
|
||||
/*
|
||||
* _hpreorder: sort address by default address selection
|
||||
*/
|
||||
@@ -884,8 +889,6 @@ set_source(struct hp_order *aio, struct policyhead *ph)
|
||||
struct in6_ifreq ifr6;
|
||||
u_int32_t flags6;
|
||||
|
||||
/* XXX: interface name should not be hardcoded */
|
||||
strncpy(ifr6.ifr_name, "lo0", sizeof(ifr6.ifr_name));
|
||||
memset(&ifr6, 0, sizeof(ifr6));
|
||||
memcpy(&ifr6.ifr_addr, &ss, ss.ss_len);
|
||||
if (_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == 0) {
|
||||
@@ -1111,3 +1114,4 @@ gai_addr2scopetype(struct sockaddr *sa)
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user