History log of /haiku/src/build/libroot/fs.cpp
Revision Date Author Comments
# 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