History log of /haiku/src/build/libroot/fs.cpp
Revision Date Author Comments
# 66196a82 13-Feb-2023 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: Correct read/write[v] functions.

The previous change was not tested thoroughly enough, it seems.


# 5e9fd9f6 13-Feb-2023 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build & fs_shell: Provide _kern_ functions for readv/writev...

..instead of readv_pos/writev_pos. This way, we can be sure that we
are remapping them properly even under Haiku, as well as remove some
potential confusions.

bfs_shell seems to still work fine on a regular build.


# f5dd7d3c 20-May-2022 Jessica Hamilton <jessica.l.hamilton@gmail.com>

libroot_build: fix stat of files in a symlinked directory

Only manifested itself with the host build tools, where looking
up a file inside a directory that is a symlink would fail, as the
cached stat info in NodeRef would fail to match the stat info to
check that the path still exists, as `lstat` returned the stat info
of the resolved symlink. Replacing `lstat` with `stat` fixes the
mismatching stat information cached in the NodeRef.

* Fixes #17750

Change-Id: I7cc360dd4678d2c4cf1186e9f39490a6bfd946a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5325
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 071a83af 29-Jan-2022 Adrien Destugues <pulkomandy@pulkomandy.tk>

fix macOS hosted build after hrev55802

The stat structure fields are not standardized, so we can't use an
hardcoded field name. The code in all other places was already adjusted
with a macro to handle the access, but hrev55802 introduced a new place
where we need to read the access and modification times. Use the macro
there as well.

Thanks to anuragpd4 for reporting the problem!


# eecf3977 26-Jan-2022 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: Implement FD writing STAT_ACCESS_TIME and STAT_MODIFICATION_TIME.

We have used and had fallback futimens() implementations in libroot_build
(and in this file even) for over a decade, but nobody seems to have noticed
this bit of missing functionality which can be implemented with them.

In fact, this is rather important bit of functionality, as "copyattr"
relies on it to preserve the mtimes of copied files; and we use
recursive copyattr many places in Haiku builds. Thus, the lack of
an implementation here was the cause of all files in built Haiku images
having timestamps of whenever the build was done, and not whenever
the file was actually modified.

This should make development on Haiku nightlies much more pleasant,
as the system headers from the haiku_devel package should no longer
have always-current timestamps with every upgrade.


# 001e157a 18-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: Add better error checking to _kern_dup.

This way, we will get a more coherent crash instead of
an unceremonious one. Follow-up to #17389.

Change-Id: Iffbf421ce85d638628243d5785ba61ff6b9a8043
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4729
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 2e8023b3 06-Sep-2021 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: Use "=" instead of "+=" for clarity's sake.

No functional change.


# 906fe097 05-Sep-2021 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: Rework path normalization to not rely on system calls.

This path normalization was functionally a recursive lstat(), which
should theoretically be identical to rooting the path in the CWD
and then normalizing the rest of the components after that.

Well, a recursive lstat() is much slower than simple manipulation.
How much slower? Well, on my system, the existing lstat() version
took up a combined total of 63,284,607 us for building haiku.hpkg
(only the package itself, no other components rebuilt), while
this new version uses just 47,901 us -- and this just for a @minimum!

I performed a full @nightly build with both versions in use at once,
with an abort() in place if paths ever did not match, and it
did not fire once. (I even sabotaged the new function just to
ensure that it would actually find differing paths.)

This code was merged in 338b8dc301721b1f472e8297a898d4eaa2f2ee3a (2005),
and has remained largely unchanged since then. I don't know what the
rationale was at the time for using this method instead of this much
simpler version. Perhaps the 3-argument normalize_dir_path was written
first and used more, while this 2-argument version was added later
as a simple shim? But the original commit has no uses of the 3-argument
version aside from the 2-argument one...

Either way, this is an absolutely unbelievable speedup to Haiku builds.
These functions are hit in every I/O operation of all libroot_build
users, and their usages really do add up, as the example above shows.

Fixes #16288.

Change-Id: Ia11f64b0d4106ee62f22741a32ccc0c75c184442
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4427
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 20308ad6 29-Apr-2021 Jérôme Duval <jerome.duval@gmail.com>

build: follow-up for hrev54993

should help with bug #16929, untested

