Commit Graph
10455 Commits
Author SHA1 Message Date
Augustin Cavalier 418769d64b BResources: Mark deprecated methods _DEPRECATED. 2026-03-02 21:11:39 -05:00
Augustin Cavalier f071ee419d BMimeType: Use the new _DEPRECATED to mark SetType deprecated.
This is the first use of this new macro.
2026-03-02 21:03:25 -05:00
Augustin Cavalier b6441edfac BLooperList: Use rw_lock.
Improves efficiency, as some functions can use a read lock
instead of a write lock.

Eliminates another statically-created BLocker.
2026-03-02 20:17:51 -05:00
Augustin Cavalier 5eef2f1d00 BTokenSpace: Use pthread_mutex instead of BLocker.
This header gets included in the build platform, so we can't use
the private recursive_lock.

Eliminates another statically created BLocker, due to gDefaultTokens.
2026-03-02 20:16:32 -05:00
Augustin Cavalier ae70142168 BBlockCache: Use a pthread_mutex instead of BLocker.
The lighter "struct mutex" is in a private header, so we can't
inline it in a public one, so just use pthread_mutex here.

By adjusting padding, the class size stays the same (72 bytes
on 32-bit, 96 bytes on 64-bit; confirmed via static_assert.)

A quick benchmark running "new/delete BMessage" in a loop on 4
threads at once goes from 30-36 seconds before this commit
to around 13-17 seconds, sometimes as low as 3 seconds, afterwards,
so clearly this is a significant improvement.

This also eliminates another BLocker allocated on application startup.
2026-03-02 19:37:13 -05:00
Augustin Cavalier 184b57aa71 BBlockCache: Rewrite header for style. 2026-03-02 18:01:56 -05:00
Augustin Cavalier 8cc48bf580 QueryParser: Don't divide by zero on empty attributes.
Fixes a KDL.
2026-02-28 22:16:43 -05:00
John Davis 0c6100feb2 Implement initial Hyper-V support on x86 platforms
Haiku currently does not have any form of Hyper-V guest support, and
this change begins work toward #16664.

This change implements initial VMBus bus/device structure and functions.

Change-Id: I2d081f55e99da479d9bc5084f1815ade6cc77fe2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10333
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-02-28 10:00:04 +00:00
vighnesh-sawant b097619769 netresolv: Add support for AI_V4MAPPED in ai_flags in getaddrinfo
Ports over the following commits from FreeBSD:
https://github.com/freebsd/freebsd-src/commit/b848a37d4eddb432629a799713cf6fb6f0fd8c3c
https://github.com/freebsd/freebsd-src/commit/2cff354f1a56af10ad02164a9ee38c013ac80688

Fixes #14323.

Change-Id: If75642a45fc76b50d4377e5a11cdb1ee64ab40ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10396
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-02-28 09:59:06 +00:00
Augustin Cavalier 9b5a7d7612 AppServerLink: Switch to a recursive lock.
It seems in some applications (though not most of the ones I
initially tested) this can get used recursively, so we need
a recursive_lock in order to not deadlock.

Also commit a missed change from the previous commit.
2026-02-27 09:22:21 -05:00
John Davis 05d6e44fc9 bootloader/arm64: Discover UART from DBG2 ACPI table
Fallback to DBG2 if SPCR is not present while discovering UART serial
devices. DBG2 is newer than SPCR but does not provide the same
information, and it appears that both can exist on the same system.
This has only been tested in Hyper-V which exposes DBG2.

Change-Id: I6a75114f4287b6db289b544c3b80a66a625fb6c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10354
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-27 12:49:33 +00:00
Augustin Cavalier 9cada02ee0 libbe.so: Avoid static BLockers.
They don't work properly after a fork, and if exit() is called
from the forked child, the parent won't be able to use them
anymore.

In BBitmap and BPicture, replace them with mutexes. For AppServerLink,
make the private ServerLink inherit from BLocker, and then use
that one directly.

This also is a slight efficiency gain, as we don't need to create
multiple semaphores from the static initializers now, which is
just a waste of time in the case of applications that don't
even need these locks but link to libbe.so (e.g. CLI tools.)

