Commit Graph
10600 Commits
Author SHA1 Message Date
Augustin Cavalier 9f786b6af7 Rename "headers/private/utils" to "util".
This undoes some changes from cf930b7e6c.

Nearly all the other utility directories in the tree are named "util"
not "utils", so let's be consistent.
2025-12-09 16:03:02 -05:00
PulkoMandy 97675f2fc4 arm: relocate UART when remapping virtual memory
The uart virtual address changes as soon as we apply the kernel memory
map. gUART is used only after that, from serial_init() onwards. So it
should use the virtual address, and not the physical address it was
previously created with while parsing the FDT.

Change-Id: I8c8a024fe564b49d6555f8e48f5ab31652d30708
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10068
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-12-09 19:35:39 +00:00
PulkoMandy 172caabf4d BitUtils: fix gcc2 build
Change-Id: Ib347785c466df7df3f40c4781bb46f6fc12ef647
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10046
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-12-09 10:08:25 +00:00
PulkoMandy cf930b7e6c Move BitUtils.h outside of kernel directory
It is not specific to the kernel

Change-Id: I334c39b39d74f61b30215fb5489dec09e318dacd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10049
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-12-09 10:08:25 +00:00
PulkoMandy 9cb525a2e3 FunctionTracer: add support for "this" pointer and custom printf function
Prepare for replacement of modified version used in input_server addons.
Adapt existing callers.

The "this" argument is required, and the CALLED macro can only set it to
one single value for an entire file currently. So, in any case where at
least one standalone function or static method uses CALLED, the macro
has to use a NULL pointer for all calls.

Change-Id: I42fdcbeaf6dd039d4c4369818220ad85e0b8087e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10041
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-12-03 07:48:12 +00:00
PulkoMandy b939b5a9f4 debug_printf: return number of printed characters
For compatibility with other printf functions

Change-Id: I52c85d590b8480427952740cb896112bb4e71c18
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10044
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
2025-12-02 09:43:45 +00:00
Kacper Kasper ccf8b1e96f BTab: decouple display label from view name.
In BeOS, the tab label was synchronized with the view name. This means
BTab::SetLabel would change the view name. This behavior is unexpected,
and also annoying, for example it prevents using localized tab labels
but fixed view names for scripting.

* Document this divergence from BeOS in the Haiku book
* Detect if we're running in a BeOS app to preserve the old behavior
  then

Change-Id: I5b758a035fe8752cee2ea7789a30ea47a01467b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/122
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-12-02 08:00:36 +00:00
PulkoMandy b1ff3e6c46 FunctionTracer: use __PRETTY_FUNCTION__
Change-Id: I49d53f4bb7b65d32c9e1e22be89add6199ccad24
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10038
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Niels Sascha Reedijk <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-12-01 09:48:36 +00:00
Samuel Rodríguez Pérez 5cc2a47ef1 input headers: Fix fingerWith documentation + license update
Add and fix description of the current values for fingerWith
field and related constants along with future expectations
for the same. The latest explainted as TODO item.

Change-Id: I876a9cf03a935309159401a6c88d9047bf225f90
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9863
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-11-29 19:36:51 +00:00
Augustin Cavalier 39c7c29e69 net_server: Run DHCP negotiation on a separate thread to fix hangs.
Previously we ran DHCP negotiation on the looper thread. This meant
that we just blocked it for long periods of time, which stopped
configuration settings changes from working properly, and causing
the Network preferences panel to hang when net_server failed to
respond to its messages.

Now, we spawn a separate thread to do the real work on, and unlock
the looper around the recvfrom() with long timeouts. There's now a
kMsgAutoConfigureFailed that is sent when auto-configuration fails,
so that the AutoconfigLooper can fallback as before. Additionally,
the main NetServer class quits loopers for devices on any configuration
change, rather than deferring it unecessarily (and possibly wrongly, in
some cases.)

Fixes #18037. Probably fixes #17300 and may help with others.
2025-11-27 14:30:54 -05:00
Augustin Cavalier 1838903ee6 RosterPrivate: Define kMsgAppServerStarted as uint32 to appease GCC2. 2025-11-19 00:46:04 -05:00
Augustin Cavalier 49a92384f4 servers & kits: Rehabilitate app_server restart functionality.
* It's not really possible to distinguish between a first startup
   and a restart inside app_server itself. Due to the new BServer
   setup, the same port will still be used, too. So, change the
   messages sent to just "AppServerStarted".

 * Since the message is sent out much later than the port is created,
   by the time applications see it, the app_server may have already
   been started a while and applications may have connected to it.
   So, check if we really need to reconnect in BApplication before
   actually trying to do that.

 * BWindow now starts with updates disabled, so they must be
   enabled after reconnecting.

