* Put each package on its own line. This mirrors the earlier
refactor of image rules.
* Drop a few packages with library-only provides. The build
system will pull them in automatically as needed (libicns, etc.)
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.
... 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]>
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.
I added this assertion thinking it would incorrectly override
thread locales, and that invocationns this way would be a bug.
Instead it appears that this is the expected behavior in select
circumstances.
Fixes#19896 and other recent regressions.
* 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.
Just like O_NOFOLLOW. Also drop the now-redundant checks from
all filesystems.
At least some filesystem hooks (FIFOs in particular, see #19879) did not
check this, so this fixes them.
* get_new_fd is actually too late for the O_TRUNC one: we will
have already called the vnode open() hook by then. So, we
need to do that in open_vnode.
* Move checks to a new static helper method, and invoke it
in all relevant places.
* Delete now-redundant O_NOFOLLOW checks.
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.
Otherwise, calling open(O_CREAT) on a path that exists but is
a directory will succeed.
Fixes Sortix os-test open-tmpdir-rdonly-creat. (Interestingly
many other OSes also fail this test; only Linux, FreeBSD, Solaris,
and Sortix, and now also Haiku, properly return EISDIR.)
While at it, fix the doc comment, which appears to have been
copied from open_vnode.
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.)
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.)
We have returned "1" here since this code was originally written
in 2004 (hrev7290). BeOS R5 apparently returns "1000009" for this
value, while the Be Book gives no details about what this value means.
So, return an actually useful value of the Haiku version, and then
in uname() process this to return a string indicating the Haiku
version. This makes "uname" print the actual system version,
not just the hrev.
It appears Linux and other systems give non-integer values in
info->release, so this should be fine.
Fixes#17030.
It isn't working properly; see #19874.
Leave the others enable for testing for now. We can disable them
in the beta6 branch if necessary (if nobody reports that they are
indeed working.)
The manpages indicate get2 will return NULL for anything larger
than MJUMPAGESIZE.
(The soon-to-be-merged realtekwifi from FreeBSD 15 uses m_get3 directly.)
This function always declared that it returned status_t, but
then in practice it didn't. In d225106a20
that was fixed, so these workarounds can be removed now.
Fixes#19862.
This code is triggered whenever an area gets resized to be as large
as, or larger than, a reservation. That can happen with the new heap
when it grows to rather large sizes, in which case we would then leak
the address space when the team was deleted (including all the page
table memory.)
Fixes memory leaks seen e.g. when running Rust compiles, and especially
other short-lived but high-memory-use applications.
We don't need a lock here (as we just want the TranslationMap),
but we do need to release the reference we acquired when finished,
otherwise the address space will be leaked.
All these can be built with DEBUG=1 now, it appears.
I tested most of the others and they still fail.
(The settings in this section can be overridden by setting something
else in UserBuildConfig, it appears; they're likely only relevant
when trying to build the entire tree with DEBUG=1.)
This follows up after 3b7038d884: migrate the copy-from-userland
logic into a separate method, migrate all consumers to use it, and
add more missing checks and initializations.
Change-Id: I6a2e11a2d0fae7ecf1c94f5b112fa946aaef68ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10055
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
num_endpoints will be changed by the ioctl; we need to use the old
one when deleting the array.
fDescriptor is just zeroed if we fail to fetch, so just perform
the deletions up-front.
These aren't in POSIX but glibc and FreeBSD support them,
and our ICUTimeData class expects that strftime will handle them.
Fixes#18471 and some of the problems described in #14356.
If we only checked one, then of course we can't set LC_ALL,
as that will override ones we didn't verify were the same.
Seems this code has been wrong since it was first imported in 2010.
Fixes#19446.
SetScreenMode() and other methods around here also acquire it
in this way.
Adjust one place in ServerApp that would cause a lock-order-inversion
otherwise.
Should fix#19837.
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.
Previously this actually succeeded, which could obviously cause
disk corruption and other such problems.
While at it, clean up some code style.
Fixes#16734. Related to #19303.
This way, if the Desktop has locked its window list, RemoveWindow
will wait until the lock is released, at which time we're guaranteed
that the Desktop object will no longer be using this window.
May fix#19750 and related tickets.
* 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.)
It seems to be unecessary and just hangs the CLI most of the time
if there's no thread about to stop.
Makes Debugger --team <team> actually work instead of just
hanging.
This partially reverts commit 61790bdb8a.
These aren't really "common", they're specific to the "Intel" partitioning
system, which GPT also interacts with. So, move them back to the "intel"
folder, but keep the static library setup the commit moving them
to the "common" folder created, which is indeed better and was most
of the advantage of that commit.
If we were "donated" some commitment (e.g. in copy_on_write_area)
then we don't want to drop it when pre-committing.
Fixes some commitments being too low in forked teams.
Partition::ReadAt() and WriteAt() already do bounds-checking
based on the size, but Size() was returning the underlying FD
size, which might be that of the entire disk, not just this
partition. So, move initialization around a bit, and return
the actual size.
Should fix the bootloader menu displaying the wrong sizes
for boot partitions.
B_USE_HALF_ITEM_SPACING is 6 with a 12pt font, so this increases
the insets slightly. B_USE_BIG_SPACING should be 20, so that
should be the same.
Improves tooltip appearance on HiDPI.
* Set IP_DONTFRAG on all TCP sockets by default.
* Handle receiving B_NET_ERROR_MESSAGE_SIZE, update MaxSegmentSize
appropriately, and trigger retransmit.
Tested and verified as working.
Part of #1073. However this doesn't implement all of what's needed,
only the most basic form of the algorithm (we don't record MTUs
for reuse later for instance, right now we only store routing
information for the LAN, it appears, so we will need somewhere else
to store that.)
Change-Id: I37a24b50db18af908c6f6257c6fb6d72127d2787
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9402
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Make IORequestOwner an abstract (ish) class, and move details
to the Scheduler implementations. This will allow other drivers
(like NVMe) to use their own, separate IORequestOwner system.
* Use an object_cache to allocate IOSchedulerSimple::RequestOwners.
Previously, a single block large enough to store one for every
thread at maximum thread count (4096) was allocated, meaning
a few hundred KB per IOScheduler. In the case of low memory,
a fallback IORequestOwner with a thread ID of -1 is used.
Tested with IDE and usb_disk drivers, seems to be working.
As we may have stolen some commitment from the first cache already,
so it will try to increase it here, which won't work if the system
is low on memory.
Should fix#19813.
Than the one used by the area, anyway, so we need to call Rebase
as well as Resize in all cases where the cache is getting reused.
This case happens (rarely) with the bdwgc's gctest, with mprotect VBD
enabled (which still doesn't work reliably, it sometimes crashes userland
or trips asserts in the kernel, but it seems to trip less after this
change.)
Also, let the CacheChainLocker take care of releasing and unlocking
the cache even in the onlyCacheUser case.
* Use the control color, which is what DrawButtonBackground expects
to get the previous appearance.
* Actually use the HEADER_BACKGROUND color from the main view,
which previously was not used at all, allowing applications
to override.
BControlLook::DrawButtonBackground now expects the control color
directly, not the panel background color.
Restores the previous appearance (or one close to it) from before
the control color changes.
sourceCache is now only != NULL if it represents the "cache"'s source.
And "cache" will always be locked when we get to "err2", so we need
to use ReleaseRefAndUnlock.
Should fix#19810.
Creating areas with B_ALREADY_WIRED is done early in the boot process
after VM initialization to create area objects for pages that have
already been allocated and mapped. As such, it should absolutely never
fail, since nearly everything should already have been set up.
But if it does fail, that almost certainly means it either should not
have been called in the first place, or there is some sort of invalid
state. Testing with ARM64 builds, this assertion trips, revealing
that the kernel is actually being placed outside of the declared
KERNEL_BASE+KERNEL_SIZE at present.