Commit Graph

1324 Commits

Author SHA1 Message Date
Daniel McKenna
ca117fee87 Fixed style issues and reverted version number.
Fixed trailing whitespace in x86.rs and reverted the minor version number in the Cargo.toml
2017-05-24 17:25:03 +01:00
Daniel McKenna
9766d50f4a Updated cargo.lock and toml for release. 2017-05-23 17:23:10 +01:00
Daniel McKenna
fbcd9df1cf Added missing linux/user.h structures.
Added equivalents for user_regs_struct and user_struct from linux/user.h for x86 and x86_64.
2017-05-23 17:18:55 +01:00
bors
fda4049c11 Auto merge of #596 - Susurrus:master, r=alexcrichton
Use NOCANCEL variants for close on Mac

The default `close()` on OS X does not provide clear errors, instead the `$NOCANCEL` variants should be used. These are available as of OS X 10.6 onwards.

Fixes #595.
2017-05-19 14:10:33 +00:00
bors
7db3fd570d Auto merge of #597 - PlasmaPower:bump-version, r=alexcrichton
Bump to 0.2.23

I've added a bunch of constants and xattr support for macos. We've also got preliminary support for uclibc with #578.
2017-05-19 01:22:11 +00:00
Lee Bousfield
0457d3b32f Bump to 0.2.23 2017-05-18 18:41:37 -06:00
Bryant Mairs
9b9f36aefc Use NOCANCEL variants for close on Mac
The default  on OS X does not provide clear errors,
instead the NOCANCEL variants should be used. These are available
as of OS X 10.6 onwards.
2017-05-18 12:04:28 -07:00
bors
a3e79eb110 Auto merge of #594 - PlasmaPower:linux-enoattr, r=alexcrichton
Add ENOATTR for Linux

It's defined differently for OSX and *BSD, so having a Linux definition is helpful for cross-platform code.
2017-05-18 15:39:48 +00:00
Lee Bousfield
98889cf243 Add ENOATTR for Linux 2017-05-18 09:02:25 -06:00
bors
a285387a9e Auto merge of #593 - PlasmaPower:bsd-at-fdcwd, r=alexcrichton
Add AT_FDCWD for FreeBSD
2017-05-16 14:00:25 +00:00
Lee Bousfield
85e2738f20 Add AT_FDCWD for FreeBSD 2017-05-15 09:11:16 -06:00
bors
19f3be3638 Auto merge of #578 - cactorium:master, r=alexcrichton
Steps towards support for musl-unknown-linux-uclibc

Hello! I've been working towards resolving https://github.com/rust-lang/libc/issues/361 , this PR compiles successfully with a newish compiler (with some minor fixes in `gcc`, `ctest`), and all the tests pass for `libc-ctest`. Basically most of the undefined functions, constants, and structs were just removed from the ctest, and then any constants that weren't correct were fixed. Would it make more sense to conditionally remove them from libc? I wasn't sure when it was appropriate to skip the test for it instead of removing the function/constants, so I just removed all the tests for now because that was a little easier than hunting them down. I'm also guessing the way some of the constants were conditionally set wasn't the correct style, would you guys have any advice on how to do it more correctly? Lemme know how it looks!
2017-05-08 14:49:12 +00:00
bors
c8c5d64845 Auto merge of #592 - PlasmaPower:xattr-flags, r=alexcrichton
Define XATTR flags, and add XATTR functions for OSX

As found in:

http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/xattr.h

https://opensource.apple.com/source/xnu/xnu-2050.7.9/bsd/sys/xattr.h
2017-05-08 14:10:43 +00:00
Lee Bousfield
1a06678e30 Add XATTR flags 2017-05-07 17:05:52 -06:00
Lee Bousfield
fdbfe8fc91 Add xattr functions for OSX 2017-05-07 17:05:51 -06:00
Kelvin Ly
c0bec43234 Remove MAP_HUGETLB from mips-unknown-linux-uclibc 2017-05-06 02:49:54 -04:00
Kelvin Ly
96a830648d Merge branch 'master' into master 2017-05-04 22:08:48 -04:00
bors
c1187f3064 Auto merge of #590 - malbarbo:android-x86_64-test, r=alexcrichton
Add x86_64-linux-android test

We extract the linker and some libraries from an android image and copy then to `/system`. This allows the android test to run directly (or with qemu).
2017-05-04 00:11:25 +00:00
Marco A L Barbosa
2fd7f7a43f Add x86_64-linux-android test 2017-05-03 20:12:49 -03:00
bors
03562b0cb2 Auto merge of #585 - jonhoo:res_init, r=alexcrichton
Add res_init

