summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-15misc: Implement some miscellaneous functionsSamuel Holland2-0/+34
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15error: Implement the error functionSamuel Holland2-0/+28
This follows the exceptionally-detailed functional description in the manual page. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15version: Minor improvementsSamuel Holland1-5/+17
* Document functions and sort by name. * Explicitly include stddef.h. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15string: Clean up, fix bugs, implement LSB plus moreSamuel Holland1-38/+199
* Add all checked string functions from LSB, plus those found in use in other applications. Document those functions from LSB as such. * Use a consistent structure and paramater names for all functions. * Fix multiple off-by-one errors. * Use a less hacky and more optimized rawmemchr. * Sort functions by name. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15stdlib: Implement most LSB functions plus moreSamuel Holland2-18/+107
* Fix prototype of __realpath_chk. * Add all strto* functions from LSB, plus the ones thata were previously incorrectly in string.c The main missing LSB functions are the reentrant random functions, which should not be used anyway. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15stdio: Clean up, add all of LSB stdio plus moreSamuel Holland3-82/+234
* Add all (non-wchar) stdio functions from LSB, plus those found in use in other applications. Document those functions from LSB as such. * Use a consistent structure and paramater names for all functions. * flag == 0 means FORTIFY_SOURCE=1, so the implemented checks should be unconditional. * Add all possible checks without parsing the format string. * Move functions from wchar.h to their own appropriately-named file. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15resource: Minor improvementsSamuel Holland1-4/+5
* Make function pointer static. * Only initialize function pointer once. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15resolv: Clean up, avoid NULL derefSamuel Holland1-8/+16
* Make comment style consistent with the rest of the project, and remove outdated header name. * Remove "static inline" from functions (this is no longer a header). * Check statp for NULL in res_ninit like in res_nclose. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15grp: Implement fgetgrent_r/getgrent_rSamuel Holland2-0/+99
Like fgetpwent_r/getpwent_r, these require a deep copy of the structure into the caller-provided buffer. This is nontrivial for the array of strings member. getgrent_r is required by LSB. [NOTE: I'm not too happy with the macro, but it works. Any suggestions?] Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-15pwd: Fully implement fgetpwent_r/getpwent_rSamuel Holland1-45/+74
These functions require a deep copy of the structure into the caller-provided buffer. Also make sure to store NULL in result on error. Use the stream to differentiate the two functions and avoid duplication. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14pthread: Clean up, fix prototypeSamuel Holland1-6/+17
* Add the missing parameter to __register_atfork. * Sort and document functions. __pthread_register_cancel and __pthread_unregister_cancel should be implemented at some point, or else pthread_cleanup_pop(true) will not work properly and could cause deadlocks in programs that use it. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14math: Clean up, add additional functionsSamuel Holland1-11/+80
* Add finite() variants, needed by some applications. * Add remaining long double variants of existing functions. * Sort and document existing functions, including where referenced in the LSB standard. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14malloc: Sort functions by nameSamuel Holland1-16/+18
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14dlfcn: Combine functions for the same header into one fileSamuel Holland4-29/+26
Changes to existing code: * Make explicit comparison against NULL. * Adjust debug message for readability. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14execinfo: Clean up, implement backtrace_symbols_fdSamuel Holland3-52/+98
Rename the file to match the header it implements functions from. Changes to existing code: * Fix the return value from backtrace (off by one). * Use __builtin_extract_return_addr as recommended in gcc documentation. * Document header usage. * Document where the functions are referenced in the LSB standard. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14loader: Several improvementsSamuel Holland1-18/+75
* Handle programs that have a DT_NEEDED entry for glibc's ld.so. * Handle when LD_PRELOAD is already set. * Use the --argv0 option to properly set argv[0] in the target program. * Ensure the the argument list is terminated with a NULL sentinel. * Document the details of the loader's implementation. [NOTE: Better commit summary?] Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14Makefile: Update compilation optionsSamuel Holland1-3/+4
* Remove -DPIC as it is unused (and PIC is always enabled). * Export the loader name as a macro (this will be used in the future). * Enable compiler warnings, except the expected ones. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14libgcompat: Add and use a macro for defining symbol aliasesSamuel Holland7-28/+38
* Prefer providing the underscore-prefixed symbol as the strong definition. * Do not use a weak alias if the alias is also underscore-prefixed. * Make libgcompat objects depend on the new header. [NOTE: I originally took the weak_alias macro from musl's libc.h, but it's trivial and the same pattern already in use. If desired, I can add the musl copyright notice.] Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14global: Format the code consistentlySamuel Holland17-125/+145
* Apply clang-format. * Change all comments to the same style. * Add braces as dictated by the coding style guidelines. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14Add clang-format configuration and Makefile ruleSamuel Holland2-0/+57
The settings here are based on the current code style documentation. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-14backtrace: Add semicolons after call to function-like macrosSamuel Holland1-10/+10
This duplicates the semicolon at the end of the macro, but it prevents clang-format from getting confused. This is only temporary until the macro is updated in a later commit. Signed-off-by: Samuel Holland <samuel@sholland.org>
2017-10-26Update CHANGELOG with 0.2.0 progress so farA. Wilcox1-0/+18
2017-10-26Makefile: Ensure correct compilation on GCC 4.xA. Wilcox1-2/+5
On GCC 4.9.4, at least backtrace.c fails to compile because of variable declaration in a for statement, which requires -std=c99 or -std=c11. Since we are using ISO C mode instead of a GNU standard, we additionally must define _BSD_SOURCE to expose Dl_info for the dl code.
2017-10-26sysctl: clean headers, ensure SYS__sysctl is def'dA. Wilcox1-3/+5
Linux/aarch64 does not define SYS__sysctl. This caused build errors in Alpine[1] and Void[2]. While I'm in here, fix up headers since we don't need errno or strings. [1]: https://git.alpinelinux.org/cgit/aports/commit/?id=400a9d40 [2]: https://github.com/voidlinux/void-packages/commit/a7aa924e
2017-10-15Release 0.1.00.1.0A. Wilcox1-0/+87
2017-10-15Update documentationA. Wilcox2-4/+14
2017-10-15ucontext: new moduleA. Wilcox2-0/+8
2017-10-15resolv: new moduleA. Wilcox2-0/+33
2017-10-15string: add strto[u?]ll_l 'locale-aware' methodsA. Wilcox1-0/+12
2017-10-15malloc: add __libc_memalignA. Wilcox1-0/+6
__memalign is not necessary as musl already provides it.
2017-10-15malloc: add __libc_{m,c,re}alloc and __libc_free aliasesA. Wilcox1-0/+27
2017-10-15math: Add weak aliases for non-__ prefix is{inf,nan}{,f}A. Wilcox1-0/+5
2017-09-16Merge pull request #1 from djames1/masterWilliam Pitcock1-3/+3
Makefile: allow compilation with specified compiler
2017-09-16Makefile: allow compilation with specified compiler rather than hard-coded gccDaniel James1-3/+3
2017-07-28add .gitignoreWilliam Pitcock1-0/+3
2017-07-28README: update thisWilliam Pitcock1-2/+6
2017-07-28libgcompat: add getpwent_r() and fgetpwent_r() stubsWilliam Pitcock2-0/+56
2017-06-14README: add docs about env varsA. Wilcox1-0/+7
2017-06-14Since we have readme, add CONTRIBUTING and LICENSE tooA. Wilcox2-0/+144
2017-06-14add sysctl()William Pitcock2-0/+29
2017-06-14pthread: add __pthread_[un]register_cancel stubs, not relevant to musl ↵William Pitcock1-0/+8
pthread implementation
2017-06-14pthread: add __register_atfork() stubWilliam Pitcock2-0/+8
2017-06-14recent musl has pthread_setname_np().William Pitcock2-32/+0
2017-06-14add READMEgcompat-0.0.1William Pitcock1-0/+49
2017-06-14build system: add install target, fix loader build rulesWilliam Pitcock1-2/+6
2017-06-14add MakefileWilliam Pitcock1-0/+38
2017-06-14implement program loaderWilliam Pitcock1-0/+56
2017-06-14move all compatibility library stuff into libgcompat/William Pitcock13-0/+0
2017-02-08resource: new setrlimit stub for broken glibc2.2 compatA. Wilcox1-0/+37
2017-02-08string: Add __strcat_chk and __strncpy_chkA. Wilcox1-0/+16