History log of /haiku/src/tools/fs_shell/unistd.cpp
Revision Date Author Comments
# dc509bfa 18-Feb-2023 Augustin Cavalier <waddlesplash@gmail.com>

fs_shell: Use proper readv/writev functions on Haiku hosts.

Fixes #18269.


# 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.


# f6381021 22-Oct-2021 Augustin Cavalier <waddlesplash@gmail.com>

Remove conditions for HOST_PLATFORM=msys.

It never really worked beyond the most basic of commands
and required a lot of hacks, and these days WSL should be used instead.


# 27ecd476 03-May-2020 Augustin Cavalier <waddlesplash@gmail.com>

build: More miscellaneous fixes for MSYS.

Remove the .exe hack, as it is not needed.


# 637d9997 14-Dec-2017 Augustin Cavalier <waddlesplash@gmail.com>

tools: Fixes following build syscall change.


# 1465ec71 13-Dec-2017 Augustin Cavalier <waddlesplash@gmail.com>

build/kernel: Properly shadow syscall functions.

I didn't notice this in the previous commit because apparently GCC2
just links against libroot's versions of them. On GCC5, however,
the version from libroot_build was used even for calls from libroot itself,
which led to infinite loops and then stack overflows.

So instead we must have the "syscall" functions in libroot_build shadow
the real ones by being named differently, which I did by changing their
prefix from "_kern" to "_kernbuild" via preprocessor macros.

Since the build syscalls.h is now substantially different than the non-
build one (and has not been synchronized in nearly a decade anyway),
I've just stripped out all the syscall defns except for the ones actually used
in the build.

Thanks to kallisti5 for helping me debug and test.


# c85220c6 30-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* This fixes my last change...


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


# b6fffec7 30-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* The fs_shell is now always using BLKGETSIZE64 on Linux, and only if that fails
it will fall back to HDIO_GETGEO.
* This fixes incorrectly reported disk sizes for a number of disks I have here.
Please open a bug report if this change causes problems for you (we would then
have to check the kernel version to choose the preferred method).


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


# 04eb9ba1 21-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by "VinDuv" (Vincent Duvert?): Added FSShell support for devices on
MacOS X.


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


# bc3955fe 23-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Preparations for removing __BEOS__ from the compiler defines.


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


# b0b6878c 02-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

<sys/ioctl.h> also seems to be the standard Linux place for the
ioctl() prototype. Apparently some Linuxes discarded the <stropts.h>
header which POSIX demands.


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


# fbed3589 30-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

The incorrect indentation fooled me. <stropts.h> is already included in
Linux.


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


# 3d62be2e 30-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Not so in BeOS/Haiku, but officially ioctl() is defined in <stropts.h>.


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


# ea70c8b6 23-Jul-2008 Maurice Kalinowski <mauricek@nowhere.fake>

julun+mauricek:
* additional includes for cygwin
* some automatic whitespace cleanup

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


# c09ac5cf 18-Mar-2008 Stephan Aßmus <superstippi@gmx.de>

patch by Artur Wyszynski (aljen):
Build fix for Darwin host platform.


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


# da517192 24-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Samuel Rodriguez Perez:
Fixed building Haiku images on FreeBSD, which was broken since the
introduction of the device support.


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


# 5d06d469 17-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed debugging leftover.


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


# 3e617040 17-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

axeld + bonefish:
Added parameters --start-offset and --end-offset to restrict the
access of the file system to only that part of the given file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23970 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


# d3a580d2 05-Dec-2007 Axel Dörfler <axeld@pinc-software.de>

The fs_shell now also works with devices that don't return a correct
hd_geometry, but do support the BLKGETSIZE64 ioctl (it just crashed
before).


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


# 9e12e9a7 01-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added mapping of dup() in the FS shell.
* Adjusted the FS initialize() hook to have FD and partition_id
parameters like the other hooks instead of the partition path.
* Adjusted initialization in BFS accordingly.
* Implemented the FS initialization method in KFileSystem.


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


# 362d99e7 24-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added fssh_read/write() implementation.


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


# 53a79a4c 19-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Morgan Howe: Support for building on Mac OS X. It should now be
possible to build a complete Haiku image.


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


# 21da0339 05-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Typo.


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


# 047b4d3c 05-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Samuel Rodriguez Perez (slightly modified): Make the new
bfs_shell build on FreeBSD. ioctl() is defined in a non-standard header.


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


# 19d7a2a1 02-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the syscalls into the FSShell namespace, so that they don't
collide with the functions defined in libroot_build.so.
* On BeOS incompatible platforms fssh_open() and fssh_close() use the
libroot_build.so _kern_open() and _kern_close() respectively, so that the
attribute support works also when using the generic attribute
emulation.
* Use fssh_open()/fssh_close() instead of open()/close() for the cp
command, so that we get attribute support on BeOS incompatible
platforms when the generic attribute emulation is used.


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


# c3c6ad0a 30-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

BeOS build fixes:
* On BeOS compatible host platforms we must not include
BeOSBuildCompatibility.h, but HaikuBuildCompatibility.h.
* Fixed errno usage in command_cp.cpp.
* Fixed fssh_ioctl().
* fssh_set_sem_owner() doesn't invoke BeOS's set_sem_owner() anymore or
otherwise the FS's semaphores are assigned to the kernel.
* Commented out <string.h> functions that don't exist under BeOS (and aren't
used anyway).


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


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

