Commit graph

3 commits

Author SHA1 Message Date
Pedro Pereira a436f0c668 LibMain: Rename .arguments to .strings :^)
Before this change, we would need to write arguments.arguments to access
the Span<>, which doesn't feel too pretty.
2021-11-22 22:13:22 +01:00
Andreas Kling 4e530135d5 AK+LibSystem+LibMain: Add Error::from_syscall() for syscall failures
This creates an error that contains the name of the syscall that failed.
This allows error handlers to print out the name of the call if they
want to. :^)
2021-11-22 19:28:31 +01:00
Andreas Kling d3cf68a540 LibMain: Add a new library for more ergonomic userspace entry functions
By linking with LibMain, your program no longer needs to provide main().
Instead, execution begins in this function:

    ErrorOr<int> serenity_main(Main::Arguments);

This allows programs that link with LibMain to use TRY() already in
their entry function, without having to do manual ErrorOr unwrapping.

This is very experimental, but it seems like a nice idea so let's try it
out. :^)
2021-11-22 19:28:31 +01:00