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.
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.
* 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.
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.
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.)
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]>
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]>
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]>
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]>
* Use LITTLE_ENDIAN instead of __LITTLE_ENDIAN (LITTLE_ENDIAN is what
POSIX now specifies and everyone seems to define - NetBSD also
defines _LITTLE_ENDIAN, but not __LITTLE_ENDIAN)
* file descriptors greater than 2 must be explicitly passed to a child
on NetBSD. POSIX leaves that unspecified, see
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#exec
* system library functions get declared with visibility "default" on
NetBSD, so a "hidden" visibility attribute is ignored on a
redeclaration. Work around by putting the functions in a namespace -
as they are extern "C", they still end up in the object file without
the namespace qualifier.
* remove the cast on the NULL pointer on the funopen call - it's not
needed and the types are different between FreeBSD (fpos_t) and
NetBSD/OpenBSD (off_t); also trying to change that upstream
https://github.com/openSUSE/libsolv/pull/603
Change-Id: I6ab7f3c74d18960d7589b403a1c219cdac85a453
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10133
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Similar to open firmware implementation.
This allows to load the kernel from a remote_disk_server.
IP address is recovered using LoadOptions with a syntax similar to the
Linux kernel network boot "ip" parameter. If this is not set, no network
booting is attempted, in order to not slow down normal booting by
waiting on network traffic.
Change-Id: I17738bbcde85921672965b9936a2b484f1e57c6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3678
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
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]>
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]>
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]>
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]>
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.
* 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.)