glibc/hurd/hurd
Samuel Thibault 67a78072e2 hurd: clean fd and port on thread cancel
HURD_*PORT_USE link fd and port with a stack-stored structure, so on
thread cancel we need to cleanup this.

* hurd/fd-cleanup.c: New file.
* hurd/port-cleanup.c (_hurd_port_use_cleanup): New function.
* hurd/Makefile (routines): Add fd-cleanup.
* sysdeps/hurd/include/hurd.h (__USEPORT_CANCEL): New macro.
* sysdeps/hurd/include/hurd/fd.h (_hurd_fd_port_use_data): New
structure.
(_hurd_fd_port_use_cleanup): New prototype.
(HURD_DPORT_USE_CANCEL, HURD_FD_PORT_USE_CANCEL): New macros.
* sysdeps/hurd/include/hurd/port.h (_hurd_port_use_data): New structure.
(_hurd_port_use_cleanup): New prototype.
(HURD_PORT_USE_CANCEL): New macro.
* hurd/hurd/fd.h (HURD_FD_PORT_USE): Also refer to HURD_FD_PORT_USE_CANCEL.
* hurd/hurd.h (__USEPORT): Also refer to __USEPORT_CANCEL.
* hurd/hurd/port.h (HURD_PORT_USE): Also refer to HURD_PORT_USE_CANCEL.

* hurd/fd-read.c (_hurd_fd_read): Call HURD_FD_PORT_USE_CANCEL instead
of HURD_FD_PORT_USE.
* hurd/fd-write.c (_hurd_fd_write): Likewise.
* sysdeps/mach/hurd/send.c (__send): Call HURD_DPORT_USE_CANCEL instead
of HURD_DPORT_USE.
* sysdeps/mach/hurd/sendmsg.c (__libc_sendmsg): Likewise.
* sysdeps/mach/hurd/sendto.c (__sendto): Likewise.
* sysdeps/mach/hurd/recv.c (__recv): Likewise.
* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
* sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Call __USEPORT_CANCEL
instead of __USEPORT, and HURD_DPORT_USE_CANCEL instead of
HURD_DPORT_USE.
2020-06-28 00:38:46 +00:00
..
fd.h hurd: clean fd and port on thread cancel 2020-06-28 00:38:46 +00:00
id.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ioctl.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
lookup.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
port.h hurd: clean fd and port on thread cancel 2020-06-28 00:38:46 +00:00
resource.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
signal.h hurd: Add THREAD_GET/SETMEM/_NC 2020-02-15 14:18:17 +01:00
sigpreempt.h Hurd: Move <hurd/sigpreempt.h> internals into wrapper header 2020-05-28 11:40:13 +02:00
threadvar.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
userlink.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
xattr.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00