]> sourceware.org Git - glibc.git/commit
nptl: Fix tst-cancel4 sendto tests
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 22 Feb 2018 18:47:33 +0000 (15:47 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 5 Mar 2018 21:09:08 +0000 (18:09 -0300)
commitfbd01e6c4427b558b63fedb938b7fc5fada8c6b8
tree04506c017fdd6164be007a713fb9e899f66107dc
parent68448be208ee06e76665918b37b0a57e3e00c8b4
nptl: Fix tst-cancel4 sendto tests

Now that send might be implemented calling sendto syscall on Linux,
I am seeing some issue in some kernel configurations where tst-cancel4
sendto do not block as expected.

The socket used to force the syscall blocking is used with default
system configuration for buffer sending size, which might not be
suffice to force blocking.  This patch fixes it by explicit setting
buffer socket lower than the buffer size used.  It also enables sendto
cancellation tests to work in both ways (since internally send is
implemented routing to sendto on Linux kernel).

The patch also removes unrequired make rules on some archictures
for send/recv. The generic nptl Makefile already set the compiler flags
required on some architectures for correct unwinding and libc object
are not strictly required to support unwind (since pthread_cancel
requires linking against libpthread).

Checked on aarch64-linux-gnu and x86_64-linux-gnu. I also did a
sniff test with tst-cancel{4,5} on a simulated mips64-linux-gnu.

* nptl/tst-cancel4-common.h (set_socket_buffer): New function.
* nptl/tst-cancel4-common.c (do_test): Call set_socket_buffer
for socketpair endpoint.
* nptl/tst-cancel4.c (tf_send): Call set_socket_buffer and use
WRITE_BUFFER_SIZE as buffer size for sending socket.
(tf_sendto): Use SOCK_STREAM instead of SOCK_DGRAM and fix an
issue on system where send is implemented with sendto syscall.
* sysdeps/unix/sysv/linux/mips/mips64/Makefile [$(subdir) = socket]
(CFLAGS-recv.c, CFLAGS-send.c): Remove rules.
[$(subdir) = nptl] (CFLAGS-recv.c, CFLAGS-send.c): Likewise.
* sysdeps/unix/sysv/linux/riscv/rv64/Makefile: Remove file.
ChangeLog
nptl/tst-cancel4-common.c
nptl/tst-cancel4-common.h
nptl/tst-cancel4.c
sysdeps/unix/sysv/linux/mips/mips64/Makefile
sysdeps/unix/sysv/linux/riscv/rv64/Makefile [deleted file]
This page took 0.048402 seconds and 5 git commands to generate.