Change-Id: Ia7b9b6cc8e84e2377d79c0edd1c278cdf74d869b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3891
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# f97357a6 24-Mar-2021 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Fix building on Haiku after hrev54993

Build tested on Linux.

Change-Id: I911ac42d99a0c1e94cab77dc29bf43d8f7f91093


# e1b7c1c7 19-Apr-2020 Kyle Ambroff-Kao <kyle@ambroffkao.com>

storage/SymLink: Fix Be API regression in ReadLink

After this patch, "UnitTester BSymLink" passes.

BSymLink::ReadLink() in BeOS would always return the length of the
link unless an error occurred. Before this patch, Haiku instead seemed
to emulate posix readlink() behavior, returning the number of bytes
copied into the output buffer.

BeOS also did not guarantee that the string written into the output
buffer is NULL terminated if the output buffer cannot contain the
entire link contents, but the Haiku implementation does since it is is
a basic safety issue.

This patch fixes this and updates the Haiku API docs to describe the
behavior explicitly.

Fixing this required changing behavior in bfs_read_link, which
required changes in many more places.

docs/user/storage/SymLink.dox:
src/kits/storage/SymLink.cpp:
* Don't return B_BUFFER_OVERFLOW if the provided buffer is not large
enough to hold the link contents.
* Update documentation to clearly describe behavior.

src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp:
* Change bfs_read_link() to always return the link length. This is
called by common_read_link in the VFS, which is called by
_kern_read_link().

src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp:
src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp:
src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp:
src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp:
src/add-ons/kernel/file_systems/netfs/client/netfs.cpp:
src/add-ons/kernel/file_systems/nfs/nfs_add_on.c:
src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp:
src/add-ons/kernel/file_systems/reiserfs/Iterators.cpp:
src/add-ons/kernel/file_systems/reiserfs/Iterators.h:
src/add-ons/kernel/file_systems/reiserfs/Volume.cpp:
src/add-ons/kernel/file_systems/reiserfs/Volume.h:
* Update the implementation of read_link for these filesystems. Some
of them were incorrect, and some had just copied the posix behavior of
bfs from before this patch.
* Use user_memcpy in ext2_read_link()
* Use user_memcpy in nfs fs_read_link()
* Use user_memcpy in reiserfs StreamReader::_ReadIndirectItem and
StreamReader::_ReadDirectItem
* Remove unused method Volume::ReadObject in reiserfs.

src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp:
src/add-ons/kernel/file_systems/packagefs/package_links/PackageLinkSymlink.cpp:
* Update UnpackingLeafNode::ReadSymlink and
PackageSymLink::ReadSymLink() to set the bufferSize out parameter to
the symlink length. Both of these are called by
packagefs_read_symlink.
* Use user_memcpy

src/add-ons/kernel/file_systems/netfs/client/netfs.cpp:
* netfs seems mostly unimplemented. Added a FIXME note for future
implementers so that they know to implement the correct behavior.

src/system/libroot/posix/unistd/link.c:
* readlinkat() was just wrapping _kern_read_link() because before this
patch it had expected posix behavior. But now it does not, so we
need to return the number of bytes written to the output
buffer.

src/build/libroot/fs.cpp:
* Update _kern_read_link() in the compatibility code to emulate the
Haiku behavior on the host system. This is done by using an
intermediate buffer that is guaranteed to fit the link contents and
returning its length. The intermediate buffer is copied into the
output buffer until there is no more room.

src/tests/kits/storage/SymLinkTest.cpp:
* This patch also resolves some test failures similar to those
resolved in ee8cf35f0 which fixed tests for BNode. The tests were
failing because Haiku's error checking is just better.

BeOS allowed constructing a BSymLink with BSymLink(BDirectory*,
const char*) with the entry name of "". The same is true of the
equivilant SetTo() method. The BSymLink object will appear valid
until you attempt to use it by, for example, calling the ReadLink
method, which will return B_BAD_VALUE.

Haiku does a more appropriate thing and returns B_ENTRY_NOT_FOUND,
for this constructor and the equivilant SetTo(BDirectory*, const
char*) method. This patch fixes these test assertions to match Haiku
behavior.