Beginnings of a new, better portable FS shell with Haiku FS interface.
Doesn't do anything ATM, but already provides the required system
interface (VFS, caches, POSIX functions).


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


# c85220c63ab3dc511367f6084de26423c392673c 30-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* This fixes my last change...


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


# b6fffec7e1e606b449ce67d6d37298be9c4f48f3 30-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* The fs_shell is now always using BLKGETSIZE64 on Linux, and only if that fails
it will fall back to HDIO_GETGEO.
* This fixes incorrectly reported disk sizes for a number of disks I have here.
Please open a bug report if this change causes problems for you (we would then
have to check the kernel version to choose the preferred method).


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


# 04eb9ba18ee507391d5ca7f1c10e2e14f7b3bbc9 21-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by "VinDuv" (Vincent Duvert?): Added FSShell support for devices on
MacOS X.


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


# bc3955fea5b07e2e94a27fc05e4bb58fe6f0319b 23-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Preparations for removing __BEOS__ from the compiler defines.


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


# b0b6878c97c307f4c6d43ca904a3b47703c2f129 02-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

<sys/ioctl.h> also seems to be the standard Linux place for the
ioctl() prototype. Apparently some Linuxes discarded the <stropts.h>
header which POSIX demands.


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


# fbed358934ae67333eddf0b37293fe02c9a7bc3a 30-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

The incorrect indentation fooled me. <stropts.h> is already included in
Linux.


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


# 3d62be2e7904e029987091e7d2488b0fa75eae0c 30-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Not so in BeOS/Haiku, but officially ioctl() is defined in <stropts.h>.


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


# ea70c8b6f35d415767e1c61e1274cda260e2b15c 23-Jul-2008 Maurice Kalinowski <mauricek@nowhere.fake>

julun+mauricek:
* additional includes for cygwin
* some automatic whitespace cleanup

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


# c09ac5cf13ff0644163477c7f7b3f706d9f1ee93 18-Mar-2008 Stephan Aßmus <superstippi@gmx.de>

patch by Artur Wyszynski (aljen):
Build fix for Darwin host platform.


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


# da51719239a50b438988b4df7a03d6e6923a1ce1 24-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Samuel Rodriguez Perez:
Fixed building Haiku images on FreeBSD, which was broken since the
introduction of the device support.


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


# 5d06d469354e307522c6eada09464a4abad7be4b 17-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed debugging leftover.


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


# 3e617040425cd87f7af90804151ee8cb1f0ab8e9 17-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

axeld + bonefish:
Added parameters --start-offset and --end-offset to restrict the
access of the file system to only that part of the given file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23970 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


# d3a580d2e08269c7d26523d1b926b18796ea2682 05-Dec-2007 Axel Dörfler <axeld@pinc-software.de>

The fs_shell now also works with devices that don't return a correct
hd_geometry, but do support the BLKGETSIZE64 ioctl (it just crashed
before).


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


# 9e12e9a72e7fde25482302f2d9a6a680fd2c0e6a 01-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added mapping of dup() in the FS shell.
* Adjusted the FS initialize() hook to have FD and partition_id
parameters like the other hooks instead of the partition path.
* Adjusted initialization in BFS accordingly.
* Implemented the FS initialization method in KFileSystem.


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


# 362d99e7159523d0b8f949ceb87d43e441bdd22b 24-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added fssh_read/write() implementation.


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


# 53a79a4cde1643d209fbbb157e270242e074da08 19-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Morgan Howe: Support for building on Mac OS X. It should now be
possible to build a complete Haiku image.


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


# 21da0339129c8f8c7fb0a3bf3d320fda8d5f53d4 05-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Typo.


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


# 047b4d3cc83e2c73439533762bc22b88631e1d4e 05-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Samuel Rodriguez Perez (slightly modified): Make the new
bfs_shell build on FreeBSD. ioctl() is defined in a non-standard header.


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


# 19d7a2a162c1adc9775fdbc3c89c22327386354e 02-May-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved the syscalls into the FSShell namespace, so that they don't
collide with the functions defined in libroot_build.so.
* On BeOS incompatible platforms fssh_open() and fssh_close() use the
libroot_build.so _kern_open() and _kern_close() respectively, so that the
attribute support works also when using the generic attribute
emulation.
* Use fssh_open()/fssh_close() instead of open()/close() for the cp
command, so that we get attribute support on BeOS incompatible
platforms when the generic attribute emulation is used.


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


# c3c6ad0a0be88d057b4f87a81277bf3ec232df39 30-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

BeOS build fixes:
* On BeOS compatible host platforms we must not include
BeOSBuildCompatibility.h, but HaikuBuildCompatibility.h.
* Fixed errno usage in command_cp.cpp.
* Fixed fssh_ioctl().
* fssh_set_sem_owner() doesn't invoke BeOS's set_sem_owner() anymore or
otherwise the FS's semaphores are assigned to the kernel.
* Commented out <string.h> functions that don't exist under BeOS (and aren't
used anyway).


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


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

Beginnings of a new, better portable FS shell with Haiku FS interface.
Doesn't do anything ATM, but already provides the required system
interface (VFS, caches, POSIX functions).


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