After this commit, basic app_server restart functionality works again;
it's restarted automatically by launch_daemon after dying or being killed
and applications automatically reconnect. However, some problems still
linger (e.g. Terminal doesn't always recreate its windows, colors
on the Desktop look wrong, missing desktop background image, etc.)
2025-11-18 22:26:31 -05:00
Augustin Cavalier d640e20575 BeBuild.h: Add _DEPRECATED.
Change-Id: I983e89fa5324983f3721c50904d2a1d9b2014009
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9087
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: X512 X512 <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-11-16 16:37:38 +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 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
Augustin Cavalier 5769051834 kernel/vm: Drop methods used only by the old guarded heap.
They're not needed anymore. The VMTranslationMap method was confusingly
named anyway, as the other Debug* methods are for use in KDL, while
this one required the regular locks and flush mechanisms.

Change-Id: Ic1baf3d786071562d8beaeb768d996cd1d34f9b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9706
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-31 02:36:19 +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
John Scipione 17a87a2077 Tracker: Add Disks to Desktop nav menu if "Show Disks" setting is on.
Rename AddRootItemsIfNeeded() to AddVolumeItems().

Fixes #19720

Change-Id: I866b7364012b2d267809d9f49059ef531ec4a24f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9741
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-27 16:28:45 +00:00
PulkoMandy f80d1b0293 kernel/util: make convertutf available to C code
No reason to make it C++-only

Change-Id: Ia9c1aff68876fd0d9a4bcf82d69f5e6ec6878ca0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9738
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-27 12:48:11 +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
Augustin Cavalier 4ccb957d6c x86_acpi_cstates: Port to the new ACPI and CPUIDLE APIs.
Tested by OscarL and confirmed to be working on at least
one machine, though on others it hangs, so leaving out
of the default builds for now.

This adds an "acpi_processor_id" field to x86 arch_cpu_info,
gleaned from the MADT, so we can match our cpu_ents to ACPI
processor objects. (FreeBSD does a similar mapping, see
their acpi_cpu_probe method.)

Change-Id: Idb5e3c1fc1efaa4256d60ea17dd1824345369687
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9637
Reviewed-by: waddlesplash <[email protected]>
2025-10-10 18:24:56 +00:00
X512 31f0983fb2 remove accidentally set executable file bit
Change-Id: I6eb500ee8dc3ad0e699c3c3ec5e07d4a75264eb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9686
Reviewed-by: waddlesplash <[email protected]>
2025-10-10 15:31:55 +00:00
X512 47538c534f ClientMemoryAllocator: use map and reference count
- Resolve TODO about using map for server area_id lookup.

- Remove server cloned area delete request logic because it is less
  efficient and robust. Cloned area delete request messages may be
  missed if client message queue is full so it may cause cloned area
  leak.

- Implement reference counting for cloned areas instead.

Change-Id: Ie434ad36c2761ab0df00d341d55a6cea67b69830
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9667
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-06 15:10:48 +00:00
X512 b6f74b4905 app_server: do not pass BAffineTransform as-is over server link
BAffineTransform is not POD type and contains vtable. Reading it from
byte stream as-is will cause vtable corruption.

Change-Id: I1371444444ffa47f77a88f5f82b3fe6ea031b14c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9660
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-23 01:54:28 +00:00
X512 647aba7574 ServerLink: move Read*/Attach* method implementations to LinkSender/Receiver
Change-Id: Ib4dec3348b1438bbdfbaf18146d8aebb1978c39c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9631
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-08 16:42:25 +00:00
Augustin Cavalier bc50ada648 kernel/slab: Use FIFO instead of LIFO queueing for the object cache.
This should make use-after-frees more likely to be caught by the
standard paranoia facilities (and make them less likely to be
exploitable as memory will take longer to be reused.)
2025-09-03 15:41:58 -04: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
Joachim Mairböck b54f586058 sys/wait.h: add WCOREDUMP as alternative to WIFCORED
As this is part of POSIX since 2024, WCOREDUMP is the new default name.
WIFCORED is retained under _DEFAULT_SOURCE.