docs/develop/file_systems/overview.txt:
* Add notes for future filesystem driver implementers to call this
mistake when implementing fs_vnode_ops::read_symlink.

docs/user/drivers/fs_interface.dox:
* Fix documentation for fs_vnode_ops::read_symlink

Change-Id: I8bcb8b2a0c9333059c84ace15844c32d4efeed9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2502
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# 2f5551ec 04-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: make path normalization more robust

In case we don't have read permission for an ancestor directory, we try
to guess the path from the CWD.


# 280b7cb6 06-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: Improve/fix get_path()

In fs_attr_generic() get_path() is used with a symlink FD, which didn't
work at all. Handle symlink descriptors explicitly now.


# 75c10de2 26-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build _kern_read_dir(): reset errno before readdir()

Since we're checking errno when readdir() didn't return an entry, we
need to reset it before, or we might see a spurious error value.


# c92c12d7 08-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: Fix incorrect skipDot check in find_dir_entry()

Would result in the _kern_open_parent_dir() failing for "/" and maybe in
other cases as well.


# a43b1ed6 11-Aug-2012 John Scipione <jscipione@gmail.com>

Split fs_darwin.h defines into various platform dependent headers.

This completes the final 1/3 of #8857. Changes again by nielx with
style fixes by me.

The one part that I couldn't figure out, and maybe Ingo can chime
in here. If headers/build/host/darwin/sys/stat.h is surrounded in

extern "C" {

}

guards then I get a link error complaining that the functions defined
here are duplicate symbols, once in fs.o and once in function_remapper.o.
For example:

ld: duplicate symbol _futimens in generated/objects/darwin/x86_64/release/build/libroot/libroot_build_function_remapper.a(function_remapper.o) and generated/objects/darwin/x86_64/release/build/libroot/libroot_build.a(fs.o) for architecture x86_64

I'm not sure why that is.


# 81b45e48 29-Feb-2012 John Scipione <jscipione@gmail.com>

Fix build on Mac OS X 10.6 gcc2 and gcc4 and 10.7 gcc4 by adding some Mac OS X specific files that implement missing *at() functions.
Mac OS X 10.7 generates a gcc2 cross-compiler that fails when assigning NULL to a static method pointer so is still broken.
Added a weak attribute in driver_settings.cpp.
Move futimesat() from fs.cpp to fs_darwin.cpp since it is implimented on FreeBSD.
Implemented eaccess(), for the AT_EACCESS flag of faccessat()
Fix configure script to correctly detect case-sensitive file system


# 00f72094 29-Feb-2012 John Scipione <jscipione@gmail.com>

Move futimesat() from fs.cpp to fs_darwin.cpp since it is implimented on FreeBSD. It is stubbed out for now.


# 9d6e5fdb 29-Feb-2012 John Scipione <jscipione@gmail.com>

Fix build by adding some Mac OS X specific files that implement fs function missing on that OS. The functions are stubbed out currently and have not been implemented. However, it does build now. I also added a weak attribute in driver_settings.cpp that I have no idea what does but was necessary to fix the build.


# b328f5b0 27-Nov-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: Explicitly support FreeBSD struct stat anomalies

Use stat::st_{a,m}timespec on FreeBSD instead of the POSIXish
stat::st_{a,m}tim. Fixes part of the FreeBSD build issues recently
introduced.


# 55bc3719 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Wrap POSIX FD functions in libroot_build

This makes opening symlinks work universally in the build system tools.
Two mechanisms have been implemented, both of which don't always work.
The first is remapping via preprocessor macros. This fails where equally
named methods are used (e.g. STL fstream::open()). The other is using
hidden functions in the new libroot_build_function_remapper.a that is
linked into everything that is linked against libroot_build.so. This one
fails for functions that are defined inline in headers (Linux/glibc does
that). Together they seem to cover our build system needs ATM.


# 640b4ed9 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

_kern_read_link() ignored the path


# 870d5c92 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

write_pos(): Fix return value for attribute writes


# d9516a06 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Open/close attribute support for xattrs backend

For the xattr/BSD (untyped) attribute backend implement fs_fopen_attr()
and fs_close_attr(). A new AttributeDescriptor is created. It is
currently used in write_pos() only.


# 4dbc2457 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Wrap POSIX FD functions in libroot_build

