Commit Graph
100 Commits
Author SHA1 Message Date
Jérôme Duval ac508fcb4a tcp: _Receive: reset connection when received another ack packet
while finish acknowledged and zero receive window.

* SendQueued: try to get window update when send window is zero.
* Golang test TestServerGracefulClose now passes.

tcp_receive_data generates a RST packet with a random sequence, etc.
with _SendReset, the actual connection will be used to generate the segment information, like Linux, ie:

18:07:17.657812 IP localhost.localdomain.40009 > localhost.localdomain.40034: Flags [R.], seq 184, ack 69632, win 0, options [nop,nop,TS val 34750 ecr 33649], length 0

instead of:

18:10:50.816193 IP localhost.localdomain.40051 > localhost.localdomain.40062: Flags [R], seq 1736711, win 0, length 0

Change-Id: Ib621605f74cb6d1cbc2add050bcddbf471402254
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10223
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-16 17:42:33 +00:00
Jérôme Duval e4b96f0721 libnetwork: use inet_net_ntop and inet_net_pton from OpenBSD
* also used by FreeBSD, they are maintained.
* adjust port_before.h after the musl switch
* tested OK manually with the FreeBSD tests

Change-Id: Id6555aecd4df742d4762d54dd1393f05656793a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9711
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-12 13:08:22 +00:00
Jérôme Duval 69e473411e tcp: fix RFC reference
Change-Id: Icfcec5122745035cd6b5cb3d53e69fcc48bbbe73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10222
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-11 09:59:53 +00:00
Jérôme Duval 1a163d0ce9 Terminal: support for hyperlinks (#18827)
* support for invisible text
* support for DECSTR - soft terminal reset

Change-Id: I5cc333c7409a16fb41bcd57c5ebf2f277bd31370
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9661
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-12-13 21:25:16 +00:00
Jérôme Duval 9d587f4f3f tcp: send RST instead of FIN, when user closed and received data get lost
this is the abort way of closing a connection.
tested with golang's http test TestTransportGzip. All TestTransport* pass.

Change-Id: Ib79516eb8a16480d7a4425675748ff76554e9c6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10054
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-12-09 10:14:36 +00:00
Jérôme Duval 0200659132 Terminal: unmask signal SIGUSR1 for child processes
Terminal masks SIGUSR1 in TermApp for its own use, but doesn't unmask it for the processes it creates. The bug must have been exposed by 91acc30 (kernel/team: use child-forked thread signal_mask)

Change-Id: I4eed723b50bd92d23a3e7e43bfdd2c11162ce9d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10047
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-12-02 07:54:21 +00:00
Jérôme Duval c7c819c28f strace: send_signal and sigaction now use signal names
Change-Id: I5080da504899c96642bb4695eada2805fcffd773
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10036
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-11-30 07:56:05 +00:00
Jérôme Duval 7b2f4ab767 kernel/socket: for accept()/recvmsg() invalid user addresses are not fatal
needed to align with FreeBSD and Linux.
FreeBSD Test: tools/regression/sockets/accept_fd_leak/accept_fd_leak.c

Change-Id: Ia87e1713f0fb2a8010257539d2fe62cef9331c56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9382
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-24 08:35:48 +00:00
Jérôme Duval c548136748 strace: dump sigset_t, sigprocmask
Change-Id: Idbe11f05b5a254054b2d50091fefeaf43be8dd08
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9881
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-11-23 14:02:58 +00:00
Jérôme Duval 139bf65f0d unix: handle MSG_PEEK on receive.
fix #18653

Change-Id: Ideaba943644481ffd6cf3e1801069508b7362c9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9860
Reviewed-by: Jérôme Duval <[email protected]>
2025-11-15 22:30:45 +00:00
Jérôme Duval 431d197b7e kernel/fd: add inc_fd_open_count
Change-Id: I28a1b99a020cefb626dddca78cb7b7913cd1286c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9864
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-15 22:30:45 +00:00
Jérôme Duval 8dcdf257f9 network/stack: Add clone_ancillary_data.
Change-Id: I98a56344ffbf0c691a797ad7ce69ba1de08bbbee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9859
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-15 22:30:45 +00:00
Jérôme Duval 5e0c933df0 Added ring_buffer_user_peek() similar to ring_buffer_peek()
Change-Id: Ife183989e0c031f648feb6a4b03f1a3ffc15503c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9858
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-13 14:11:35 +00:00
Jérôme Duval 22f4b0e5f8 network/stack: packet writes should reach the protocol at least once
notifications on packet protocols shouldn't ignored (for instance zero length packets).

Change-Id: I5ccf1ad492c32c50d59b9f9792456d70b29dbf32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9781
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-11-13 07:17:09 +00:00
Jérôme Duval 0cbc2cc115 network/stack: handle MSG_TRUNC in socket_receive_no_buffer()
unix: return the actual received length for datagrams

Change-Id: I7b4fe7f19ae77fffe1282b16af1ee49443d6ff88
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9777
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-11-13 07:17:09 +00:00
Jérôme Duval d6cfa94572 unix: Implement sequenced-packet sockets
* implement `SOCK_SEQPACKET` sockets for `AF_UNIX` family.
* extend UnixStreamEndpoint to use atomic queues like UnixDatagramEndpoint
* UnixBufferQueue::Read() and Write(): makes the address optional
* UnixBufferQueue::SetCapacity(): actually makes the fifo smaller when possible
* UnixFifo::UnixFifo(): init fType
* UnixStreamEndpoint::UnixStreamEndpoint(): init fAtomic
* UnixStreamEndpoint::Connect(): uses the socket receive and send buffer size,
init the atomic/non-atomic queues.
* UnixStreamEndpoint::Send(): accept MSG_EOR for sequenced-packet sockets
* UnixStreamEndpoint::Receive(): accept MSG_WAITALL
* UnixStreamEndpoint::SetReceiveBufferSize(): succeeds if no queue yet

Change-Id: I57299f31e4d9ace79bf9baff0da9bae764c27929
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9775
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-11-13 07:17:09 +00:00
Jérôme Duval 45ec6479d2 libs/bsd: update arc4random with OpenBSD sources.
Change-Id: I68970d44677a0628681b033f1832fa7afc37d031
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9856
Reviewed-by: waddlesplash <[email protected]>
2025-11-12 07:12:54 +00:00
Jérôme Duval b739532218 POSIX: add ffsl and ffsll from musl sources.
appeared in issue 8:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/ffs.html
Change-Id: Ic382498c3e2d6138aedbeb88578882457ee875ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9836
Reviewed-by: waddlesplash <[email protected]>
2025-11-11 16:50:29 +00:00
Jérôme Duval 11d8ab2a71 kernel/socket: recv/send should accept a NULL buffer with a zero length
for instance on udp and unix datagram sockets.

Change-Id: I010faf1147b0e6b3d89aa47b1f846f3b948008fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9780
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-11 11:04:38 +00:00
Jérôme Duval 91acc3028f kernel/team: use child-forked thread signal_mask
when creating ThreadCreationAttributes. Otherwise defaults to zero.
this fixes golang TestForegroundSignal.

Change-Id: I98e372d2e89ca9ea4bd65e5017b732023a811143
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9816
Reviewed-by: waddlesplash <[email protected]>
2025-11-10 22:07:25 +00:00
Jérôme Duval 4e7b65c689 kernel/team: exec_team() is now allowed with other threads
these other threads are killed. This match with the POSIX description:

"A call to any exec function from a process with more than one thread
shall result in all threads being terminated and the new executable image
being loaded and executed. No destructor functions or cleanup handlers shall be called."

Change-Id: I55c25d2e785e25d444f63c646d901d64e6333750
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9799
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-11-10 21:34:23 +00:00
Jérôme Duval 9003873f8b network/stack: handle SOCK_SEQPACKET
Change-Id: Ic97783fc79dfbeaed07246366ca49b17a879feb8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9776
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-11-05 21:12:18 +00:00
Jérôme Duval df31a4abfa strace: dump setsockopt/getsockopt
Change-Id: Icd54603fa96ec27c6bd43b19434f5a3a0af5849e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9774
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-05 21:12:18 +00:00
Jérôme Duval 8956939c43 strace: dump stat structure
Change-Id: I816d4c5cf844e844cde373278505c4e55f90a42b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9766
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-04 07:39:15 +00:00
Jérôme Duval 90fa6d12f0 kernel/team: move check in setpgid()
return earlier when the target team is a session leader
(even when the old and new process groups are the same ).

Change-Id: I0b06787f9a12948c7a0722c13819f32415a3cddf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9762
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-30 07:30:43 +00:00
Jérôme Duval e0ccf1d924 POSIX: add CMPLX(), CMPLXF(), CMPLXL()
appeared in issue 8:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/CMPLX.html

Change-Id: I037e7368611e201df28589172f926e7a9fc52be2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9758
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-30 07:30:43 +00:00
Jérôme Duval 7fc80d5509 kernel/team: setpgid() should check the target team
the target team should be the calling process or a child process of the calling process.

Change-Id: I3c365268aea0ab54ab70ae6ae50e00d8ca949332
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9757
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-28 07:22:32 +00:00
Jérôme Duval 8da1843374 kernel/signal: send_signal_to_process_group() leaks a group reference
* this fixes a few tests of sortix/os-test/process.

Change-Id: Ia20fd9c6e18919ce3c09d1886899f5ef547a2af8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9756
Reviewed-by: waddlesplash <[email protected]>
2025-10-27 19:20:58 +00:00
Jérôme Duval 7c089760c6 efi: fix header guard comment
Change-Id: I5528185d0b130fa8095b62d7865e51f22a68d8b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9692
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 06:52:57 +00:00
Jérôme Duval 6ce67a5336 smbios: support getting address from EFI
* prefer v3 over v2
* adding efi attributes in gBootVolume KMessage is a bit of a hack, but
shouldn't hurt older kernels.

Change-Id: If5ea19dafa5a845872eb8d577e77a6935539ce20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9685
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-15 06:52:57 +00:00
Jérôme Duval 4719b3c5c3 boot_loader: rename gBootVolume to gBootParams
this will be used to hold other boot parameters, for instance smbios root pointers.

Change-Id: I004a8abe553241816c0a004225e088bad1c11b47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9691
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-15 06:52:57 +00:00
Jérôme Duval ba952ac9c0 nvme: support 64 LBAF formats
Change-Id: Ia1cc446ba1985f5e3ce80a8046aac6947b20d710
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9688
Reviewed-by: waddlesplash <[email protected]>
2025-10-13 16:04:55 +00:00
Jérôme Duval 5cf29a22c5 ipv6: handle IPV6_V6ONLY
Haiku only accepts v6only. Fix #19773

Change-Id: Ica3788d097019fd00f83de02f44245896a4a01d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9663
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-03 17:36:54 +00:00
Jérôme Duval 59a481a049 Terminal: support for overlined text
Change-Id: I7444acb1da4c225b4af5a527fb5b0cd2d5ac2b5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9635
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-10 11:06:52 +00:00
Jérôme Duval 2858af6540 Terminal: CSI REP min value is 1
Change-Id: I73666750b92ed64affb975dcba207c972567ea88
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9634
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-09-10 11:06:52 +00:00
Jérôme Duval 6ec9699bb5 Terminal: add support for DECRQM
* report mouse state, report cursor blink, report bracketed state
* introduce modes for flags to simplify the code
* keep modes in TerminalBuffer, TermParse can then write responses.

Change-Id: Id9961e90a96420ee63aca17375bd7f0a748d083a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9633
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-10 11:06:52 +00:00
Jérôme Duval 0937305b84 gnu/sched.h: fix CPU_COUNT on gcc2 C89
Change-Id: Ia193e342d2bbac8060189f062e35aca47426444e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9626
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-03 15:10:23 +00:00
Jérôme Duval e1e1c75a1f gnu/sched.h: fix CPU_* definitions to match glibc
add CPU_COUNT and cpu_set_t

Change-Id: I9b92cab27a8bb4fda71a99721801013647e02588
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9618
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 08:00:26 +00:00
Jérôme Duval ad49acb949 null: merge /dev/zero and add a /dev/full
present on both FreeBSD and Linux.
useful to test a "disk full" condition.

Change-Id: Ibac6b50e8063c90e3e324ec04ac136c34298cc7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9617
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-29 06:57:40 +00:00
Jérôme Duval 843f2bcce4 ext2: fix inode blocks count after enlarge or shrink
Change-Id: I6ac6253b761f25d567b969d8303fbf0858e47221
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9616
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-28 13:12:23 +00:00
Jérôme Duval 2df6cc0b3b ext2: don't put the root vnode in unmount hook
as the vfs already put all vnodes before calling unmount.
found with the guarded heap.

Change-Id: Ia8d9ea22db1eb4241efe470bea27a00a413bedb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9615
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-28 13:12:23 +00:00
Jérôme Duval 795849800c ext2: remove orphan list support
it's too easy to get a broken orphan list.

Change-Id: Ib84e84bd685017cb7e1d1a3ae34f0fa6897aacec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9614
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-28 13:12:23 +00:00
Jérôme Duval aa31f66532 ext2: fix htree first splitting and checksumming
fix #19665

Change-Id: Id4bba3541f750a7b4756a80ee0234f34c25dcf98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9449
Reviewed-by: waddlesplash <[email protected]>
2025-07-09 18:46:01 +00:00
Jérôme Duval 334de37d58 udp: empty address is different from uninitialized address
* instead teach getpeername that family is to be checked.
* fix #19652

Change-Id: I0e2150820687ca08e339adaf111918adc83b9e6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9397
Reviewed-by: waddlesplash <[email protected]>
2025-06-26 15:09:13 +00:00
Jérôme Duval 2b9fdf7847 ipv4: empty address should be a zero sa_len
UdpDomainSupport::ConnectEndpoint() uses SetToEmpty() to unconnect when used
with AF_UNSPEC.
checked against the output of the test sortix/os-test/udp/connect-unconnect-getpeername
Change-Id: Iccfa46399a0e14057459966a2f406469566bcbac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9396
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-26 05:43:59 +00:00
Jérôme Duval 48e3aa8081 kernel/socket: allow sendto to an empty address
should return EDESTADDRREQ for UDP
checked against the output of the test sortix/os-test/udp/sendto-null

Change-Id: I3bc61e0cc9d75319d61f0395f1ae45d28171bfef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9395
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-26 05:43:59 +00:00
Jérôme Duval 74be257edf udp: send should return the error on the last send packet
checked against the output of the test sortix/os-test/udp/connect-send-error-send
* icmp: add more error codes

Change-Id: I7b1695d37cf5eae8cd09132047404b990f8791dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9394
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-26 05:43:59 +00:00
Jérôme Duval f2a0f2a3e0 udp: implement shutdown()
instead of returning B_NOT_SUPPORTED.
* this fixes a few tests of sortix/os-test/udp.

Change-Id: I961e71cc419ce7ab38419749a42df8737e272c83
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9392
Reviewed-by: waddlesplash <[email protected]>
2025-06-25 13:24:25 +00:00
Jérôme Duval 3aaa4c9d96 udp: a second bind on broadcast address should error with EADDRNOTAVAIL
Testcase: https://gitlab.com/sortix/os-test/-/blob/master/udp/bind-conflict-loopback-broadcast.c

Change-Id: I37c6d05910c3d9573610207b650f1957bccd1e47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9390
Reviewed-by: waddlesplash <[email protected]>
2025-06-24 17:33:06 +00:00
Jérôme Duval 090519cfe5 network/stack: socket_accept: return B_NOT_SUPPORTED for non-stream sockets
Testcase: https://gitlab.com/sortix/os-test/-/blob/master/udp/accept.c

Change-Id: I9020292facb47339ede31a8d1c49d197e40d6ca9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9389
Reviewed-by: waddlesplash <[email protected]>
2025-06-24 17:33:06 +00:00
Jérôme Duval 3ef89f758f network/stack: socket() can error with EPROTOTYPE/EPROTONOSUPPORT
as POSIX requires.

Change-Id: Iee15bd3db6283a52ac5bc68be99752f36e12f1ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9384
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-20 22:26:35 +00:00
Jérôme Duval 0b97e6ab9a tcp: don't notify EPIPE/ENOTCONN when no connect or listen happened
Change-Id: I18bf8ceee7963729c5037e39fc1c23f243eba0bb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9380
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-20 11:55:44 +00:00
Jérôme Duval 0847894277 tests/storage: reorder tests
Change-Id: Ic57c14c8124778b01357ef1afe6c7de7ad7aca8c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9383
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-19 15:51:33 +00:00
Jérôme Duval 914d5aea44 kernel/events: event_queue shouldn't be kept after fork()
_user_event_queue_wait(): when no timeout is passed, it means infinite timeout

Change-Id: Ic064551251413da8f4788f91d92c13c40201548a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9379
Reviewed-by: waddlesplash <[email protected]>
2025-06-18 17:06:19 +00:00
Jérôme Duval 0b9af29d07 kernel/socket: shutdown() now checks argument how
Change-Id: I1d3c7b1e07588f712da094c1872cb63635e4eeee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9378
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-17 22:33:08 +00:00
Jérôme Duval 5ac839cb94 kernel/fs: vnode_path_to_vnode(): check directory on trailing slash
fix #14352

Change-Id: I2fb7f0f455f46f0b5b2fe0eb487896f41b33a44b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9335
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-10 16:00:13 +00:00
Jérôme Duval 23f923bcaf libbsd: add closefrom() and close_range()
Change-Id: I9c88948d6c4d5a32e3aa06cd696e2ce24c2d298f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9334
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-09 16:26:13 +00:00
Jérôme Duval 396ebbc16f POSIX-2024: support for MSG_CMSG_CLOEXEC and MSG_CMSG_CLOFORK
Change-Id: I55551860fb7dac5d0c11a6d4201502fff9ab2d13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9332
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-09 16:26:13 +00:00
Jérôme Duval 904fd2abf0 POSIX-2024: support for O_CLOFORK, SO_CLOFORK
Change-Id: I4f3a961947eefdeafd5a249499899cc92d67c2d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9330
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-09 16:26:13 +00:00
Jérôme Duval 7b2b77d482 kernel/x86: fix syscall parameters calling user_debug_post_syscall()
regression introduced in hrev58093

Change-Id: Ic1a508485c64964b0e2aab85db0989e3a707c958
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9325
Reviewed-by: waddlesplash <[email protected]>
2025-06-03 19:37:39 +00:00
Jérôme Duval 4bb864d0a6 ext2: enable the checksum_seed feature
Change-Id: I5a34ae9247220f3c40441623bef2b3806b56d934
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9312
Reviewed-by: Jérôme Duval <[email protected]>
2025-05-28 15:19:17 +00:00
Jérôme Duval 3646c0e4ed tcp: retransmit SYN when not acknowledged after some time
* 4 times one second then exponential back off
* fix #19575

Change-Id: If9348191e1c8260f381e0e6fec338cfe83d53660
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9283
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-05-15 08:00:38 +00:00
Jérôme Duval bfce786a2e nvme: actually pass parameters to nvme_admin_set_feature()
align len parameter type
noticed by waddlesplash, thanks!

Change-Id: I3d9352f253ca0fc3f2be5966e10a354f3f47ef4b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9199
Reviewed-by: waddlesplash <[email protected]>
2025-04-22 20:55:36 +00:00
Jérôme Duval d6547c7f81 kernel & libbsd.so: add getloadavg() and _user_get_loadavg()
the algorithm and reference values are from FreeBSD.

Change-Id: Ia74a796e13adce6a70434c7546c25ca3d553f11f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9150
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-04-21 18:43:29 +00:00
Jérôme Duval 893afab7d1 kernel/fs: create_dir should return EEXIST before EROFS
fix #19123

Change-Id: I020ba4fd69a765d3bafa578512ad127384a85e3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9142
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-03-24 21:24:36 +00:00
Jérôme Duval ce6f846b6f Update haiku-current.list, add haiku-r1beta4.list and haiku-r1beta5.list
Change-Id: I00300242e56e50ab312e92057be9113e310af43e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9141
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-03-23 17:26:38 +00:00
Jérôme Duval ba4b365101 runtime_loader: resolves to weak symbols for non-gcc2 images
non-gcc2 can hide conflicting symbols, thus resolving to weak symbols
shouldn't be a problem. This permits add-ons to use the static asan
allocator in the main image.

Change-Id: I28bdd45e636afa4e97dc88b0cc956eae58df1009
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9133
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-21 08:12:50 +00:00
Jérôme Duval 5cce8bc757 nvme_disk: enable the autonomous power save feature
if available.
we follow the algorithm in Linux, choosing at most two power states
with low and higher latencies. this allows to save about 1W power
on a WD Blue SN570 device.

Change-Id: Ic403ec19765e9abff54aed4f6d7dcad8f22695ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9137
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-19 22:51:01 +00:00
Jérôme Duval 0890cb4057 nvme: print available power states
Change-Id: I0e092211e8cd411e199439e4bc250aaa4488e7ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9136
Reviewed-by: waddlesplash <[email protected]>
2025-03-19 18:29:50 +00:00
Jérôme Duval 41f477706a kernel/lib: vsnprintf correctly prints fractions smaller than 0.1
zeros between the dot and the next digit were missing.

Change-Id: Ibac3364866d978e140235594c1c173ba19c31f2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9135
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-19 17:40:17 +00:00
Jérôme Duval 7aa3dc423e launch_daemon: fix stopping services
* Job::GetMessenger(): try harder to check the application is valid, not only preregistered.
* LaunchDaemon::_StopJob(): signal SIGTERM instead of SIGINT, to stop the process.
* fix #13320

Change-Id: I612ff0de9bf064fd0a1e1f149cc6021bfaac93bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9127
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-15 18:33:16 +00:00
Jérôme Duval 34c270d993 RosterPrivate: add missing parameters in documentation
Change-Id: I7e9ba8fa07eaf95717a31f51273653340864e731
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9126
Reviewed-by: waddlesplash <[email protected]>
2025-03-15 18:33:16 +00:00
Jérôme Duval 3bb7234bcb launch_daemon: job is launching when condition is met
fix Tracker and Deskbar not starting on first boot

Change-Id: I7e1f8009ccb1e620549952d9372a0532e80a633b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9125
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-15 13:20:44 +00:00
Jérôme Duval bf0c6bfb90 libnetwork: freeifaddrs() deletes with the right type
to silence libasan on libnetwork

Change-Id: I0a2c35569fe2092d047c830d40763317eb1c4d1b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9123
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-03-14 18:30:13 +00:00
Jérôme Duval 52c25f31c7 launch_daemon: setting condition also checks for driver_settings
only checks for a field, or field = value

Change-Id: I5dfadb6187831a51e97064cdfed55430b74f7b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9117
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-11 02:15:39 +00:00
Jérôme Duval 778fe0b67b driver_settings: bufferSize being zero means buffer overflow
Change-Id: I87b4a57c651840ac6aa01d602eddabb192c8c323
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9116
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-11 02:15:39 +00:00
Jérôme Duval 63792e3fd0 Revert "driver_settings: Replace type of bufferSize from size_t to ssize_t"
This reverts commit d2a423e499.

this matches the method found in driver_settings.h

Change-Id: Idb1a83dd648d18916ee2ec34727c88fb8f25cb3e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9095
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-03-11 02:15:39 +00:00
Jérôme Duval 7f7d085c59 launch_daemon: implement file_created event
Change-Id: Ie42abe85c594be3c354e2d1b5bb25b881a7adea4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9089
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-11 02:15:39 +00:00
Jérôme Duval e4e3f81a1b launch_daemon: failed condition now skips the job
Change-Id: I0d3db96a068ecc40dfd1c501dfae5800c0e28116
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9080
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-11 02:15:39 +00:00
Jérôme Duval 91880bad83 kernel/vm: when resizing down a VMCache, fill a partial page with zeros
* factored out file_cache
* fix two gVisor tests: MMapFileTest.ReadSharedTruncatePartialPage
and MMapFileTest.WriteSharedTruncatePartialPage
* fix #19438

Change-Id: Ia7f119478d306ab6d867632e4a5270733f0b29df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9060
Reviewed-by: waddlesplash <[email protected]>
2025-02-26 17:14:18 +00:00
Jérôme Duval 64a0bc243c pthread_key: when calling destructors, iterates over keys again
when a non-null value is found, up to PTHREAD_DESTRUCTOR_ITERATIONS (4).
* fixes LLVM unit test SanitizerCommon.PthreadDestructorIterations.
Change-Id: I1f9f4d3e8723261326e6e22b0f0d23907dccb59f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8979
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-14 18:27:12 +00:00
Jérôme Duval 74b5b25f77 virtio_pci: accept any pci revision for modern devices
as in the specification.

Change-Id: I74d667daea386d3189095542d8f515fc3711a910
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8978
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-14 12:59:38 +00:00
Jérôme Duval 12b22e8e48 strace: mapping type handler for _kern_map_file()
Change-Id: I1f315c285668221fb9ff15165c81dfcd753d7df8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8977
Reviewed-by: waddlesplash <[email protected]>
2025-02-14 12:59:38 +00:00
Jérôme Duval 74e01ea162 BMenuField: SetLabel(): do nothing if current and new label are NULL
Change-Id: Ia4bb6f99d3b633a23a43624208e16cb7e4ae0399
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8940
Reviewed-by: X512 X512 <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-10 21:53:08 +00:00
Jérôme Duval 46dd344bdd strace: Add tracing for rlimit syscalls.
Change-Id: I1e99622027f04fb93d00ebd94b45e05f7142fbec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8965
Reviewed-by: waddlesplash <[email protected]>
2025-02-10 20:17:28 +00:00
Jérôme Duval 146617c29b runtime_loader: dlsym(RTLD_NEXT) searches all regions for the caller address
clang/lld can put code in multiple regions.

Change-Id: I495e3f12105ef2e894809da7e4a91bac08a12fd6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8961
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-10 07:37:47 +00:00
Jérôme Duval b5eb38ec58 shared: use the correct delete for array
to silence libasan on libtracker.so

Change-Id: I7c634271f4ec2b4ca0d5f76c18ddbfc7dddf2793
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8910
Reviewed-by: Axel Dörfler <[email protected]>
2025-02-05 16:35:47 +00:00
Jérôme Duval b71707da2c kernel: comment should match the guard macro
Change-Id: I4cfa9eda18f3502e50adff9ffa8ded47f318f372
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8909
Reviewed-by: Axel Dörfler <[email protected]>
2025-02-05 16:35:23 +00:00
Jérôme Duval d59339ff6c x86_cstates: disable C5 and C6 states on Skylake
could help with #19341

see https://bugzilla.kernel.org/show_bug.cgi?id=109081

Change-Id: Ide72f46193093c3c4695c39d4466e9418808cbd0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8881
Reviewed-by: waddlesplash <[email protected]>
2025-02-04 17:22:34 +00:00
Jérôme Duval 6c380f3c8e kernel/x86: add definitions for cpuid leaves
remove feature_5_ecx

Change-Id: I247a37c875e5dd04f2239fdceeef67e402b1245d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8880
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-02-04 17:22:34 +00:00
Jérôme Duval aedcf2476d virtualkeyboard: update keymap when it changed
load current keymap on start

Change-Id: I1030cf5aaf9641f7e915f8fc10dec3144cab014f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8904
Reviewed-by: waddlesplash <[email protected]>
2025-02-03 21:27:47 +00:00
Jérôme Duval 0328ffe12a virtualkeyboard: add a hook for ScreenChanged()
Change-Id: I18d2a4e7e29858406c75dae54c6ea6c5f5e0c26b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8903
Reviewed-by: waddlesplash <[email protected]>
2025-02-03 17:14:39 +00:00
Jérôme Duval 9d2283baab virtualkeyboard: style fixes
Change-Id: Iee76c0cae38a0677b60e51f73aa0e2e5d9b7c2ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8902
Reviewed-by: waddlesplash <[email protected]>
2025-02-03 17:14:39 +00:00
Jérôme Duval c8cd427e30 build: extend stack protection
* use -fstack-protector-strong and -fstack-clash-protection
* also bin and some user add-ons

Change-Id: I593365e55414ac447bde54980a5c73202e9bb172
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8887
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-03 17:14:18 +00:00
Jérôme Duval 3805924471 kernel: fix warning
warning: "user_strlcpy" redefined
Change-Id: I2a0a4307e1ca8904ced7eafb498f9ea94d538362
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8893
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-01 20:21:26 +00:00
Jérôme Duval cb5d195553 fs_shell: fix warning
warning: too many arguments for format [-Wformat-extra-args]
Change-Id: If35737dc2fe193923aa1d756cfd10ca6d820a09e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8892
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-01 20:21:26 +00:00
Jérôme Duval f9af89e754 RemoteMessage.h: fix warning
error: 'rectCount' may be used uninitialized [-Werror=maybe-uninitialized]
Change-Id: Id899f6ef9c249861dbe286a71109c461501519b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8891
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-01 20:21:26 +00:00
Jérôme Duval e01dfaf620 build: add acpi_thermal, amd_thermal and pch_thermal to minimum definition
Change-Id: I943b77390266c4e444ddb406455ebaa6a9549565
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8856
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-01-23 05:25:54 +00:00
Jérôme Duval 4d5debea9e amd_thermal: new driver
inspired by ksmn in OpenBSD

Change-Id: Ic272fc15f1ea082496db99ed2df15c77655ba9c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8855
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-01-23 05:25:54 +00:00
Jérôme Duval 77f06cf2ae pch_thermal: use user_memcpy() to write in a user buffer
Change-Id: I8eccde638ba30051fcec375b7d616e1d1bddf5ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8854
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-23 05:25:54 +00:00