summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/getaddrinfo.c17
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c4
-rw-r--r--sysdeps/unix/sysv/linux/ifaddrs.c5
-rw-r--r--sysdeps/unix/sysv/linux/sched_getaffinity.c7
-rw-r--r--sysdeps/unix/sysv/linux/sys/inotify.h11
5 files changed, 36 insertions, 8 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index a78c670bfb..a35b8662d5 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -1202,6 +1202,21 @@ static const struct prefixentry default_labels[] =
= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
96, 4 },
+ /* The next two entries differ from RFC 3484. We need to treat
+ IPv6 site-local addresses special because they are never NATed,
+ unlike site-locale IPv4 addresses. If this would not happen, on
+ machines which have only IPv4 and IPv6 site-local addresses, the
+ sorting would prefer the IPv6 site-local addresses, causing
+ unnecessary delays when trying to connect to a global IPv6 address
+ through a site-local IPv6 address. */
+ { { .in6_u
+ = { .u6_addr8 = { 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
+ 10, 5 },
+ { { .in6_u
+ = { .u6_addr8 = { 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
+ 7, 6 },
{ { .in6_u
= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
@@ -1231,7 +1246,7 @@ static const struct prefixentry default_precedence[] =
{ { .in6_u
= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } },
- 96, 100 },
+ 96, 10 },
{ { .in6_u
= { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } },
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index 963b40d91d..836cbf3922 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -39,9 +39,9 @@
# ifndef __ASSUME_GETDENTS64_SYSCALL
# ifndef __GETDENTS
/* The variable is shared between all *getdents* calls. */
-int __have_no_getdents64;
+int __have_no_getdents64 attribute_hidden;
# else
-extern int __have_no_getdents64;
+extern int __have_no_getdents64 attribute_hidden;
# endif
# define have_no_getdents64_defined 1
# endif
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c
index e6720f0ca2..82495de03e 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -89,10 +89,11 @@ __netlink_free_handle (struct netlink_handle *h)
static int
__netlink_sendreq (struct netlink_handle *h, int type)
{
- struct
+ struct req
{
struct nlmsghdr nlh;
struct rtgenmsg g;
+ char pad[0];
} req;
struct sockaddr_nl nladdr;
@@ -105,6 +106,8 @@ __netlink_sendreq (struct netlink_handle *h, int type)
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = h->seq;
req.g.rtgen_family = AF_UNSPEC;
+ if (sizeof (req) != offsetof (struct req, pad))
+ memset (req.pad, '\0', sizeof (req) - offsetof (struct req, pad));
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
diff --git a/sysdeps/unix/sysv/linux/sched_getaffinity.c b/sysdeps/unix/sysv/linux/sched_getaffinity.c
index c0a6eb81b9..ab171123b0 100644
--- a/sysdeps/unix/sysv/linux/sched_getaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_getaffinity.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
#include <sched.h>
#include <string.h>
#include <sysdep.h>
+#include <sys/param.h>
#include <sys/types.h>
#include <shlib-compat.h>
@@ -28,8 +29,8 @@
int
__sched_getaffinity_new (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
{
- int res = INLINE_SYSCALL (sched_getaffinity, 3, pid, sizeof (cpu_set_t),
- cpuset);
+ int res = INLINE_SYSCALL (sched_getaffinity, 3, pid,
+ MIN (INT_MAX, cpusetsize), cpuset);
if (res != -1)
{
/* Clean the rest of the memory the kernel didn't do. */
diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h
index c498fe8f18..0131db9d3e 100644
--- a/sysdeps/unix/sysv/linux/sys/inotify.h
+++ b/sysdeps/unix/sysv/linux/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -54,7 +54,16 @@ struct inotify_event
#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */
#define IN_IGNORED 0x00008000 /* File was ignored. */
+/* Helper events. */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */
+
/* Special flags. */
+#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a
+ directory. */
+#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */
+#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already
+ existing watch. */
#define IN_ISDIR 0x40000000 /* Event occurred against dir. */
#define IN_ONESHOT 0x80000000 /* Only send event once. */