This makes opening symlinks work universally in the build system tools.
Two mechanisms have been implemented, both of which don't always work.
The first is remapping via preprocessor macros. This fails where equally
named methods are used (e.g. STL fstream::open()). The other is using
hidden functions in the new libroot_build_function_remapper.a that is
linked into everything that is linked against libroot_build.so. This one
fails for functions that are defined inline in headers (Linux/glibc does
that). Together they seem to cover our build system needs ATM.


# 775b8d7a 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

_kern_read_link() ignored the path


# 52e07969 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

write_pos(): Fix return value for attribute writes


# e781b1b5 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Open/close attribute support for xattrs backend

For the xattr/BSD (untyped) attribute backend implement fs_fopen_attr()
and fs_close_attr(). A new AttributeDescriptor is created. It is
currently used in write_pos() only.


# 880de450 26-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34287 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0aab2caf 30-May-2009 Jérôme Duval <korli@users.berlios.de>

fixed usage of char* when const char* is expected, reported by ziomatto


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30919 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b962e484 15-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

_kern_open_parent_dir has different semantics for the supplied name argument.
It's supposed to be filled with the entry name of the directory and not as in
all the other cases used as a leaf name to be appended to the dir. This would
lead to some errors with operations based on directory fds in the build libroot
and build libbe and in the end make generate_attribute_stores fail on platforms
that don't have an 0 initialized stack (since the supplied name buffer would
contain garbage later attached to the directory path).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80b2da5e 05-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Samuel Rodriguez Perez: Added support for writing Haiku
directly onto a device under FreeBSD.

I messed around with the code a little (style-fixes, some refactoring)
without being able to compile or test it, so be careful...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23880 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f54626a7 05-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Converted to UNIX line breaks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 598d0219 04-Sep-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed bug in the code normalizing entry paths, causing e.g. broken
symlinks to be not openable.
* When _kern_open() created a new file, invalid stat data were accessed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22176 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f38eff6a 26-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a few more functions to the host platform BeOS compatibility layer:
* thread related functions,
* semaphore related functions,
* atomic_*() functions,
* readv_pos(), writev_pos().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20858 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a9bf6ecb 07-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build.so:
* Reorganized sources a bit:
- The descriptor support is in a separate file now.
- Disentangled the attribute support from the other stuff.
* Removed broken xattr use for attribute support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20606 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1621d994 03-Feb-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Tried to improve the attribute support under non-BeOS compatible
build platforms a bit. Generally extended attributes seem to be
supported up to a very limited size per node, thus a one-to-one
mapping isn't a good idea, but I figured, they could at least
help to recognize when and attribute directory doesn't belong to
a node (in case the original node had been removed and the a new
one created with the same node ID).
The implementation should ensure that, but I can't really test
it, since ReiserFS 3.6 under my SuSE Linux 9.2 installation
apparently doesn't support extended attributes. So it's disabled
for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16228 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74e7fd41 29-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

This should finally fix the spurious "No such file or directory" errors
reported from our build tools under Linux. As it seems Linux does not
translate dirent::d_ino for mount points (BeOS and Haiku do), which
caused us not to find a mount point entry in its parent directory.
Thanks to Vampyre for the hint.
Fixes bugs #73 and #76.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90b6f0e5 13-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced a few lstat()s with stat()s where symlinks to directories would
be legal. This might even fix the bug that build tools like xres or
settype couldn't find an existing file under Linux (was never able to
reproduce that one, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14900 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 677aaae1 07-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

HaikuBuildCompatibility.h has been renamed to BeOSBuildCompatibility.h.
Should fix the build under Linux.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc3 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f5551ec2a9570c010306a563a29b64e9dcd292b 04-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: make path normalization more robust

In case we don't have read permission for an ancestor directory, we try
to guess the path from the CWD.


# 280b7cb63abaa3f6132a37a3ce7ad994f2ec7b52 06-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: Improve/fix get_path()

In fs_attr_generic() get_path() is used with a symlink FD, which didn't
work at all. Handle symlink descriptors explicitly now.


# 75c10de291a042a516805dc46a36b3d7f2890b0e 26-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build _kern_read_dir(): reset errno before readdir()

Since we're checking errno when readdir() didn't return an entry, we
need to reset it before, or we might see a spurious error value.


