Commit graph

9 commits

Author SHA1 Message Date
Tim Schumacher
c85f307e62 LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
SeekingBlues
cba4750921 LibC: Add POSIX spec links to wait, waitpid and waitid 2022-06-17 10:59:26 +02:00
SeekingBlues
4796a25bbd LibC: Make waitpid's return value more POSIX-compliant
* 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
2022-06-17 10:59:26 +02:00
SeekingBlues
8730e56e88 LibC: Add WIFCONTINUED macro
Like other systems, we can encode the continued state with 0xffff in the
status value. This is needed for some ports.
2022-06-17 10:59:26 +02:00
Jean-Baptiste Boric
e16894af5a LibC: Do not include errno.h inside unistd.h
POSIX does not mandate this, therefore let's not do it.
2021-05-14 22:24:02 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Andreas Kling
e87eac9273 Userland: Add LibSystem and funnel all syscalls through it
This achieves two things:

- Programs can now intentionally perform arbitrary syscalls by calling
  syscall(). This allows us to work on things like syscall fuzzing.

- It restricts the ability of userspace to make syscalls to a single
  4KB page of code. In order to call the kernel directly, an attacker
  must now locate this page and call through it.
2021-02-05 12:23:39 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Renamed from Libraries/LibC/sys/wait.cpp (Browse further)