Fixes #19735.

Change-Id: Ic3f65e47b436bae92fe82ef73c3094be6bc9f29d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9622
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 16:33:57 +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
Augustin Cavalier fb6c279a24 kernel/x86: Use MWAITX or TPAUSE in arch_debug_snooze, if available.
These instructions are only available on more recent CPUs (MWAITX
on AMD since around 2015 or so, TPAUSE on Intel since around 2020.)
They allow idly waiting on the TSC even when interrupts are
disabled.

Most hypervisors do not have these available (KVM does provide
them, though not on all configurations), but on bare metal this
should make a nice difference to KDL power consumption: I tested
with a Ryzen 3700X, according to my UPS (so including monitor
and peripherals) the system used ~106 W at idle, 160 W in KDL
before this patch, and 125 W in KDL after it.

Change-Id: Id7a22ecd33f3fc005b2c312f945dc3cd364e96fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9604
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-25 20:16:16 +00:00
Augustin Cavalier 2082e1b86e kernel/debug: Introduce arch_debug_snooze() and make use of it.
The idea is to add a facility that will use less CPU than
the loops we currently use. The default implementation just
calls spin(), which is rdtsc+pause. This already may save
some power compared to what we previously did, which was to
re-check serial ports, PS/2, etc. every single loop in
the debugger, broken up only by "pause".

Change-Id: Ie421adae5c25ad6ae0c266d1d28c2ea7b81ae465
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9603
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-25 20:16:16 +00:00
nipos 6de89c6cdf BMCMenuBar: Add hover effect, like on buttons
Fixes #19671

Change-Id: I2ef001666ac4fa88364c7c5d5c95b0d96d5a090a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9605
Reviewed-by: Stefano Ceccherini <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-25 14:33:15 +00:00
X512 03d4f24535 BPicture: fix clipping region storage
Part of #1133.

Change-Id: I0d727056dd7302f5a320987b83a27c9571e9684f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9609
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-25 14:32:39 +00:00
Augustin Cavalier 4df505d911 kernel/EntryCache: Use a hash table with atomics for insertions.
This massively cuts down on lock contention in Add(), since insertions
only acquire a write-lock in the case where a generation rolls over,
same as Lookup() does.

"git status" in buildtools, cold disk cache in a 4-core VM, seems about
the same, maybe slightly slower (~0.5s seemed typical, out of 20-21s),
while with a hot disk cache it's much faster: ~9.8s -> ~2.4s. Compile
performance seemed about the same.

Change-Id: Ia73f35fbbad3b3ac9ed783ea38cb8e2cb9818b5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9580
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-14 00:40:41 +00:00
Peter van Dijk dc7e982148 intel_extreme: add support for 8086:5a85 Apollo Lake GT1 (Intel HD500)
plus PCH ID for brightness control

plus untested 5a84 entry

Change-Id: I2bc63390f932f52b47324be9e13366a26f8cec2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9578
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-08-07 06:37:08 +00:00
Jim906 22375f018d fat: Enable 4096-byte sector sizes
* Correct code that only works when sector size is 512 bytes.
* For devices with 4096-byte sectors, use 4096 as the size of blocks
  in the block cache, and as the unit of IO requests in FAT
  operations.
* Some values continue to be stored in 512-byte units, regardless of
  sector size, in keeping with the original BSD driver.
* Fixes #19686.

Change-Id: I8fa77aeab1bc93a5465134018c3113afb2a80b8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9542
Reviewed-by: waddlesplash <[email protected]>
2025-08-04 15:06:48 +00:00
X512 2a70c45937 TokenSpace: fix token wraparound
Fix bug that allocating/freeing a lot of BHandler cause token wraparound
and overwriting existing assigned tokens.

Change-Id: I12527126644bca1793a8475dc487f131e6f83437
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9533
Reviewed-by: waddlesplash <[email protected]>
2025-08-03 22:50:25 +00:00
Peter van Dijk 00c891c0c8 sys/time.h: Add TIMEVAL_TO_TIMESPEC and TIMESPEC_TO_TIMEVAL.
They're found in this header on the BSDs and Linux.

