summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv')
-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
4 files changed, 20 insertions, 7 deletions
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. */