Commit Graph

12 Commits

Author SHA1 Message Date
Luke
f2cc565670 LibC: Add SSIZE_MAX limit 2020-09-27 01:02:11 +02:00
Ben Wiederhake
ede5dbd7b3 Meta+LibC through LibHTTP: Make clang-format-10 clean
Why break at LibHTTP? Because "Meta+Libraries" would be insanely large,
and breaking between LibHTTP and LibJS makes the commits roughly evenly large.
2020-09-25 21:18:17 +02:00
Ben Wiederhake
1f9dcdc41c LibC: Use more flexible digit parsing code, deduplicate 2020-05-11 10:52:24 +02:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
joshua stein
5e430e4eb4 Build: add support for building on OpenBSD
This requires gcc8 from ports to build the Toolchain.
2020-01-02 21:03:53 +01:00
Andrew Kaster
618aebdd8a Kernel+LibPthread: pthread_create handles pthread_attr_t
Add an initial implementation of pthread attributes for:
  * detach state (joinable, detached)
  * schedule params (just priority)
  * guard page size (as skeleton) (requires kernel support maybe?)
  * stack size and user-provided stack location (4 or 8 MB only, must be aligned)

Add some tests too, to the thread test program.

Also, LibC: Move pthread declarations to sys/types.h, where they belong.
2019-11-18 09:04:32 +01:00
Brandon Scott
f999e30afd LibC: Added execlp method and new pathconf setting
Added execlp method, and _PC_PIPE_BUF setting to pathconf method.
2019-11-16 12:50:50 +01:00
Andrew Kaster
98c86e5109 Kernel: Move E2BIG calculation from Thread to Process
Thread::make_userspace_stack_for_main_thread is only ever called from
Process::do_exec, after all the fun ELF loading and TSS setup has
occured.

The calculations in there that check if the combined argv + envp
size will exceed the default stack size are not used in the rest of
the stack setup. So, it should be safe to move this to the beginning
of do_exec and bail early with -E2BIG, just like the man pages say.

Additionally, advertise this limit in limits.h to be a good POSIX.1
citizen. :)
2019-10-23 07:45:41 +02:00
Vincent Sanders
904bd3b441 Libc: make library internal includes come from private include namespace 2019-10-11 12:17:05 +02:00
Sergey Bugaev
89bf38864a LibC: Misc additions 2019-10-03 08:18:05 +02:00
Mauri de Souza Nunes
6d7c928359 LibC: Add MAXPATHLEN to limits.h
MAXPATHLEN defines the longest permissable path length after expanding
symbolic links. It is used to allocate a temporary buffer from the buffer
pool in which to do the name expansion, hence should be a power of two.

On UNIX MAXPATHLEN has the same size as PATH_MAX.
2019-09-13 09:21:41 +02:00
Andreas Kling
04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00