Part of #18576.
2026-02-26 17:15:53 -05:00
waddlesplash 8f3276e838 Revert "netresolv: Add support for AI_V4MAPPED in ai_flags in getaddrinfo"
This reverts commit 902921a554.

This broke resolution of CNAMEs, including the Haiku package repos.
Since pkgman uses our own HTTP implementation, which doesn't set
AI_V4MAPPED at all, this shouldn't have been a behavioral change for
it at all, much less having broken it.

Change-Id: If38b6a81c1144101ddea7d1f8d401326675479e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10388
Reviewed-by: waddlesplash <[email protected]>
2026-02-26 20:54:16 +00:00
Augustin Cavalier 3e1ccaf329 kernel: Refactor arch_cpu_invalidate* methods to take a context parameter.
This will be useful on architectures that support ASIDs, and on
ones that don't, it can be used to avoid a race between invalidation
messages being sent and context switches occurring on other CPUs.

In this commit, no behavioral change intended on any architecture.

Change-Id: I6d2ee4b69150f9ff8503329761266ddbdb550eab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10349
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-26 17:17:06 +00:00
vighnesh-sawant 902921a554 netresolv: Add support for AI_V4MAPPED in ai_flags in getaddrinfo
Ports over the following commits from FreeBSD:
https://github.com/freebsd/freebsd-src/commit/b848a37d4eddb432629a799713cf6fb6f0fd8c3c
https://github.com/freebsd/freebsd-src/commit/2cff354f1a56af10ad02164a9ee38c013ac80688

Fixes #14323.

Change-Id: I40e6f0ee132eb2d17d8ec66ba0e28566e8695d18
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10358
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-02-26 11:08:16 +00:00
Fruit De La Passion ec4e585599 radeon: Enable Werror for radeon graphics driver.
* Fix warnings by adding casts, adjusting types, removing obsolete code.
* Correcting two typos
* Activate Werror for radeon
* Part of ticket #9460

Change-Id: I0dda1eea3a60810ba83b9e2cc109872b9cbf2cfd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10347
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-23 08:19:40 +00:00
Kacper Kasper dc8424dd5e unittests: Start simplifying test structure
* Rework ByteOrderTest and DateTimeTest to use autoregistration.
* Functional changes in ByteOrderTest are confirmed in git history
  to be R5 compatibility fixes. This doesn't include B_ASCII_TYPE -
  it seems it has never been part of is_type_swapped().
* Autoregistered test names start with a number - this is because
  RTTI is used to create them. Disabling RTTI is not an option
  because CppUnit in our repo has a broken macro which always sets
  the name to "ATestFixtureType". This is probably fixed in newer
  CppUnit versions.

Change-Id: I56ab5df6e998b6f47fca3c3458a56a761c1740a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10266
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Kacper Kasper <[email protected]>
2026-02-20 19:31:36 +00:00
Humdinger 4c6b9f88fe Email: Rename USERLABEL -> LABEL
Missed in hrev59388. Sorry about that...

Change-Id: I3cf7bbe2d93ac4f420d6f37c243d8bea056372d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10348
Reviewed-by: humdinger humdinger <[email protected]>
2026-02-20 16:21:21 +00:00
Humdinger 3570c2e1b2 Add MAIL:label attribute
To be used by the user to assign a custom label to an email, see
forum thread [1].
It's supposed to replace the mis-use of MAIL:status which should be left
to show the actual status of an email ("New", "Sent", "Replied", etc.).

[1] https://discuss.haiku-os.org/t/introducing-a-new-indexed-attribute-meta-tag

Change-Id: I76f40beeb2c42ab40efa04db3ee3b1b6f77ec926
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10303
Reviewed-by: Adrien Destugues <[email protected]>
2026-02-20 11:45:09 +00:00
Fruit De La Passion 6da42994d0 netfs: Enable Werror for netfs.
* Fix warnings by adding casts and intialization of an on-stack allocated array.
* Activate Werror for netfs.
* Part of ticket #9460

