Implement support for POSIX thread cancellations

This change makes some miracle modifications to the System Five system
call support, which lets us have safe, correct, and atomic handling of
thread cancellations. It all turned out to be cheaper than anticipated
because it wasn't necessary to modify the system call veneers. We were
able to encode the cancellability of each system call into the magnums
found in libc/sysv/syscalls.sh. Since cancellations are so waq, we are
also supporting a lovely Musl Libc mask feature for raising ECANCELED.
This commit is contained in:
Justine Tunney 2022-11-04 01:04:43 -07:00
parent 37d40e087f
commit 2278327eba
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
145 changed files with 715 additions and 265 deletions

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_accept,0x01e01e21d201e02b,globl,hidden
.scall __sys_accept,0x81e81ea1d281e82b,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_accept4,0xfff05d21dffff120,globl,hidden
.scall __sys_accept4,0xfff85da1dffff920,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_connect,0x062062062206202a,globl,hidden
.scall __sys_connect,0x862862862286282a,globl,hidden

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_fcntl_cp,0x85c85c85c285c848,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_openat,0x1d41411f321cf101,globl,hidden
.scall __sys_openat,0x9d49419f329cf901,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __sys_wait4,0x1c100b007200703d,globl,hidden
.scall __sys_wait4,0x9c180b807280783d,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall posix_fallocate,0x1dffff212fffffff,globl,hidden
.scall posix_fallocate,0x9dffffa12fffffff,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_clock_nanosleep,0x1ddfff0f4ffff0e6,globl,hidden
.scall sys_clock_nanosleep,0x9ddfff8f4ffff8e6,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_epoll_wait,0xfffffffffffff0e8,globl,hidden
.scall sys_epoll_wait,0xfffffffffffff8e8,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_fallocate,0xfffffffffffff11d,globl
.scall sys_fallocate,0xfffffffffffff91d,globl

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_fdatasync,0x0f105f22620bb04b,globl,hidden
.scall sys_fdatasync,0x8f185fa2628bb84b,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_flock,0x0830830832083049,globl,hidden
.scall sys_flock,0x8838838832883849,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_fstatfs,0x09e04022c215a08a,globl,hidden
.scall sys_fstatfs,0x89e840a2c295a88a,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_fsync,0x05f05f05f205f04a,globl,hidden
.scall sys_fsync,0x85f85f85f285f84a,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_ftruncate,0x0c90c91e020c904d,globl,hidden
.scall sys_ftruncate,0x8c98c99e028c984d,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_getrandom,0xfff00723321f413e,globl,hidden
.scall sys_getrandom,0xfff807a3329f493e,globl,hidden

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_ioctl_cp,0x8368368362836810,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_msgrcv,0x0e30e30e32105046,globl
.scall sys_msgrcv,0x8e38e38e32905846,globl

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_msgsnd,0x0e20e20e22104045,globl
.scall sys_msgsnd,0x8e28e28e22904845,globl

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_msync,0x115100041204101a,globl,hidden
.scall sys_msync,0x915900841284181a,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_nanosleep,0x1ae05b0f0ffff023,globl,hidden
.scall sys_nanosleep,0x9ae85b8f0ffff823,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_open,0x0050050052005002,globl,hidden
.scall sys_open,0x8058058052805802,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_poll,0x0d10fc0d120e6007,globl,hidden
.scall sys_poll,0x8d18fc8d128e6807,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_ppoll,0xfff06d221ffff10f,globl,hidden
.scall sys_ppoll,0xfff86da21ffff90f,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_pread,0x0ad0ad1db2099011,globl,hidden
.scall sys_pread,0x8ad8ad9db2899811,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_preadv,0x12110b121221c127,globl,hidden
.scall sys_preadv,0x92190b9212a1c927,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_pselect,0x1b406e20a218a10e,globl,hidden
.scall sys_pselect,0x9b486ea0a298a90e,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_pwrite,0x0ae0ae1dc209a012,globl,hidden
.scall sys_pwrite,0x8ae8ae9dc289a812,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_pwritev,0x12210c122221d128,globl,hidden
.scall sys_pwritev,0x92290c9222a1d928,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_read,0x0030030032003000,globl,hidden
.scall sys_read,0x8038038032803800,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_readv,0x0780780782078013,globl,hidden
.scall sys_readv,0x8788788782878813,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_recvfrom,0x01d01d01d201d02d,globl,hidden
.scall sys_recvfrom,0x81d81d81d281d82d,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_recvmsg,0x01b01b01b201b02f,globl,hidden
.scall sys_recvmsg,0x81b81b81b281b82f,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_select,0x1a104705d205d017,globl,hidden
.scall sys_select,0x9a184785d285d817,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_sendmsg,0x01c01c01c201c02e,globl,hidden
.scall sys_sendmsg,0x81c81c81c281c82e,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_sendto,0x085085085208502c,globl,hidden
.scall sys_sendto,0x885885885288582c,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_sigsuspend,0x12606f155206f082,globl,hidden
.scall sys_sigsuspend,0x92686f955286f882,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_sigtimedwait,0x1affff159ffff080,globl,hidden
.scall sys_sigtimedwait,0x9affff959ffff880,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_statfs,0x09d03f22b2159089,globl,hidden
.scall sys_statfs,0x89d83fa2b2959889,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_truncate,0x0c80c81df20c804c,globl,hidden
.scall sys_truncate,0x8c88c89df28c884c,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_waitid,0xfffffffff20ad0f7,globl
.scall sys_waitid,0xfffffffff28ad8f7,globl

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_write,0x0040040042004001,globl,hidden
.scall sys_write,0x8048048042804801,globl,hidden

View file

@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_writev,0x0790790792079014,globl,hidden
.scall sys_writev,0x8798798792879814,globl,hidden