# c92c12d71ae1ef4eb25e7d81011a4544b8b234a0 08-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: Fix incorrect skipDot check in find_dir_entry()

Would result in the _kern_open_parent_dir() failing for "/" and maybe in
other cases as well.


# a43b1ed6d894723ed5dbc26e2c399e8ad46022d6 11-Aug-2012 John Scipione <jscipione@gmail.com>

Split fs_darwin.h defines into various platform dependent headers.

This completes the final 1/3 of #8857. Changes again by nielx with
style fixes by me.

The one part that I couldn't figure out, and maybe Ingo can chime
in here. If headers/build/host/darwin/sys/stat.h is surrounded in

extern "C" {

}

guards then I get a link error complaining that the functions defined
here are duplicate symbols, once in fs.o and once in function_remapper.o.
For example:

ld: duplicate symbol _futimens in generated/objects/darwin/x86_64/release/build/libroot/libroot_build_function_remapper.a(function_remapper.o) and generated/objects/darwin/x86_64/release/build/libroot/libroot_build.a(fs.o) for architecture x86_64

I'm not sure why that is.


# 81b45e484a2f71f1235d48ab743c20357f070593 29-Feb-2012 John Scipione <jscipione@gmail.com>

Fix build on Mac OS X 10.6 gcc2 and gcc4 and 10.7 gcc4 by adding some Mac OS X specific files that implement missing *at() functions.
Mac OS X 10.7 generates a gcc2 cross-compiler that fails when assigning NULL to a static method pointer so is still broken.
Added a weak attribute in driver_settings.cpp.
Move futimesat() from fs.cpp to fs_darwin.cpp since it is implimented on FreeBSD.
Implemented eaccess(), for the AT_EACCESS flag of faccessat()
Fix configure script to correctly detect case-sensitive file system


# 00f72094a1381200077f6cc7a40b3ab649fab11e 29-Feb-2012 John Scipione <jscipione@gmail.com>

Move futimesat() from fs.cpp to fs_darwin.cpp since it is implimented on FreeBSD. It is stubbed out for now.


# 9d6e5fdb651066357cf4e24f10c42238ad08d0b7 29-Feb-2012 John Scipione <jscipione@gmail.com>

Fix build by adding some Mac OS X specific files that implement fs function missing on that OS. The functions are stubbed out currently and have not been implemented. However, it does build now. I also added a weak attribute in driver_settings.cpp that I have no idea what does but was necessary to fix the build.


# b328f5b034431003d8651828c1987e1ea7ab9617 27-Nov-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build: Explicitly support FreeBSD struct stat anomalies

Use stat::st_{a,m}timespec on FreeBSD instead of the POSIXish
stat::st_{a,m}tim. Fixes part of the FreeBSD build issues recently
introduced.


# 55bc371993f0588118e3c684e18eae5b6e4a6e22 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Wrap POSIX FD functions in libroot_build

This makes opening symlinks work universally in the build system tools.
Two mechanisms have been implemented, both of which don't always work.
The first is remapping via preprocessor macros. This fails where equally
named methods are used (e.g. STL fstream::open()). The other is using
hidden functions in the new libroot_build_function_remapper.a that is
linked into everything that is linked against libroot_build.so. This one
fails for functions that are defined inline in headers (Linux/glibc does
that). Together they seem to cover our build system needs ATM.


# 640b4ed97da39d37de2e2021876fc27d08984d33 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

_kern_read_link() ignored the path


# 870d5c92feed97309b492ca2452f43877d5172c1 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

write_pos(): Fix return value for attribute writes


# d9516a06cccdc8a5d0d88ccb658b98080b2af5f0 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Open/close attribute support for xattrs backend

For the xattr/BSD (untyped) attribute backend implement fs_fopen_attr()
and fs_close_attr(). A new AttributeDescriptor is created. It is
currently used in write_pos() only.


# 4dbc2457985f94d2aa46668739f73231b4b2edfb 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Wrap POSIX FD functions in libroot_build

This makes opening symlinks work universally in the build system tools.
Two mechanisms have been implemented, both of which don't always work.
The first is remapping via preprocessor macros. This fails where equally
named methods are used (e.g. STL fstream::open()). The other is using
hidden functions in the new libroot_build_function_remapper.a that is
linked into everything that is linked against libroot_build.so. This one
fails for functions that are defined inline in headers (Linux/glibc does
that). Together they seem to cover our build system needs ATM.


