Age | Commit message (Collapse) | Author |
|
|
|
* Always return 0 if `WNOHANG` is specified and no waitable child is
found, even if `wstatus` is null.
* Do not return 0 if the child is continued. Treat it the same way as
all the other states.
Refer to the RETURN VALUE section of the POSIX spec:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/wait.html
|
|
Like other systems, we can encode the continued state with 0xffff in the
status value. This is needed for some ports.
|
|
Implement futimes() in terms of utimensat(). Now, utimensat() strays
from POSIX compliance because it also accepts a combination of a file
descriptor of a regular file and an empty path. utimensat() then uses
this file descriptor instead of the path to update the last access
and/or modification time of a file. That being said, its prior behavior
remains intact.
With the new behavior of utimensat(), `path` must point to a valid
string; given a null pointer instead of an empty string, utimensat()
sets `errno` to `EFAULT` and returns a failure.
|
|
Long live the DisplayConnector object!
|
|
|
|
|
|
|
|
The DisplayConnector class is meant to replace the FramebufferDevice
class. The advantage of this class over the FramebufferDevice class is:
1. It removes the mmap interface entirely. This interface is unsafe, as
multiple processes could try to use it, and when switching to and from
text console mode, there's no "good" way to revoke a memory mapping from
this interface, let alone when there are multiple processes that call
this interface. Therefore, in the DisplayConnector class there's no
implementation for this method at all.
2. The class uses a new real-world structure called ModeSetting, which
takes into account the fact that real hardware requires more than width,
height and pitch settings to mode-set the display resolution.
3. The class assumes all instances should supply some sort of EDID,
so it facilitates such mechanism to do so. Even if a given driver does
not know what is the actual EDID, it will ask to create default-generic
EDID blob.
3. This class shifts the responsibilies of switching between console
mode and graphical mode from a GraphicsAdapter to the DisplayConnector
class, so when doing the switch, the GraphicsManagement code actually
asks each DisplayConnector object to do the switch and doesn't rely on
the GraphicsAdapter objects at all.
|
|
|
|
This is a copy of linux's KDSETMODE/KDGETMODE console ioctl(2)
interface.
|
|
These allow you to turn the close-on-exec flag on/off via ioctl().
|
|
|
|
|
|
This ioctl operation will allow userspace to determine the index number
of a MasterPTY after opening /dev/ptmx and actually getting an internal
file descriptor of MasterPTY.
|
|
|
|
|
|
We currently don't really populate most of the fields, but that can
wait :^)
|
|
Just like Dr. POSIX ordered. Move the macro where it belongs, but make
sure it's visible to Userland files compiled with -DKERNEL. Parts of
LibEDID that are compiled into the Kernel use offsetof to parse the
EDID information given to us by hardware.
|
|
POSIX doesn't tell us to export a macro like this, and it's largely
going to never be defined when compiling a serenity-native C++ file,
since AK defines it already.
This does raise a strange issue where some futex-related helpers in
serenity.h are declared with ALWAYS_INLINE. Whether these helpers belong
in a C-visible header as file-static methods is questionable, but let's
work around the issue but adding some preprocessor magic to make sure
these declarations get the behavior they used to have without leaking
macros.
|
|
|
|
This function is an extended version of `chmod(2)` that lets one control
whether to dereference symlinks, and specify a file descriptor to a
directory that will be used as the base for relative paths.
|
|
Add them in `<Kernel/API/Device.h>` and use these to provides
`{makedev,major,minor}` in `<sys/sysmacros.h>`. It aims to be more in
line with other Unix implementations and avoid code duplication in user
land.
|
|
In C++, a function declaration with an empty parameter list means that
the function takes no arguments. In C, however, it means that the
function takes an unspecified number of parameters.
What we did previously was therefore non-conforming. This caused a
config check to fail in the curl port, as it was able to redeclare
`rand` as taking an int parameter.
|
|
|
|
There's only two places where we're using the C99 feature of array
designated initalizers. This feature seemingly wasn't included with
C++20 designated initalizers for classes and structs. The only two
places we were using this feature are suitably old and isolated that
it makes sense to just suppress the warning at the usage sites while
discouraging future array designated intializers in new code.
|
|
This allows the gdb port to compile with our `regs.h`.
|
|
Most other syscalls pass address arguments as `void*` instead of
`uintptr_t`, so let's do that here too. Besides improving consistency,
this commit makes `strace` correctly pretty-print these arguments in
hex.
|
|
Add the `posix_madvise(..)` LibC implementation that just forwards
to the normal `madvise(..)` implementation.
Also define a few POSIX_MADV_DONTNEED and POSIX_MADV_NORMAL as they
are part of the POSIX API for `posix_madvise(..)`.
This is needed by the `fio` port.
|
|
This function is supposed to unlock memory ranges that were locked by
mlock, but since mlock is stubbed out right now, this is a no-op.
|
|
|
|
|
|
|
|
|
|
|
|
Also, remove incomplete, superfluous check.
Incomplete, because only the byte at the provided address was checked;
this misses the last bytes of the "jerk page".
Superfluous, because it is already correctly checked by peek_user_data
(which calls copy_from_user).
The caller/tracer should not typically attempt to read non-userspace
addresses, we don't need to "hot-path" it either.
|
|
This is not actually implemented at the moment, as we do not support
sending or receiving out-of-band data at all currently, but it is
required for some ports to compile.
|
|
|
|
This word is actually pretty awkward in context, but this patch merely
fixes the spelling instead of finding a better word.
|
|
|
|
This makes the types used in the PT_PEEK and PT_POKE actions
suitable for 64-bit platforms as well.
|
|
This allows userspace to trigger a full (FIXME) flush of a shared file
mapping to disk. We iterate over all the mapped pages in the VMObject
and write them out to the underlying inode, one by one. This is rather
naive, and there's lots of room for improvement.
Note that shared file mappings are currently not possible since mmap()
returns ENOTSUP for PROT_WRITE+MAP_SHARED. That restriction will be
removed in a subsequent commit. :^)
|
|
For 'true', this shaves off about 69 syscalls, as measured by strace.
|
|
|
|
The bool type is not available in C89.
|
|
We create a base class called GenericFramebufferDevice, which defines
all the virtual functions that must be implemented by a
FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other
FramebufferDevice implementations inherit from it.
The most important consequence of rearranging the classes is that we now
have one IOCTL method, so all drivers should be committed to not
override the IOCTL method or make their own IOCTLs of FramebufferDevice.
All graphical IOCTLs are known to all FramebufferDevices, and it's up to
the specific implementation whether to support them or discard them (so
we require extensive usage of KResult and KResultOr, together with
virtual characteristic functions).
As a result, the interface is much cleaner and understandable to read.
|
|
Some ports (like `bc` with history enabled) sensibly set the termios
character size to 8 bits.
Previously, we left the character size value (given by the bitmask
CSIZE) as zero by default (meaning 5 bits per character), and returned
ENOTIMPL whenever someone modified it. This was dumb.
|
|
|
|
This ioctl request makes it possible to get the size of a storage device
that has not yet been mounted.
|
|
In QtCreator (and under weird configurations with gcc), this used to
fail with the error messages like: "error: member of anonymous union
redeclares '___'".
This patch gives each member a unique name.
|