From 8e351378b76880f861bdcda8fc11d5769e310a00 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 5 Oct 2007 18:55:57 +0000 Subject: [PATCH] * sysdeps/gnu/netinet/tcp.h: Define TCP_MD5SIG, TCP_MD5SIG_MAXKEYLEN, struct tcp_md5sig. Extend struct tcp_info according to recent kernels. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add eventfd, evetnfd_read, eventfd_write. * sysdeps/unix/sysv/linux/eventfd.c: New file. * sysdeps/unix/sysv/linux/eventfd_read.c: New file. * sysdeps/unix/sysv/linux/eventfd_write.c: New file. * sysdeps/unix/sysv/linux/sys/eventfd.h: New file. * sysdeps/unix/sysv/linux/Versions: Export eventfd, evetnfd_read, eventfd_write for GLIBC_2.7. --- ChangeLog | 12 ++++++++++++ sysdeps/gnu/netinet/tcp.h | 19 +++++++++++++++++++ sysdeps/unix/sysv/linux/signalfd.c | 12 +++++++++++- sysdeps/unix/sysv/linux/sys/signalfd.h | 3 ++- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7141bc671..bf0e268955 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2007-10-05 Ulrich Drepper + * sysdeps/gnu/netinet/tcp.h: Define TCP_MD5SIG, TCP_MD5SIG_MAXKEYLEN, + struct tcp_md5sig. Extend struct tcp_info according to recent kernels. + + * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add eventfd, + evetnfd_read, eventfd_write. + * sysdeps/unix/sysv/linux/eventfd.c: New file. + * sysdeps/unix/sysv/linux/eventfd_read.c: New file. + * sysdeps/unix/sysv/linux/eventfd_write.c: New file. + * sysdeps/unix/sysv/linux/sys/eventfd.h: New file. + * sysdeps/unix/sysv/linux/Versions: Export eventfd, evetnfd_read, + eventfd_write for GLIBC_2.7. + * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add signalfd. * sysdeps/unix/sysv/linux/signalfd.c: New file. * sysdeps/unix/sysv/linux/sys/signalfd.h: New file. diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h index 2c04ec9b7f..2ab2909f20 100644 --- a/sysdeps/gnu/netinet/tcp.h +++ b/sysdeps/gnu/netinet/tcp.h @@ -50,6 +50,7 @@ #define TCP_INFO 11 /* Information about this connection. */ #define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ #define TCP_CONGESTION 13 /* Congestion control algorithm. */ +#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ #ifdef __USE_MISC # include @@ -219,6 +220,24 @@ struct tcp_info u_int32_t tcpi_snd_cwnd; u_int32_t tcpi_advmss; u_int32_t tcpi_reordering; + + u_int32_t tcpi_rcv_rtt; + u_int32_t tcpi_rcv_space; + + u_int32_t tcpi_total_retrans; +}; + + +/* For TCP_MD5SIG socket option. */ +#define TCP_MD5SIG_MAXKEYLEN 80 + +struct tcp_md5sig +{ + struct __kernel_sockaddr_storage tcpm_addr; /* Address associated. */ + u_int16_t __tcpm_pad1; /* Zero. */ + u_int16_t tcpm_keylen; /* Key length. */ + u_int32_t __tcpm_pad2; /* Zero. */ + u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */ }; #endif /* Misc. */ diff --git a/sysdeps/unix/sysv/linux/signalfd.c b/sysdeps/unix/sysv/linux/signalfd.c index cdde278e9a..09355ecd1d 100644 --- a/sysdeps/unix/sysv/linux/signalfd.c +++ b/sysdeps/unix/sysv/linux/signalfd.c @@ -23,8 +23,18 @@ int -signalfd (int fd, const sigset_t *mask) +signalfd (int fd, const sigset_t *mask, int flags) { + /* The system call has no flag parameter which is bad. So we have + to wait until we have to support to pass additional values to the + kernel (sys_indirect) before implementing setting flags like + O_NONBLOCK etc. */ + if (flags != 0) + { + __set_errno (EINVAL); + return -1; + } + #ifdef __NR_signalfd return INLINE_SYSCALL (signalfd, 3, fd, mask, _NSIG / 8); #else diff --git a/sysdeps/unix/sysv/linux/sys/signalfd.h b/sysdeps/unix/sysv/linux/sys/signalfd.h index b780243e0a..247b20b9d2 100644 --- a/sysdeps/unix/sysv/linux/sys/signalfd.h +++ b/sysdeps/unix/sysv/linux/sys/signalfd.h @@ -50,7 +50,8 @@ __BEGIN_DECLS /* Request notification for delivery of signals in MASK to be performed using descriptor FD.*/ -extern int signalfd (int __fd, const sigset_t *__mask) __THROW; +extern int signalfd (int __fd, const sigset_t *__mask, int __flags) + __nonnull (2) __THROW; __END_DECLS