summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibMain
AgeCommit message (Collapse)Author
2022-11-01Everywhere: Explicitly link all binaries against the LibC targetTim Schumacher
Even though the toolchain implicitly links against -lc, it does not know where it should get LibC from except for the sysroot. In the case of Clang this causes it to pick up the LibC stub instead, which might be slightly outdated and feature missing symbols. This is currently not an issue that manifests because we pass through the dependency on LibC and other libraries by accident, which causes CMake to link against the LibC target (instead of just the library), and thus points the linker at the build output directory. Since we are looking to fix that in the upcoming commits, let's make sure that everything will still be able to find the proper LibC first.
2022-10-10Everywhere: Replace uses of __serenity__ with AK_OS_SERENITYAndrew Kaster
Now that we have OS macros for essentially every supported OS, let's try to use them everywhere.
2022-07-12Everywhere: Explicitly specify the size in StringView constructorssin-ack
This commit moves the length calculations out to be directly on the StringView users. This is an important step towards the goal of removing StringView(char const*), as it moves the responsibility of calculating the size of the string to the user of the StringView (which will prevent naive uses causing OOB access).
2022-03-24LibMain: Statically link LibMainLenny Maiorani
LibMain is dynamically linked in every binary. This results in a slightly slower load time. In the past people have pegged this at 0.7 ms on some hardware. This change makes it statically linked and eliminates 0.6 ms of run-time on my machine. This is tested by running a script which just executed `/bin/true` in a loop 10,000 times. Before this patch it reliably executed in ~90,000 ms. After this patch it is ~84,000 ms. This is a speed up of 6,000 ms over 10,000 executions, or 0.6 ms per execution.
2022-03-19LibMain: Add the ability to configure the exit code on errorSam Atkins
Some POSIX utilities are specified to return a specific value on error, which is not 1. `Main::set_return_code_for_errors()` lets you set it to that value.
2022-02-26LibMain: Update header includesLenny Maiorani
2022-01-28LibMain: Invoke tzset in LibMain so all apps can have time zone infoTimothy Flynn
Rather than finding apps that benefit from time zone awareness one-by- one, and calling tzset in their serenity_main, let's do it in LibMain.
2021-12-23LibMain: Make "Runtime error" `warnln` redJames Puleo
Stealing what Andreas did for the `dbgln` output, I think it also looks nice inside of Terminal :^)
2021-12-21LibMain: Don't `dbgln` runtime errors if not on SerenityJames Puleo
When on Lagom, `warnln` and `dbgln` both output to `stderr`. This makes runtime errors duplicated and more verbose than necessary.
2021-12-20LibMain: Print serenity_main() errors to the debug logAndreas Kling
And let's make them red too, to help us notice them. :^)
2021-12-20AK+LibMain: Improve formatter for AK::Error in userspaceAndreas Kling
Print the full associated string metadata by default (if available.)
2021-11-22LibMain: Rename .arguments to .strings :^)Pedro Pereira
Before this change, we would need to write arguments.arguments to access the Span<>, which doesn't feel too pretty.
2021-11-22AK+LibSystem+LibMain: Add Error::from_syscall() for syscall failuresAndreas Kling
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-22LibMain: Add a new library for more ergonomic userspace entry functionsAndreas Kling
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. :^)