mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 04:59:59 +08:00
Update to FreeBSD head 2017-06-01
Git mirror commit dfb26efac4ce9101dda240e94d9ab53f80a9e131. Update #3472.
This commit is contained in:
@@ -583,6 +583,7 @@ cleanup_bands(netband_head *head)
|
||||
nb = LIST_FIRST(head);
|
||||
if (nb == NULL)
|
||||
break;
|
||||
LIST_REMOVE(nb, next);
|
||||
free(nb);
|
||||
}
|
||||
}
|
||||
|
@@ -116,7 +116,7 @@ void
|
||||
verrc(int eval, int code, const char *fmt, va_list ap)
|
||||
{
|
||||
if (err_file == NULL)
|
||||
err_set_file((FILE *)0);
|
||||
err_set_file(NULL);
|
||||
fprintf(err_file, "%s: ", _getprogname());
|
||||
if (fmt != NULL) {
|
||||
vfprintf(err_file, fmt, ap);
|
||||
@@ -143,7 +143,7 @@ void
|
||||
verrx(int eval, const char *fmt, va_list ap)
|
||||
{
|
||||
if (err_file == NULL)
|
||||
err_set_file((FILE *)0);
|
||||
err_set_file(NULL);
|
||||
fprintf(err_file, "%s: ", _getprogname());
|
||||
if (fmt != NULL)
|
||||
vfprintf(err_file, fmt, ap);
|
||||
@@ -185,7 +185,7 @@ void
|
||||
vwarnc(int code, const char *fmt, va_list ap)
|
||||
{
|
||||
if (err_file == NULL)
|
||||
err_set_file((FILE *)0);
|
||||
err_set_file(NULL);
|
||||
fprintf(err_file, "%s: ", _getprogname());
|
||||
if (fmt != NULL) {
|
||||
vfprintf(err_file, fmt, ap);
|
||||
@@ -207,7 +207,7 @@ void
|
||||
vwarnx(const char *fmt, va_list ap)
|
||||
{
|
||||
if (err_file == NULL)
|
||||
err_set_file((FILE *)0);
|
||||
err_set_file(NULL);
|
||||
fprintf(err_file, "%s: ", _getprogname());
|
||||
if (fmt != NULL)
|
||||
vfprintf(err_file, fmt, ap);
|
||||
|
@@ -43,9 +43,12 @@
|
||||
* when they are not required.
|
||||
*/
|
||||
#ifdef __rtems__
|
||||
#define __isthreaded 1
|
||||
#define __isthreaded 1
|
||||
#else /* __rtems__ */
|
||||
#ifndef __LIBC_ISTHREADED_DECLARED
|
||||
#define __LIBC_ISTHREADED_DECLARED
|
||||
extern int __isthreaded;
|
||||
#endif
|
||||
#endif /* __rtems__ */
|
||||
|
||||
/*
|
||||
@@ -311,6 +314,7 @@ struct pollfd;
|
||||
struct rusage;
|
||||
struct sigaction;
|
||||
struct sockaddr;
|
||||
struct stat;
|
||||
struct timespec;
|
||||
struct timeval;
|
||||
struct timezone;
|
||||
@@ -327,8 +331,10 @@ int __sys_clock_nanosleep(__clockid_t, int,
|
||||
const struct timespec *, struct timespec *);
|
||||
int __sys_close(int);
|
||||
int __sys_connect(int, const struct sockaddr *, __socklen_t);
|
||||
__ssize_t __sys_getdirentries(int, char *, __size_t, __off_t *);
|
||||
int __sys_fcntl(int, int, ...);
|
||||
int __sys_fdatasync(int);
|
||||
int __sys_fstatat(int, const char *, struct stat *, int);
|
||||
int __sys_fsync(int);
|
||||
__pid_t __sys_fork(void);
|
||||
int __sys_ftruncate(int, __off_t);
|
||||
|
@@ -41,21 +41,17 @@
|
||||
* Lock structure with room for debugging information.
|
||||
*/
|
||||
struct _spinlock {
|
||||
volatile long access_lock;
|
||||
volatile long lock_owner;
|
||||
volatile char *fname;
|
||||
volatile int lineno;
|
||||
long spare1;
|
||||
long spare2;
|
||||
void *thr_extra;
|
||||
int spare3;
|
||||
};
|
||||
typedef struct _spinlock spinlock_t;
|
||||
|
||||
#define _SPINLOCK_INITIALIZER { 0, 0, 0, 0 }
|
||||
|
||||
#define _SPINUNLOCK(_lck) _spinunlock(_lck);
|
||||
#ifdef _LOCK_DEBUG
|
||||
#define _SPINLOCK(_lck) _spinlock_debug(_lck, __FILE__, __LINE__)
|
||||
#else
|
||||
#define _SPINLOCK(_lck) _spinlock(_lck)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Thread function prototype definitions:
|
||||
@@ -64,7 +60,6 @@ __BEGIN_DECLS
|
||||
long _atomic_lock(volatile long *);
|
||||
void _spinlock(spinlock_t *);
|
||||
void _spinunlock(spinlock_t *);
|
||||
void _spinlock_debug(spinlock_t *, char *, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SPINLOCK_H_ */
|
||||
|
@@ -457,7 +457,6 @@ getnameinfo_link(const struct afd *afd,
|
||||
host, hostlen);
|
||||
/*
|
||||
* The following have zero-length addresses.
|
||||
* IFT_ATM (net/if_atmsubr.c)
|
||||
* IFT_GIF (net/if_gif.c)
|
||||
* IFT_LOOP (net/if_loop.c)
|
||||
* IFT_PPP (net/if_ppp.c, net/if_spppsubr.c)
|
||||
|
@@ -110,18 +110,19 @@ xprt_register(SVCXPRT *xprt)
|
||||
rwlock_wrlock(&svc_fd_lock);
|
||||
if (__svc_xports == NULL) {
|
||||
__svc_xports = (SVCXPRT **)
|
||||
mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *));
|
||||
mem_alloc((FD_SETSIZE + 1) * sizeof(SVCXPRT *));
|
||||
if (__svc_xports == NULL) {
|
||||
rwlock_unlock(&svc_fd_lock);
|
||||
return;
|
||||
}
|
||||
memset(__svc_xports, '\0', FD_SETSIZE * sizeof(SVCXPRT *));
|
||||
memset(__svc_xports, '\0', (FD_SETSIZE + 1) * sizeof(SVCXPRT *));
|
||||
}
|
||||
if (sock < FD_SETSIZE) {
|
||||
__svc_xports[sock] = xprt;
|
||||
FD_SET(sock, &svc_fdset);
|
||||
svc_maxfd = max(svc_maxfd, sock);
|
||||
}
|
||||
} else if (sock == FD_SETSIZE)
|
||||
__svc_xports[sock] = xprt;
|
||||
rwlock_unlock(&svc_fd_lock);
|
||||
}
|
||||
|
||||
@@ -159,7 +160,8 @@ __xprt_do_unregister(SVCXPRT *xprt, bool_t dolock)
|
||||
if (__svc_xports[svc_maxfd])
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((sock == FD_SETSIZE) && (__svc_xports[sock] == xprt))
|
||||
__svc_xports[sock] = NULL;
|
||||
if (dolock)
|
||||
rwlock_unlock(&svc_fd_lock);
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <locale.h>
|
||||
#include <libutil.h>
|
||||
|
||||
static const int maxscale = 7;
|
||||
static const int maxscale = 6;
|
||||
|
||||
int
|
||||
humanize_number(char *buf, size_t len, int64_t quotient,
|
||||
@@ -66,7 +66,7 @@ humanize_number(char *buf, size_t len, int64_t quotient,
|
||||
return (-1);
|
||||
if (scale < 0)
|
||||
return (-1);
|
||||
else if (scale >= maxscale &&
|
||||
else if (scale > maxscale &&
|
||||
((scale & ~(HN_AUTOSCALE|HN_GETSCALE)) != 0))
|
||||
return (-1);
|
||||
if ((flags & HN_DIVISOR_1000) && (flags & HN_IEC_PREFIXES))
|
||||
|
Reference in New Issue
Block a user