Skip to content

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
wants to merge 206 commits into from

Conversation

lilianmoraru
Copy link

.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.

Arvamer and others added 30 commits June 14, 2017 21:48
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.
bors and others added 23 commits August 12, 2017 22:01
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.
This was changed when emscripten test support was added
@lilianmoraru
Copy link
Author

lilianmoraru commented Aug 15, 2017

@malbarbo Now I'm thinking, maybe you should better create a temporary emscripten-merge(or something like this) branch(started from the emscripten branch) and I will change the pull request to that branch(this would avoid destroying this branch in case of some issue)?

@lilianmoraru lilianmoraru changed the title Emscripten rebase on rust-lang/libc master WIP: Emscripten rebase on rust-lang/libc master Aug 15, 2017
@lilianmoraru
Copy link
Author

Closing this in favor of rust-lang#742

@lilianmoraru lilianmoraru deleted the emscripten branch August 27, 2017 17:11
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.