History log of /haiku/src/system/libroot/posix/fcntl.cpp
Revision Date Author Comments
# 158b8fda 21-Sep-2021 Niels Sascha Reedijk <niels.reedijk@gmail.com>

libroot: return EOPNOTSUPP from posix_fallocate

The pre-allocate functionality was added to Haiku in hrev54704. It needs
support at the file system level though, and it is yet to be implemented by
BFS. Some applications (and glibc!) implement a fallback mechanism using
ftruncate(), including the LLVM tools, but they go to this fallback
mechanism when it is clear that the operation is not supported. In particular
they look for EOPNOTSUPP.

The current implementation returns B_UNSUPPORTED from the vfs layer when a
file system does not implement the feature. This error code this not map to
a POSIX error. This change converts it to EOPNOTSUPP.

Change-Id: Ief382b0f4d462dfedf84c731f68f69731de4498c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4492
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# fe357eb9 05-Nov-2020 Jérôme Duval <jerome.duval@gmail.com>

POSIX: add posix_fallocate and a preallocate syscall

the preallocate syscall will call the preallocate filesystem hook, if available.

fix #6285

Change-Id: Ifff4595548610c8e009d4e5ffb64c37e0884e62d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3382
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 38ce9026 20-May-2019 Jérôme Duval <jerome.duval@gmail.com>

posix: add posix_fadvise(), only error checks.

should help for ports.

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


# 195a0f35 21-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Changed argument type of fcntl syscall from uint32 to size_t.

Since this argument may be used to pass pointers, uint32 is not
correct for 64-bit. Effectively no change on 32-bit targets, both
size_t and uint32 are unsigned long there.


# ae901935 24-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Introduce __set_errno() throughout libroot.

* add errno_private.h, which defines the __set_errno() macro with
and without tracing
* instead of setting errno manually, all libroot's code now invokes
__set_errno(), which makes it much easier to trace changes to errno
* redirect glibc's use of __set_errno() to our own version


# 24df6592 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


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


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

* Added missing AT_EACCESS.
* Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat().
* Added stub for mknodat().
* The kernel backend for faccessat() does not yet differentiate between
effective and real user/group IDs, though.
* Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything
(more or less). This also closes ticket #4928.


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


# db2b554f 10-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the POSIX *at() functions and AT_* macros out of the default namespace
as long as the full set hasn't been implemented. They are guarded by the
B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT macro until then. Fixes the build.


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


# 098906f1 10-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* src/system/libroot/posix: Moved open.c and fcntl.c out of the unistd
directory, where they were misplaced, and joined them to fcntl.cpp.
* Added openat().


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


# 195a0f350e3acd76856016f673c8a871ed687a07 21-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Changed argument type of fcntl syscall from uint32 to size_t.

Since this argument may be used to pass pointers, uint32 is not
correct for 64-bit. Effectively no change on 32-bit targets, both
size_t and uint32 are unsigned long there.


# ae9019359606f1db67632ef51a77ce70001d3770 24-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Introduce __set_errno() throughout libroot.

* add errno_private.h, which defines the __set_errno() macro with
and without tracing
* instead of setting errno manually, all libroot's code now invokes
__set_errno(), which makes it much easier to trace changes to errno
* redirect glibc's use of __set_errno() to our own version


# 24df65921befcd0ad0c5c7866118f922da61cb96 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


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


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

* Added missing AT_EACCESS.
* Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat().
* Added stub for mknodat().
* The kernel backend for faccessat() does not yet differentiate between
effective and real user/group IDs, though.
* Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything
(more or less). This also closes ticket #4928.


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


# db2b554fa368b03940b495c2f439d4f6e738d282 10-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the POSIX *at() functions and AT_* macros out of the default namespace
as long as the full set hasn't been implemented. They are guarded by the
B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT macro until then. Fixes the build.


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


# 098906f1d4b43059bd427e27950debf7ac31a493 10-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* src/system/libroot/posix: Moved open.c and fcntl.c out of the unistd
directory, where they were misplaced, and joined them to fcntl.cpp.
* Added openat().


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