Timestamps in BFS are stored with a 16 bit subsecond precision. However,
a lot of files have this field set to 0 as they are created with APIs
that do not set a subsecond precsion value.
The previous format (introduced in hrev31057) did not track wether the
stored data was a 12 bit sequential number or a 12 bit subsecond
timestamp + 4 bit sequential number.
As a result, setting a timestamp with nsec=0 would read back a different
value (exposing the sequential counter to userspace).
Older versions of Haiku, and BeOS according to the Practical Filesystem
Design book, did not store a timestamp there. Haiku used to store the
volume UID (I don't understand why), and BeOS stored a sequence number
because the POSIX APIs at the time didn't allow to get and set the time
with nanosecond precision.
The Practical Filesystem Design already mentions that storing a
subsecond precision value here would have been better than their
workaround.
The new format relies on the fact that nanoseconds can only be in the
range from 0 to 999999999. After the conversion to a 16 bit value using
simple shifts, this result in a maximum possible value of 0xEE60. The
new format exploits that, and uses the range 0xF000 to 0xFFFF to
represent 0 timestamps with a 12 bit sequence number.
This allows the sequence number to be hidden from userspace entirely.
Fixes#19213.
Change-Id: Id80289a4331ecfbf2f1a35520b58a99227d1f1d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10146
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
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.
Gets rid of the annoying:
"cc1: warning: command-line option '-Wno-ctor-dtor-privacy'
is valid for C++/ObjC++ but not for C".
Change-Id: Ic72506277af56365cfe52513e1118584bf338ac9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10163
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
- Check superblock magic. Overwriting the first sector of partitions
using other filesystems is likely to cause trouble
- Tell the user when the partition was already bootable and nothing was
done, hopefully this will finally stop people from thinking that
makebootable is of any use (it isn't, Installer already does the
work).
Change-Id: I9352f1a3853626d093c04f8283771189395d023b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10171
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Assign correct MIME type for XHTML
* Fix XML encoding of '&' as '&'
* Use 'https' instead of 'http' where possible
Change-Id: I9d0628bd560b253bf9df10ed7e28eb77cf9161e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10168
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
The rule to add an executable or shared library to the Haiku image
automatically also includes the corresponding locale catalogs and MIME
database entries.
The locale catalogs for .a files linked in the executable are also
included, since .a files are not themselves added to the same package.
This makes sure the executable has all the catalogs it needs.
The jam rule was written assuming that NEEDLIBS would only contain .a
files, but that is not the case when compiling Haiku. Libroot for
example is also in NEEDLIBS (this makes sure it is linked by absolute
file path, whereas LINKLIBS would instead use -lroot and may link the
host system one).
Filter out .so files from the NEEDLIBS list when determining which
catalogs to include.
Fixes#19721.
Change-Id: I04604bd37c656f987dd17be8db6edffe88cee651
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10144
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* Unlock the volume once the directories are locked in dosfs_rename.
At that point locking the volume has served its purpose.
* If the volume lock is retained throughout dosfs_rename, a double
lock can occur in dosfs_read_vnode, in the event that one of the
involved file nodes has not already been constructed prior to the
rename.
* Fixes#19614.
Change-Id: Ib679a6f3ba3dc8f87fb0c6263eb82d2d06cb6064
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10166
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* This makes the BFS tools implementation independent from the actual
values of these macros to ease porting.
Change-Id: Id7aa8d38c2574875999362a147701f00ec8fab26
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10147
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Import fix from NetBSD PR lib/58888
This could have leaked data to the resolver or resulted in the resolver
returning incorrect results.
Change-Id: Idedb9d12c8ad7a88f0e5e05e735efdd8c914cbde
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10149
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[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]>
Use the existing practice from other operatign systems (at least
some places in Windows XP do this): fill the checkbox with a square
to indiate that it is partially activated.
There is already a color difference, but that is not visible when the
checkbox is also disabled, and maybe a bit too subtle in general.
Change-Id: Icd4403374bd1cec3efeb3146e64b352caabc6d82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10051
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* NetBSD is very similar to FreeBSD
* there is no libdl on NetBSD
* packages live in /usr/pkg on NetBSD
* the argument to tolower() must be representable as an unsigned char
Change-Id: Icff569c4472f7e91edd0ce6d489affb04babde7c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10130
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Add a simple tool to the installer that copies the Haiku EFI loader
to a valid partition of the user's choice. Very basic with the
intention of making this process a bit less annoying; nothing more than a
one-to-one implementation of the copy instructions on this page:
https://www.haiku-os.org/guides/uefi_booting/
Also, fix bug in BDiskDeviceRoster::FindPartitionByMountPoint that caused
an error to be incorrectly returned on success.
Change-Id: Ifd3bb96d907dc93908de5ead007c3d5e72b110b8
The arch_start code is quite similar for all efi architectures and may
be unified someday. Try to keep it as similar as possible by
synchronizing at least style fixes (variables renaming, line breaks,
format macro fixes).
No functional changes intended.
Change-Id: Ie4d54e73020e05a2af6755b7f5a65b92b4953080
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10106
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[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]>
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.