Commit Graph

3125 Commits

Author SHA1 Message Date
Xavier L'Heureux
0da26d4f3a Remove some unsupported methods 2019-07-15 10:31:24 -04:00
Xavier L'Heureux
0af8f18655 Style 2019-07-15 08:24:36 -04:00
Xavier L'Heureux
e6671e302e Add constants and types 2019-07-15 08:24:36 -04:00
Xavier L'Heureux
fd5eb3d6e1 Add support for redox compilation with extra traits flag + fmt 2019-07-15 08:21:04 -04:00
gnzlbg
c8aa8ec72d Bump patch version to 0.2.60 2019-07-15 10:51:47 +02:00
bors
47535e6d20 Auto merge of #1432 - josephlr:errno, r=gnzlbg
Add __errno_location on Redox, DragonFlyBSD, Haiku

Currently [`libstd`](909f5a0494/src/libstd/sys/unix/os.rs (L29-L49)) and the [`getrandom` crate](https://github.com/rust-random/getrandom/pull/54/files#diff-027a56068e2bf3d31dc4273ee6e07034R12) have to use external declarations in order to implement `errno_location` across all UNIX platforms. This change adds bindings for the remaining UNIX platforms, allowing everyone to just use normal `libc` bindings.

This also removes the need for a seperate [`errno-dragonfly`](https://crates.io/crates/errno-dragonfly) crate.

Links to the relevant header files:

- Redox: [`relibc`'s `bits/errno.h`](https://github.com/redox-os/relibc/blob/master/include/bits/errno.h) uses `__errno_location`
- Haiku: [`posix/errno.h`](https://github.com/luciang/haiku/blob/master/headers/posix/errno.h) uses `_errnop`
- DragonFlyBSD: [`sys/errno.h`](https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/errno.h) uses `__error` just like FreeBSD (which makes sense)
  - Note that the `__error` function is inlined. I don't think this causes a problem.
2019-07-15 07:55:27 +00:00
Joe Richey
df34d17bd9 Remove use of unstable feature 2019-07-14 22:10:05 -07:00
Joe Richey
1b4747e77b Update documentation to point to Rust issue 2019-07-12 10:24:39 -07:00
Joe Richey
3fa021d7ab Add libc_thread_local cfg and unstable feature 2019-07-10 19:47:40 -07:00
Joe Richey
956ba42753 dragonfly: Add errno behind libc_thread_local 2019-07-10 18:04:48 -07:00
Joe Richey
b7a27b5c7c libc::c_int -> ::c_int 2019-07-10 18:04:48 -07:00
Joe Richey
aa3578fa85 Add __errno_location on Redox, DragonFlyBSD, Haiku 2019-07-10 18:04:48 -07:00
bors
54b03c53fb Auto merge of #1436 - condy0919:linux_pthread_setname, r=gnzlbg
Support pthread_{set,get}name_np for linux with glibc
2019-07-10 07:15:58 +00:00
condy
2686cc5bd8 Support pthread_{set,get}name_np for linux with glibc 2019-07-10 14:16:20 +08:00
bors
f397625c50 Auto merge of #1435 - dianpopa:master, r=gnzlbg
Add missing syscalls for aarch64-unknown-linux-musl

The list of syscalls from [rust-lang-aarch64-musl-syscalls](../blob/master/src/unix/notbsd/linux/musl/b64/aarch64.rs) misses some of the syscalls that are defined in [musl-libc-aarch64-syscalls](https://git.musl-libc.org/cgit/musl/tree/arch/aarch64/bits/syscall.h.in).
We need this so that we get rid of hardcoding them inside [our project](https://github.com/firecracker-microvm/firecracker/blob/master/vmm/src/default_syscalls/filters.rs#L16).

Signed-off-by: Diana Popa <dpopa@amazon.com>
2019-07-09 17:03:54 +00:00
Diana Popa
5b959a181c Add missing syscalls for aarch64-unknown-linux-musl
Signed-off-by: Diana Popa <dpopa@amazon.com>
2019-07-09 19:57:29 +03:00
bors
6307a0bfce Auto merge of #1421 - DoumanAsh:expose_posix_timer_value, r=gnzlbg
Expose signal value of siginfo_t

Currently exposes it for following platforms:

- Linux has it as enum _timer and it is exposed alongside sigval
- On FreeBSD like systems si_value follows after si_addr (according to headers)
- Darwin is similar to FreeBSD
- NetBSD and FreeBSD uses struct that contains pid, uid, and si_value. Exposed via it

P.s. I'd like to take a look at other platforms too, but these are what I know so far.
FreeBSD needs some testing though

cc @gnzlbg
2019-07-09 14:48:26 +00:00
Douman
0c2e7831ce Expose signal value of siginfo_t
Exposes value for most unix like platforms
2019-07-09 15:15:17 +02:00
bors
1375b1143c Auto merge of #1430 - gnzlbg:bump_v, r=gnzlbg
Bump patch version
2019-07-08 07:28:17 +00:00
gnzlbg
84c984ddb0 Bump patch version 2019-07-08 09:27:45 +02:00
bors
789c38144e Auto merge of #1423 - Susurrus:issue_665, r=gnzlbg
Remove AF_MAX, PF_MAX, NET_MAXID constants

These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes rust-lang/libc#665
2019-07-06 16:47:40 +00:00
bors
2b351c2db2 Auto merge of #1429 - gnzlbg:appveyor_reduce, r=gnzlbg
Reduce appveyor churn

This should reduce the Appveyorn churn for other projects a bit more.

Please let me know if there is anything else that can be done. Maybe the infra team could discuss whether to document some general guidelines for rust-lang and rust-lang-nursery projects, and write them down somewhere. I would be willing to help.

cc @RalfJung @Mark-Simulacrum
2019-07-06 13:22:44 +00:00
gnzlbg
3f8cff745e Reduce appveyor churn 2019-07-06 15:21:16 +02:00
bors
299a73f687 Auto merge of #1419 - gnzlbg:ctest_fix, r=gnzlbg
Update ctest version

The latest ctest version enabled the ABI roundtrip test by default, in which we initialize all types in Rust by default to some random bit-pattern, pass them to C, verify, modify, pass back to Rust, and verify.

This catches issues in the call ABI / calling convention.

This PR will silence those here for now.
2019-07-05 22:55:16 +00:00
gnzlbg
9f9286331f Fix appveyor try 3 2019-07-05 18:55:42 +02:00
gnzlbg
fd7a1e9f83 Fix appveyor try 2 2019-07-05 18:44:30 +02:00
gnzlbg
b2dcd5c76a Fix x86_64 musl 2019-07-05 18:24:16 +02:00
gnzlbg
c3ddd564c9 Allow s390x to fail - segfault 2019-07-05 18:13:03 +02:00
gnzlbg
9d58c0c14f Allow PPC to fail - segfault 2019-07-05 18:13:03 +02:00
gnzlbg
7fa6534858 Fix FreeBSD and Appveyor 2019-07-05 18:13:03 +02:00
gnzlbg
ab6e4a3f18 Allow wasi to fail 2019-07-05 18:13:03 +02:00
gnzlbg
3fd4dd7ea3 Silence roundtrip errors 2019-07-05 18:13:03 +02:00
gnzlbg
b81a234913 Silence roundtrip in linux 2019-07-05 18:13:03 +02:00
Bryant Mairs
215f095601 Remove AF_MAX, PF_MAX, NET_MAXID constants
These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes rust-lang/libc#665
2019-07-05 07:39:00 -07:00
gnzlbg
5e3866ad56 Update ctest version 2019-07-03 13:00:03 +02:00
bors
54ea12dff4 Auto merge of #1418 - fintelia:patch-2, r=gnzlbg
Fix link in README.md

Same as #1417, but actually against the right branch this time.
2019-06-28 19:58:46 +00:00
Jonathan Behrens
cc33108bb9
Fix link in README.md 2019-06-28 15:21:44 -04:00
bors
00fe094a9d Auto merge of #1407 - tmfink:wasi-schar, r=gnzlbg
wasi: add c_schar definition

This fixes an issue when building https://github.com/capstone-rust/capstone-rs/ for WASI.

Otherwise, I get:
~~~
error[E0412]: cannot find type `c_schar` in module `libc`
 --> /home/user/capstone-rs/target/wasm32-wasi/debug/build/capstone-sys-1019f1f8759b0d05/out/capstone.rs:4:27
  |
4 | pub type __int8_t = libc::c_schar;
  |                           ^^^^^^^ help: a type alias with a similar name exists: `c_char`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0412`.
error: Could not compile `capstone-sys`.
~~~

The file with the error is generated with bindgen:

a74126cd88/capstone-sys/pre_generated/capstone.rs (L3-L5)
2019-06-28 13:23:15 +00:00
bors
8773f33c95 Auto merge of #1411 - acfoltzer:ucontext-compat, r=gnzlbg
Remove new field from ucontext_t for compatibility with earlier glibc versions

Per discussion in #1410 with @gnzlbg, this is necessary to avoid struct size mismatches between Rust and C on systems with glibc < 2.28.
2019-06-27 18:46:59 +00:00
Adam C. Foltzer
f6e48fc77c
fix line length 2019-06-27 11:42:22 -07:00
Adam C. Foltzer
e94fffc309
replace deprecated string functions in style script 2019-06-27 10:57:07 -07:00
Adam C. Foltzer
339fe22653
add fixmes for the ucontext_t shadow stack field 2019-06-27 09:32:52 -07:00
bors
4f4e81a030 Auto merge of #1409 - jbaublitz:nl-const-rtm-pr, r=gnzlbg
Add RTM_* constants to linux/mod.rs for rtnetlink

There is one last set of constants I'm looking to get added to libc for rtnetlink support in my netlink library. I'm going to follow this up with a release PR once this PR is merged.
2019-06-27 14:13:30 +00:00
Adam C. Foltzer
886bb3f2f8
filter out the struct test rather than removing the header 2019-06-26 16:56:53 -07:00
Adam C. Foltzer
dba4138305
remove newer __ssp field from ucontext_t for earlier glib compat
Per discussion in #1410, this is necessary to avoid struct size mismatches between Rust and C on
systems with glibc < 2.28.
2019-06-26 15:52:56 -07:00
John Baublitz
7705d074f1 Move constants to gnu/mod.rs that are not musl-compatible 2019-06-26 16:13:45 -04:00
John Baublitz
d61b55d65f Add RTM_* constants to linux/mod.rs for rtnetlink 2019-06-26 15:23:56 -04:00
Travis Finkenauer
cd5235f6e2 wasi: add c_schar definition 2019-06-25 21:55:42 -04:00
bors
40c73a6eed Auto merge of #1404 - robertdfrench:solarish-doors, r=gnzlbg
Support calls to the SunOS Doors API

Doors are a lightweight IPC mechanism available in libc on Solaris & illumos. They are like unix domain sockets, but faster and more pleasant to work with.

* Brief introduction: ["Doors" in SolarisTM: Lightweight RPC using File Descriptors](http://www.kohala.com/start/papers.others/doors.html)
* Relevant manual pages: [DOOR_CALL(3C)](https://illumos.org/man/3C/door_call), [DOOR_CREATE(3C)](https://illumos.org/man/3C/door_create)
* Tutorial I wrote: ["Revolving Doors": A tutorial on the Illumos Doors API](https://github.com/robertdfrench/revolving-door)

Marking this as a draft until I have included the full api.
2019-06-25 17:17:15 +00:00
bors
99854f378a Auto merge of #1350 - dbrgn:ttyname_r, r=gnzlbg
Add ttyname_r

I hope this is correct. Parameter types taken from `man ttyname`.

```c
int ttyname_r(int fd, char *buf, size_t buflen);
```
2019-06-24 05:07:16 +00:00