Change-Id: I91c603232e5d96a3ceed60fcc0be45b64df6b7e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10340
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-02-18 16:28:56 +00:00
Jérôme Duval eacd2d9e6a getentropy: define GETENTROPY_MAX
Change-Id: Ice89aa8c2bc191e09120f23cad9483ef082190c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10323
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-02-10 14:23:48 +00:00
Augustin Cavalier 310f75e043 docs: Move fs_query documentation to the Haiku Book.
Also add a missing include in QueryPoseView.
2026-02-04 17:41:53 -05:00
Augustin Cavalier 379c8aebab fs_shell: Add the new B_QUERY_WATCH_ALL. 2026-02-04 17:21:25 -05:00
Augustin Cavalier 53ee2648fb fs_query: Make B_QUERY_WATCH_ALL part of the public API.
It seems to work well enough at this point, and is used in Tracker,
so why not?

Also update live_query to demonstrate the functionality.
2026-02-04 17:09:50 -05:00
Augustin Cavalier dce3a4366d packagefs: Add a fallback buffer for reading heaps in low-memory conditions.
Otherwise we might fail with B_NO_MEMORY, or wait for long periods of
time, which we don't want to do in such a critical routine.

Should improve system responsiveness (or even prevent application
crashes) under high memory pressure.
2026-02-04 14:59:27 -05:00
Augustin Cavalier 0af3006721 QueryParser: Don't send notifications if the node's been deleted.
Gets rid of redundant messages under B_QUERY_WATCH_ALL.
2026-01-29 18:10:12 -05:00
Augustin Cavalier 4310e8e1c8 posix_spawn: Expose file_actions_add[f]chdir.
The non-"_np" versions were exported, but not declared in the header.
Do that, and also make the "_np" versions the alias, as these are
specified in POSIX-2024.
2026-01-29 15:00:12 -05:00
Jérôme Duval afbcaac486 POSIX-2024: add getresuid(), setresuid(), getresgid(), setresgid()
remove syscalls for getuid and getgid

Change-Id: Ic6608bb65a654ff7d8fa25c8f39b71777b62b99c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9339
Reviewed-by: waddlesplash <[email protected]>
2026-01-29 17:06:11 +00:00
Kacper Kasper 17c18c1b0d unittests: fix x86_gcc2 build issues 2026-01-24 12:02:56 +01:00
Augustin Cavalier 4ed2896398 Package Kit: Refactor BRepositoryCache to have GetPackageInfos(callback)...
... instead of GetIterator(). This allows us to avoid loading the
cache entirely in SetTo(), and allows consumers to read the cache
much more efficiently than loading it all into memory and then
freeing it again afterwards.

