From fbd01e6c4427b558b63fedb938b7fc5fada8c6b8 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 22 Feb 2018 15:47:33 -0300 Subject: 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. --- sysdeps/unix/sysv/linux/mips/mips64/Makefile | 10 ---------- sysdeps/unix/sysv/linux/riscv/rv64/Makefile | 4 ---- 2 files changed, 14 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/Makefile (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/mips/mips64/Makefile b/sysdeps/unix/sysv/linux/mips/mips64/Makefile index b4fb190bba..fcb48c0f56 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/Makefile +++ b/sysdeps/unix/sysv/linux/mips/mips64/Makefile @@ -1,13 +1,3 @@ -ifeq ($(subdir),socket) -CFLAGS-recv.c += -fexceptions -CFLAGS-send.c += -fexceptions -endif - -ifeq ($(subdir),nptl) -CFLAGS-recv.c += -fexceptions -CFLAGS-send.c += -fexceptions -endif - ifeq ($(subdir),signal) # sigaction.c defines static functions in asms and refers to them from # C code, resulting in "'restore_rt' used but never defined" (which diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/Makefile b/sysdeps/unix/sysv/linux/riscv/rv64/Makefile deleted file mode 100644 index cb60d74047..0000000000 --- a/sysdeps/unix/sysv/linux/riscv/rv64/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -ifeq ($(subdir),socket) -CFLAGS-recv.c += -fexceptions -CFLAGS-send.c += -fexceptions -endif -- cgit 1.4.1