# 775b8d7afd5380fc018b198df853a39c22885231 30-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

_kern_read_link() ignored the path


# 52e079692f1a43765ea6892b48cafcff96b88f37 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

write_pos(): Fix return value for attribute writes


# e781b1b5a801e6fe2f364a302e3201458b07e58f 16-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Open/close attribute support for xattrs backend

For the xattr/BSD (untyped) attribute backend implement fs_fopen_attr()
and fs_close_attr(). A new AttributeDescriptor is created. It is
currently used in write_pos() only.


# 880de4501c947bc25c5860ebfcd8eb79677dafde 26-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34287 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0aab2caf8eb8aebe803b7f68213469f1c8d96155 30-May-2009 Jérôme Duval <korli@users.berlios.de>

fixed usage of char* when const char* is expected, reported by ziomatto


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30919 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b962e4849812ecce5f50f5c086f9ac45cb311140 15-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

_kern_open_parent_dir has different semantics for the supplied name argument.
It's supposed to be filled with the entry name of the directory and not as in
all the other cases used as a leaf name to be appended to the dir. This would
lead to some errors with operations based on directory fds in the build libroot
and build libbe and in the end make generate_attribute_stores fail on platforms
that don't have an 0 initialized stack (since the supplied name buffer would
contain garbage later attached to the directory path).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80b2da5e53ba827b90cf70374c0aaf73cd95abf3 05-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Samuel Rodriguez Perez: Added support for writing Haiku
directly onto a device under FreeBSD.

I messed around with the code a little (style-fixes, some refactoring)
without being able to compile or test it, so be careful...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23880 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f54626a7ae5cfac264ef37722ab2c4767e5b3953 05-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Converted to UNIX line breaks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 598d02197263b999a02467dbdd42e6a081b108a8 04-Sep-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed bug in the code normalizing entry paths, causing e.g. broken
symlinks to be not openable.
* When _kern_open() created a new file, invalid stat data were accessed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22176 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f38eff6aa2d14c0c49f12dc9818d6b23cf9e861d 26-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a few more functions to the host platform BeOS compatibility layer:
* thread related functions,
* semaphore related functions,
* atomic_*() functions,
* readv_pos(), writev_pos().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20858 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a9bf6ecbab36fad5bf0abe29043a40b8b220662e 07-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build.so:
* Reorganized sources a bit:
- The descriptor support is in a separate file now.
- Disentangled the attribute support from the other stuff.
* Removed broken xattr use for attribute support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20606 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1621d9945f401a08d3eeed9bc3baf472111393f0 03-Feb-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Tried to improve the attribute support under non-BeOS compatible
build platforms a bit. Generally extended attributes seem to be
supported up to a very limited size per node, thus a one-to-one
mapping isn't a good idea, but I figured, they could at least
help to recognize when and attribute directory doesn't belong to
a node (in case the original node had been removed and the a new
one created with the same node ID).
The implementation should ensure that, but I can't really test
it, since ReiserFS 3.6 under my SuSE Linux 9.2 installation
apparently doesn't support extended attributes. So it's disabled
for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16228 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74e7fd417e3df253c17d9c2d805afa65cc5b69cd 29-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

This should finally fix the spurious "No such file or directory" errors
reported from our build tools under Linux. As it seems Linux does not
translate dirent::d_ino for mount points (BeOS and Haiku do), which
caused us not to find a mount point entry in its parent directory.
Thanks to Vampyre for the hint.
Fixes bugs #73 and #76.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90b6f0e5fe84249d9243c35673d217beae4e350a 13-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced a few lstat()s with stat()s where symlinks to directories would
be legal. This might even fix the bug that build tools like xres or
settype couldn't find an existing file under Linux (was never able to
reproduce that one, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14900 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 677aaae1873ffbe00493ecc193264e07bd7e4bf0 07-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

HaikuBuildCompatibility.h has been renamed to BeOSBuildCompatibility.h.
Should fix the build under Linux.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc301721b1f472e8297a898d4eaa2f2ee3a 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96