This technically breaks API/ABI, however the Package Kit APIs
are not considered stable (I don't think.)

All consumers adjusted. As we build the host tools with modern GCC
only, I made update_package_requires use a C++11 lambda function.
All others use out-of-line static methods.

"time pkgman list-repos -v" (which has to read the whole cache)
is ~0.5s before this change, and ~0.25s after this change,
on my test VM.

Change-Id: I6976b4cf5eb846fc925ed199dc00eb227fc81344
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10247
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Andrew Lindesay <[email protected]>
2026-01-21 20:27:13 +00:00
Augustin Cavalier 999bb2e88a sys/param.h: Add DEV_BSIZE and make use of it.
POSIX-2024 says:

> There is no correlation between values of the st_blocks and
> st_blksize, and the f_bsize (from <sys/statvfs.h>) structure members.

Some code in Haiku has mixed that up in the past (e.g. the write_overlay).
This will allow a constant to be used instead, clarifying what's happening.

POSIX-2024 does not actually require this constant, but it does say:

> Traditionally, some implementations defined the multiplier for
> st_blocks in <sys/param.h> as the symbol DEV_BSIZE.

And indeed, glibc, musl, and FreeBSD (at least) all define it.
So it seems to make sense for us to do the same.

Related to #19251.
2026-01-20 14:43:37 -05:00
Augustin Cavalier 9be2b373d3 locale: Refactor ctype storage and consolidate some files.
* Drop the global definitions from ctype.h, and move them to
   the internal LocaleData.h: the functions should be used always
   when building new applications (as they're thread-safe.)

 * Make __ctype_get_mb_cur_max thread-safe and move it to live
   alongside the other __ctype...() methods.

 * Put the __ctype...() methods in two files, clearly indicating
   versions: ctype_loc_global for the global (non-thread-safe) versions,
   used for the kernel, and ctype_loc_thread for the libroot versions.

 * Consolidate more internal functions into LocaleInternal.cpp.
2026-01-15 18:48:10 -05:00
Augustin Cavalier 2d20dfef26 libroot/locale: Consolidate some headers.
No behavioral change intended.
2026-01-15 18:48:09 -05:00
Augustin Cavalier 35061cc3cb limits.h: Add missing _POSIX2_CHARCLASS_NAME_MAX. 2026-01-07 17:08:43 -05:00
Augustin Cavalier 713e7b2c54 locale: Implement getlocalename_l.
Specified in POSIX-2024.

GNUlib currently has a nasty Haiku-specific hack to implement
equivalent functionality; after this it should be able to use
this function instead.
2026-01-07 16:27:46 -05:00
Augustin Cavalier b0570368f3 limits.h: Clean up and fix _POSIX_* values.
These aren't actual limits, but rather the minimum limit
as specified in POSIX (e.g. _POSIX_NAME_MAX is the minimum
allowed value for NAME_MAX).

Add missing values as defined in POSIX-2024, at least for
features we support, and change wrong values to be the ones
specified in POSIX.

No behavioral intended change (nothing should be using these directly.)
2026-01-06 19:57:07 -05:00
Augustin Cavalier d763a3829a semaphore.h: Add SEM_VALUE_MAX.
It's specified in POSIX, and FreeBSD puts it in this file.

Distinguish it from _POSIX_SEM_VALUE_MAX (which is really a
"minimum value this can have" as specified in POSIX.)
2026-01-06 19:40:23 -05:00
Augustin Cavalier ca5c5d531e unistd: Add _POSIX_DEVICE_CONTROL.
We have posix_devctl, so we should declare this now.
2026-01-06 19:38:49 -05:00
Augustin Cavalier 1e4c529aeb search.h: Declare posix_tnode as specified in POSIX-2024.
FreeBSD does the same.
2026-01-06 19:37:53 -05:00
Kacper Kasper d620b23279 Implement missing methods in PictureBoundingBoxPlayer
* Remove const from gradient in StrokeLineGradient.
  BoundingBoxPlayer needs to apply transform to it.
* Extend LayersTest.
* Use BStackOrHeapArray for polygons.
* Fixes #12937.

Change-Id: If0a4abec0168dbe9afe7ea92bb29017ea8c89c79
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10211
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-06 21:22:30 +00:00
Oscar Lesta 95225b150f fs_shell: use FSSH_B_DEV_NAME_LENGTH instead of 128.
Follow up to 9d432d1b00.

Change-Id: Ie7013573a0682058849e84aa939bc38a821f3ae6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10209
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-06 13:28:44 +00:00
X512 2a4448e033 PicturePlayer: Use C++ virtual interface instead of C function table
Also use C function table instead of `void*` table function casts.

Improve type safety and readability.

Change-Id: Ie5f544b5c2bb9f2333fe3353462325dbfb4453ec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9656
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-04 22:56:43 +00:00
X512 ceaf2dd2d6 app_server: add gradient stroke support
TODO: HTML5 remote desktop client.

Change-Id: Ie2a32c4a498462578476d29a7000ea0b6f86810b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9625
Reviewed-by: waddlesplash <[email protected]>
2026-01-04 22:56:43 +00:00
beaglejoe 3f38072551 Fix platform.h for C compilation
Allow platform.h to be used by POC files

Change-Id: I809749422e12f4c4b2c616ca0994b158f3cd054c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4251
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-04 07:24:21 +00:00
SED4906 64f088f495 BAlert: play user-selected sound
* Alert sounds are separate from notifications

Change-Id: I9e5545084faea354ddd339154c10b54d6479b404
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8477
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-03 13:41:24 +00:00
Samuel Rodríguez Pérez a3f6c4d484 input: Implement click finger behaviour (enabled by default)
input touchpad settings header:
- click finger behaviour (enabled by default)
- Emulation of different button clicks depending on the
  number of fingers that are pressed at the same time on
  any location of the touchable surface of the device.
    - Clicking with 1 finger triggers a primary button click,
      usually left button click.
    - Clicking with 2 fingers triggers a secondary button click,
      usually right button click.
    - Clicking with 3 fingers triggers a terciary button click,
      usually middle button click.

  This feature is useful for clickpads that are input devices
  lacking a separated set of buttons from the touch area.

input preflet:
- Implement clickfinger

input mouse:
- Handle and provide new settings for clickfinger behaviour

input mouse mm:
- Implement clickfinger in the user space
- Enables button emulation based on the number of fingers pressing
  at the same time the touch surface.

  Userful feature for clickpads.

Change-Id: Ibaa06df3887793158093cc08f6281fc080e85c3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9923
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-02 11:01:29 +00:00
Samuel Rodríguez Pérez f44235f7e5 input: Implement software button areas (disabled by default)
input touchpad settings header:
- software button areas (enabled by default)
- Emulation of buttons clicks based on which small area
  assinged by each button is pressed. For instance, a
  software button area on the bottom of the touchpad
  could be divided on 3 subareas one for each button.

This new feature is useful for clickpads that are input devices
lacking a separated set of buttons from the touch area. However,
we may prefer to make the GUI better suppot "single button" devices.
Disabled by default as we don't currently have a way to adjust the
default settings according to the presence of physical buttons,
and having this disabled yields an OK experience on all machines.
Having the soft buttons in addition to physical buttons would just
be too strange.

input preflet:
- Implement software button areas

input mouse:
- Handle and provide new settings for software button areas

input mouse mm:
- Implement software button areas in the user space
- At the moment only a bottom located software button area
  simulating 3 different buttons is enabled.
  There is a working implementation 2 buttons only but not
  enabled in the code base.
  TODO for other type of software button areas is there.

Change-Id: I255cb1a7eac0d18064c63a2a0d4b158be7370a17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9922
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-02 11:01:29 +00:00
Samuel Rodríguez Pérez 696c694dbb input: Implement edge motion (enabled by default on tap drag)
input headers:
- Add edge motion constants

input touchpad settings header:
- Edge motion (enabled by default as on tap drag)
- Help moving the cursor and the primary finger transitions
  from one place of the touchpad to its edge and then stays
  on the edge for some time.
  The default matches the current hardcoded behaviour.

input preflet:
- Implement edge motion options

input mouse:
- Handle and provide new setting for edge motion

input mouse mm:
- Enable edge motion on tap drag based on settings instead of being hardcoded
- Some users who didn't have a chance to read the users' documentation could
  wrognly believe that this feature is a bug by not understanting why
  unexpected cursor movement happen at constant speed on some scenarios
  sometimes not even realising that it happens when the finger is approaching
  to the edges of the touch area by mistake.

  At least, even if this is the current default setting at the moment, this
  enables the chance to change it instead of being a obscure hardcoded feature.

input mouse mm:
- Enhance edge motion with extra behaviours
- Support for other edge motion aids apart from "on tap drag only".

Change-Id: Ice50139f9f8001494f7e2a46bb1521a1e525cade
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9921
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-02 11:01:29 +00:00
Samuel Rodríguez Pérez 6d4c0985d4 input: Implement two-fingers natural scrolling (enabled by default)
input touchpad settings header:
- Implement two-fingers natural scrolling (enabled by default)
- Sets scrolling with 2 fingers on the touchpad making
  the content to move in the same direction as the finger.

input preflet:
- Implement 2 fingers natural scrolling

input mouse:
- Handle and provide new settings for 2 finger natural scrolling

input mouse mm:
- Implement two-finger natural scrolling feature
- Implement natural scrolling for two-finger scrolling completely
  separated from reverse scrolling for egde scrolling only.

Change-Id: Idf673ec34a424b20183ed90761f297340d521526
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9919
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-01-02 11:01:29 +00:00
John Scipione 9d432d1b00 fs_info: Use B_DEV_NAME_LENGTH instead of 128 and remove TODO.
Change-Id: I2c93aee052ac4393512d457e1e84c969e5a927f9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10131
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-01 08:36:35 +00:00