Change-Id: Ic822138dbedb046f85c5d4e92bf393a4496bd6a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9556
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-03 22:47:57 +00:00
John Scipione e32d782cb4 Tracker: Allow draggable container icon on Root, Trash and Printers
Use new DraggableContainerIcon name when invalidating icon.

Create a ShouldHaveDraggableFolderIcon() method on BContainerWindow
to consolidate the gating logic to a method.

We alert if you try and copy, move or create link to any of these
directories, however you may drag the icon in some instances such as
to change the directory in a file panel or to open the directory up
in FileTypes. You may create a link to the printers directory.

Set the Printer icon on the printers directory.

Fixes #3385

Tracker: Disks menu in CountView

* Open Disks directory on click.
* Skip volumes with no capacity (e.g. system, config) from
  Root and Desktop menus (still shown in Home and volumes though).
* No Trash on volumes, add only to Desktop.
* Declare some variables outside loop.
* Rename originatingWindow to source.

Fixes #3549

Change-Id: I66318d2485a5a8405f5459c355a467f34e19ecc5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9499
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-07-30 04:07:05 +00:00
John Scipione c16a8cad1a Storage Kit: Add support for FAT16 type
Change-Id: I626550b83179e5ad429ed7b8ebc6b8d320446cbe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8959
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-07-21 10:46:06 +00:00
PulkoMandy 11adda21aa Expose more info in signal handler mcontext
Add the following:

- CS and SS registers
- For 32bit: DS, ES, FS, GS registers (on 64 bit these are not part of
  the iframe structure)
- CR2 register (fault address)
- Hardware interrupt number
- Hardware error code

The hardware error code, interrupt number and fault address are not
modifiable by the signal handlers. The other registers can be modified.

This is used for example in dosemu to intercept errors from JIT generated
code and resume execution. Wine can also make use of it.

In order to not change the size of struct mcontext, these are inserted
in a region of the FXSAVE structure that is available for the OS to
store some data (as documented by Intel) and that we didn't use before.

Fixes #7867

Change-Id: Ia3c27a2c728e32995196c646c1d78adf40e793ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9456
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-07-19 18:00:39 +00:00
Augustin Cavalier 801c025d7b file_systems/QueryParser: Invoke ConvertValue in CalculateScore.
We need fSize to be set for operator scoring.

Also, use operator scoring for GREATER_THAN and GREATER_THAN_OR_EQUAL.

Fixes a KDL reported in #19677.
2025-07-12 15:48:14 -04:00
PulkoMandy d27a926578 runtime_loader: implement RTLD_GROUP
The RTLD_GROUP flag to dlopen comes from Solaris. It makes the symbol
resolution for dlopen not use the global symbols from the current team
(anything that's already loaded). The loaded object must be explicitly
linked against any symbol it needs to use (or it can use dlsym to search
symbols in the global scope explicitly).

This is also how symbol resolution worked in BeOS, meaning we already
have the code to do this, and just need to enable it.

This can be used in dosemu, where DOS-like executable are linked against
their own C library and should not use symbols from libroot.

Fixes #19674.

Change-Id: I8d127c7812a31e231edb1e44edf70b868c2670e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9450
Reviewed-by: waddlesplash <[email protected]>
2025-07-11 06:56:43 +00:00
Augustin Cavalier 687e76e3f9 kernel/vm: Make the first CACHE_TYPE be 1 instead of 0.
We store this value in a bitfield, so we can't use -1 to mean
invalid/unknown. Move the first value up so that 0 can be used
for that instead.
2025-07-07 17:05:11 -04:00
Augustin Cavalier 9ea1065b16 kernel/fs: Introduce check_write_stat_permissions utility method.
Like check_access_permissions() but for write_stat() hook instead
of access().

Basic logic copied from BFS, but with the UID/GID logic rewritten
to better conform to behavior on other OSes: notably, we allow
chown() requests that keep the UID the same to go through, same
as Linux seems to, which should fix #19666. We now also validate
that the GID is one of the current team's groups.
2025-07-07 15:10:01 -04:00
Augustin Cavalier 7ed202f9ed kernel: Add is_in_group(Team*) private utility method and use it in the VFS.
Slightly more efficient than using getegid() and getgroups().

While at it, make the user-group utility methods C++-only.
2025-07-07 15:02:17 -04:00