forked from rust-lang/libc
-
Notifications
You must be signed in to change notification settings - Fork 1
WIP: Emscripten rebase on rust-lang/libc master #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds more structs to the uclibc/x86_64 port.
Add missing Android constant This pull requests add the `_SC_NPROCESSORS_CONF` constant to `libc` for Android targets. The similar `_SC_NPROCESSORS_ONLN` already existed. The reason for adding only this constant is to help fix an [issue with `num_cpus`](seanmonstar/num_cpus#34).
Add structs defined in linux/input.h I was using definitions for these structs from `ioctl` but because @cmr decide to deprecate his crate (and yanked all versions :() I think that `libc` is the best place for them. In original C header, primitive types uses aliases like `__u16` or `__s32`; for now I replaced them with Rust's counterparts but I'm not sure if it is ok, especially because tests were failing for `u64` (`unsigned long long` vs `unsigned long` on x86_64). Also, should I do something special with union in `ff_effect`? I would like also to add all constants form `linux/input.h` and `linux/input-event-codes.h` if this PR will be accepted.
[uclibc] add more structs to x86_64 This adds more structs to the uclibc/x86_64 port.
Add more termios constants Went through and found some more termios constants that were missing and added them. I skipped some platforms (solaris, uclibc) and assumed Android has the same constants are Linux, as I couldn't find a good reference for what Android exposes, but it generally follows linux, so I assumed the same was true for some of those values. ## References: FreeBSD: * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/sys/sys/_termios.h * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/include/termios.h NetBSD: https://github.com/NetBSD/src/blob/0bff031265b50be8e8b7719aed82212928d6c1df/sys/sys/termios.h musl: /usr/x86_64-linux-musl/include/bits/termios.h (identical to Linux-x86_64) linux: /usr/include/bits/termios.h OpenBSD: https://github.com/openbsd/src/blob/5271000b44abe23907b73bbb3aa38ddf4a0bce08/sys/sys/termios.h DragonFlyBSD: * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/_termios.h * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/termios.h Android: Just use the same as Linux uclibc: skipped haiku-os: http://cgit.haiku-os.org/haiku/tree/headers/posix/termios.h mac: /usr/include/sys/termios.h and /usr/include/sys/_types/_posix_vdisable.h solaris: skipped bitrig (follows openbsd): https://github.com/bitrig/bitrig/blob/d31f5220a98fae4e74abafe27c8d150843cc8105/sys/sys/termios.h
Add constants for sysconf(3) and pathconf(3)
Add pthread_rwlockattr APIs I'm basically trying to mirror the existing code for pthread_mutexattr. Hopefully the non-linux parts are correct - finding the right definitions is rather confusing and occasionally even contradicts existing definitions (e.g. [this](https://github.com/practicalswift/osx/blob/a26375e7b3e01c83e26a23977f909438ed9b31b4/src/libpthread/src/internal.h#L295) `pthread_condattr_t` doesn't match rust-lang#335).
This doesn't appear on any other platforms
Finish off termios (hopefully!) `cfmakesane` for FreeBSD and `tcgetsid` for everyone!
Add constants for termios ioctls These should be `c_int` from what I could see for Linux and I assumed the others were the same.
Add getgrouplist(), add initgroups() to BSD platforms
the type changed from *c_char to *c_void in 6.1
skip siginfo_t.si_addr type check on OpenBSD the type changed from *c_char to *c_void in 6.1
OpenBSDs kqueue now has EV_RECEIPT and EV_DISPATCH. I wrote a patch and the devs merged it into current: https://marc.info/?l=openbsd-tech&m=149621427511219&w=2 This change extends the rust libc crate to provide the feature.
they will be released with OpenBSD 6.2
Openbsd kqueue The PR supersede rust-lang#613 to add exception on the testsuite.
… definitions for emscripten
This was changed when emscripten test support was added
@malbarbo Now I'm thinking, maybe you should better create a temporary |
Closing this in favor of rust-lang#742 |
malbarbo
pushed a commit
that referenced
this pull request
Aug 22, 2019
code cleanup and adding randBytes() etc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.travis.yml
had to be modified a little bit in the merge(adapted to upstream changes) + this contains one additional commit because adaptations were needed.