The `res_init` function, while deprecated, is critical for making networked applications work correctly when switching between networks, or between being offline and online. By default, `getaddrinfo` and friends use a cached version of `/etc/resolv.conf`, which means that network changes are not picked up by applications after they first start up. This has bitten [Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=214538), [Pidgin](https://developer.pidgin.im/ticket/2825), [MongoDB](https://jira.mongodb.org/browse/DOCS-5700), and more in the past.

The logic behind exposing only `res_init` is that it is the only `res_*` function that is frequently called directly by user applications. The other `res_*` functions provide low-level access to domain lookups, whereas `res_init` is useful even if the application itself is not concerned with doing lookups.

Behind the scenes, `getaddrinfo` in glibc [ultimately calls](a2f34833b1/resolv/nss_dns/dns-host.c (L196)) `res_nsearch` with `&_res`. `res_init` operates directly on this global reference, and is thus more useful to expose for most applications than the non-deprecated `res_ninit` function (which operators on an arbitrary `res_state`).

As far as I can tell, `res_init` is available in [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=res_init&manpath=SuSE+Linux/i386+11.3), [NetBSD](http://netbsd.gw.com/cgi-bin/man-cgi?res_init+3+NetBSD-6.1), [OpenBSD](http://man.openbsd.org/resolver.3), [Solaris](http://www.polarhome.com/service/man/?qf=res_init&tf=2&of=Solaris&sf=), [Linux](https://linux.die.net/man/3/res_init), and [macOS](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/res_init.3.html).
2017-05-03 22:30:49 +00:00
Jon Gjengset
be7e45f6f5
Skip res_init test on macOS/iOS 2017-05-03 15:57:39 -04:00
Jon Gjengset
fcf5fc0257
Avoid special-casing linking with resolv 2017-05-03 15:17:24 -04:00
Jon Gjengset
b3700e4364
Blacklist > whitelist 2017-05-03 13:41:00 -04:00
bors
fd9d460a94 Auto merge of #589 - tokenrove:recvmmsg-sendmmsg, r=alexcrichton
Add Linux-specific recvmmsg(2) and sendmmsg(2)

This is just the patch that @nodakai submitted in #257, updated against current master, but I'm opening this PR as a vehicle for whatever additional changes need to be made to get it merged.  Thanks.
2017-05-02 14:52:59 +00:00
NODA, Kai
61c23fb927
Add Linux-specific recvmmsg(2) and sendmmsg(2)
There is a compatibility issue regarding the type of a flag parameter:
int vs uint. Linux does declare the syscall to use uint and musl
followed it, but it is incompatible with other POSIX recv*/send*
syscalls. So it seems to be wise to follow the glibc version of
prototypes with int.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-05-02 07:46:52 -04:00
bors
5257dd8cc0 Auto merge of #588 - PlasmaPower:patch-1, r=alexcrichton
Add RTLD_NEXT and RTLD_SELF to *BSD
2017-05-01 19:33:31 +00:00
bors
44805ffd03 Auto merge of #587 - sfackler:makedev, r=alexcrichton
Add major, minor, makedev functions

Only for Linux and Android currently, though they also exist on BSDs
2017-05-01 17:53:15 +00:00
Alex Crichton
9fe8ac4706 Merge pull request #580 from anatol/pub_restorer
Make sigaction._restorer public
2017-05-01 20:52:18 +03:00
Lee Bousfield
0b59ace8e2 Add RTLD_NEXT and RTLD_SELF to *BSD 2017-04-30 17:51:03 -06:00
Steven Fackler
dbdce800ea Add major, minor, makedev functions
Only for Linux and Android currently, though they also exist on BSDs
2017-04-30 13:25:22 -07:00
Kelvin Ly
779984b38f Remove mips64-linux-uclibc as a target 2017-04-30 09:27:01 -04:00
Kelvin Ly
052d91d08a Remove unsupported targets 2017-04-30 09:24:18 -04:00
Jon Gjengset
6eb8d1c77c
Treat bitrig and openbsd the same (@semarie) 2017-04-28 23:58:48 -04:00
Jon Gjengset
b8f5838675
OpenBSD also uses res_init like NetBSD? 2017-04-28 22:23:58 -04:00
Jon Gjengset
afebd98131
Android doesn't expose res_init in header file 2017-04-28 22:23:33 -04:00
Jon Gjengset
f93cf62d9a
OpenBSD can't -lresolv, Android shouldn't need it 2017-04-28 17:14:14 -04:00
Jon Gjengset
ef20ddbc57
Add binding for res_init.
Some notes about the particularities of the changes:

res_init has been deprecated in favor of res_ninit, and many (but not
all) targets have therefore renamed the link name to __res_init. For
example, this happened in glibc in version 2.2:
https://bugzilla.redhat.com/show_bug.cgi?id=43822#c6
In these systems, res_init is #defined to __res_init in resolv.h, which
lets existing C programs continue to be compiled.

Unfortunately, this define doesn't automatically apply to our Rust code.
We therefore need to manually map the link name of res_init as
appropriate for each target:

macOS and iOS use res_9_init: 3908694d63/src/libresolv/resolv.h (L316)
Solaris uses res_init: https://java.net/projects/solaris/sources/on-src/content/usr/src/head/resolv.h
OpenBSD uses __res_init: f3b3b7c7ca/include/resolv.h (L268)
FreeBSD uses __res_init: 6911f4a88c/include/resolv.h (L290)
NetBSD uses __res_init: http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/include/resolv.h
glibc uses __res_init: a2f34833b1/resolv/resolv.h (L259)
eglibc uses __res_init: 7f0bcce417/resolv/resolv.h (L259)
musl uses res_init: 0a11d7cb13/include/resolv.h (L128)
Android uses res_init: 306ea55952/libc/include/resolv.h (L57)

One caveat here is that NetBSD doesn't seem to use the symbol name
__res_init yet, despite the redefine being present in resolv.h. At least
Travis fails for the netbsd target if __res_init is used. This may
change in the future.

iOS and macOS both unfortunately require linking with libresolv, despite
the symbols technically being available without libresolv:
resolv: http://blog.achernya.com/2013/03/os-x-has-silly-libsystem.html
Android and OpenBSD fall in the same category.
2017-04-28 10:58:25 -04:00
bors
f9ae8e6db5 Auto merge of #584 - alexcrichton:release, r=alexcrichton
Add instructions of how to make a release

Anyone can do it!
2017-04-27 14:13:54 +00:00
Kelvin Ly
c14178c305 Fix indentation, remove more constants that don't work for uclibc 2017-04-26 23:01:05 -04:00
Alex Crichton
97a158b3a8 Add instructions of how to make a release
Anyone can do it!
2017-04-26 15:44:19 -07:00
bors
288ed55dd7 Auto merge of #583 - alexcrichton:bump, r=alexcrichton
Bump to 0.2.22
2017-04-26 20:59:01 +00:00
Alex Crichton
6ef11e694a Bump to 0.2.22 2017-04-26 07:29:19 -07:00
Anatol Pomozov
326df18569 Make sigaction.sa_restorer public
We need to create an initialized sigaction struct for Linux syscalls
thus its fields need to be public.

The field was named _restorer before but system libc/kernel uapi name the field
sa_restorer.
2017-04-25 09:10:26 -07:00
bors
664116073e Auto merge of #582 - mkilgore:sigprocmask, r=alexcrichton
Add sigprocmask function

sigprocmask is currently missing, this adds the definition for sigprocmask into the main list of Unix functions. This should be standard across all the Unix-like systems supported.

Note that the constants for 'how' (SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK) are already defined, it is only this function that is missing.
2017-04-25 16:03:57 +00:00
Kelvin Ly
8c592f12b3 Trigger another CI build 2017-04-25 11:03:14 -04:00
bors
26b8ab37c6 Auto merge of #568 - anatol:add_MINSIGSTKSZ, r=alexcrichton
Add MINSIGSTKSZ constant to linux sources

MINSIGSTKSZ is a minimum size of process stack allowed
2017-04-25 09:51:38 +00:00
bors
1a36de91d7 Auto merge of #555 - alexcrichton:retry-appveyor, r=alexcrichton
Surround rustc download in appveyor-retry
2017-04-25 06:18:46 +00:00
Matthew Kilgore
53069830dd Add sigprocmask function 2017-04-25 01:30:14 -04:00
Kelvin Ly
f9ddaf0b4b Fix more style 2017-04-24 22:50:29 -04:00
Kelvin Ly
ac7bff78c2 Style fixes 2017-04-24 21:38:05 -04:00