Commit Graph

809 Commits

Author SHA1 Message Date
Raphael Cohn 7e0dbc3270 Adding syslog functions, constants and structs
This commit adds the functions:-
- syslog
- openlog
- closelog
- setlogmask

It adds LOG_* constants.

It adds the CODE struct used by the #define definitions prioritynames and facilitynames.

It does not add:-
- the function vsyslog; this is an extension to POSIX and uses va_list macros;
- the #defines prioritynames and facilitynames, as usage is not common
- rust functions mirroring the macros:-
  - LOG_PRI
  - LOG_MAKEPRI
  - LOG_MASK
  - LOG_UPTO
  - LOG_FAC
* CODE is included in case a third-party unsafe C function returns or takes it.
2016-05-04 11:47:02 +01:00
Raphael Cohn cdb99e3584 Definition of _SC_HOST_NAME_MAX for OpenBSD and FreeBSD 2016-05-04 11:20:23 +01:00
Raphael Cohn f365111fcc Added _SC_HOST_NAME_MAX for FreeBSD, BitRig and Linux (glibc and musl) 2016-05-04 10:35:08 +01:00
bors 8adb9c54b3 Auto merge of #274 - alexcrichton:bump, r=alexcrichton
Bump to 0.2.11

Closes #273
2016-05-03 09:39:48 -07:00
Alex Crichton 959c6ab21b Bump to 0.2.11 2016-05-03 09:39:11 -07:00
bors e2af623698 Auto merge of #272 - kamalmarhubi:apple-rlimit-rss, r=alexcrichton
apple: Add RLIMIT_RSS as alias of RLIMIT_AS

This is defined in <sys/resource.h> as

    #define	RLIMIT_RSS	RLIMIT_AS	/* source compatibility alias */

See http://opensource.apple.com//source/xnu/xnu-1456.1.26/bsd/sys/resource.h
2016-04-30 11:40:18 -07:00
Kamal Marhubi 6b980b1074 apple: Add RLIMIT_RSS as alias of RLIMIT_AS
This is defined in <sys/resource.h> as

    #define	RLIMIT_RSS	RLIMIT_AS	/* source compatibility alias */

See http://opensource.apple.com//source/xnu/xnu-1456.1.26/bsd/sys/resource.h
2016-04-30 10:43:10 -04:00
bors 6ad1be729a Auto merge of #271 - mbarnett:add_WSIGNALED_etc_for_osx, r=alexcrichton
OS X: add various process status tests defined by wait.h

Adds the various process test macros specified in the wait(2) manpage on OS X. ```WCOREDUMP``` is implemented BSD-wide as it seems to be the only macro whose definition is constant across the BSDs.
2016-04-29 15:41:05 -07:00
Matt Barnett 06abf3a28b fix naming of _WSTATUS macro from wait.h 2016-04-29 10:05:48 -06:00
bors 81efe51afc Auto merge of #268 - kamalmarhubi:prlimit, r=alexcrichton
linux: Add prlimit(2) and prlimit64(2)

As with `getrlimit` and `setrlimit`, the glibc wrappers have a non-`int`
for the `resource` argument, eg:

    extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
                        const struct rlimit *__new_limit,
                        struct rlimit *__old_limit) __THROW;
2016-04-29 08:53:36 -07:00
Kamal Marhubi 9569599507 linux: Add prlimit(2) and prlimit64(2)
As with `getrlimit` and `setrlimit`, the glibc wrappers have a non-`int`
for the `resource` argument, eg:

    extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
                        const struct rlimit *__new_limit,
                        struct rlimit *__old_limit) __THROW;
2016-04-29 09:49:19 -04:00
bors 4cc1df9350 Auto merge of #269 - kamalmarhubi:linux-android-dups, r=alexcrichton
notbsd: Deduplicate definitions

A bunch of definitions were duplicated across, eg, android and linux.
This commit pulls these up to higher levels where they can be shared.
2016-04-28 15:50:39 -07:00
Matt Barnett 71e9d6c720 OS X: add various process status tests defined by wait.h 2016-04-28 15:11:23 -06:00
bors ac59d35b10 Auto merge of #265 - fiveop:missing_signals, r=alexcrichton
Add SIGEMT (for apple) and SIGINFO (for bsd).
2016-04-28 10:17:30 -07:00
bors 8025a3ee5e Auto merge of #259 - nodakai:patch-1, r=alexcrichton
Explain about the automated tests on Travis

in order to advise contributors to locally test their patches.
2016-04-28 08:51:43 -07:00
Kamal Marhubi b9750b650d notbsd: Deduplicate definitions
A bunch of definitions were duplicated across, eg, android and linux.
This commit pulls these up to higher levels where they can be shared.
2016-04-27 22:25:48 -04:00
Kai Noda cba130bc01
Explain about the automated tests on Travis
in order to advise contributors to locally test their patches.

Also update ctest to include a fix on rerun-if-changed so that human
developers doing trial & error can properly test their latest code.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-04-27 08:35:18 +08:00
Philipp Matthias Schaefer a0725ad9fa Add SIGEMT (for apple) and SIGINFO (for bsd). 2016-04-26 08:01:32 +02:00
Alex Crichton 22bb4e4c6f Merge pull request #267 from alexcrichton/rustup
Use rustup to add targets, not manual curl
2016-04-25 13:08:44 -07:00
Alex Crichton 621aa7cbd6 Use rustup to add targets, not manual curl 2016-04-25 11:12:06 -07:00
bors 1e6a354c2d Auto merge of #264 - timonvo:armmusleabi, r=alexcrichton
Add support for arm-unknown-linux-musleabi{,hf} targets.

These targets will be similar to the x86_64-unknown-linux-musl
target, in that they'll use MUSL libc to allow fully static binaries
to be generated. To remain consistent with the naming of existing
ARM targets, as well as with the standard naming of MUSL toolchains,
we'll use `musleabi` and `musleabihf` as the target environment
names (analogous to `gnueabi` and `gnueabihf`).

Most of these changes just extend the special casing for x86_64 MUSL
targets to the ARM ones as well.
2016-04-18 09:49:26 -07:00
Timon Van Overveldt ad728590d2 Add support for arm-unknown-linux-musleabi{,hf} targets.
These targets will be similar to the x86_64-unknown-linux-musl
target, in that they'll use MUSL libc to allow fully static binaries
to be generated. To remain consistent with the naming of existing
ARM targets, as well as with the standard naming of MUSL toolchains,
we'll use `musleabi` and `musleabihf` as the target environment
names (analogous to `gnueabi` and `gnueabihf`).

Most of these changes just extend the special casing for x86_64 MUSL
targets to the ARM ones as well.
2016-04-15 20:34:19 -07:00
bors 779cde8312 Auto merge of #255 - fiveop:ucontext_musl, r=alexcrichton
Add ucontext for linux-musl.

It just copy pasted from the linux-other version.
2016-04-15 15:14:52 -07:00
Philipp Matthias Schaefer d780eec23a Add ucontext for linux-musl. 2016-04-15 23:07:30 +02:00
bors bab6a379cc Auto merge of #263 - bluss:printf, r=alexcrichton
Add the family of printf, scanf functions

snprintf is apparently supported in MSVC since version 14. I'm curious to take the tests for a spin.
2016-04-13 09:47:05 -07:00
bluss 1ebfe63f1c printf: Fix too long line 2016-04-13 18:44:56 +02:00
bluss 9111f24e67 Move printf, scanf family of functions into the unix category 2016-04-13 18:15:01 +02:00
bluss adb400dd0e Add the family of printf, scanf functions 2016-04-13 01:26:34 +02:00
bors ba084f408a Auto merge of #261 - myfreeweb:master, r=alexcrichton
64-bit Android timegm fix

On aarch64 and x86_64, `timegm64` does not exist (see [time64.h](797351fd3b/ndk/platforms/android-L/include/time64.h)).

See rust-lang-deprecated/time#118 for usage. Since that patch, the time library switched to using libc for `timegm` (rust-lang-deprecated/time@51c0019), and it doesn't build on 64-bit Android. This PR fixes that.
2016-04-12 15:56:12 -07:00
Greg V 6b0e09c1f4 64-bit android fix 2016-04-12 22:44:18 +03:00
bors e4447f406c Auto merge of #262 - alexcrichton:bump, r=alexcrichton
Bump to 0.2.10
2016-04-12 11:35:04 -07:00
Alex Crichton b302bed9d2 Bump to 0.2.10 2016-04-12 11:09:00 -07:00
bors 74f8f4ae88 Auto merge of #260 - alexcrichton:correctly-gate-travis, r=alexcrichton
Use '&&' on travis, not ';'

Closes #258
2016-04-11 13:28:36 -07:00
Alex Crichton dfd196efe6 Use '&&' on travis, not ';' 2016-04-11 13:28:21 -07:00
bors b484e6f548 Auto merge of #256 - nodakai:fix-cpu_set, r=alexcrichton
Fix CPU_SET and CPU_ISSET
2016-04-11 09:02:23 -07:00
NODA, Kai afa77dfa0e
Fix CPU_SET and CPU_ISSET
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-04-10 19:14:51 +08:00
bors 60f90cf560 Auto merge of #237 - Nercury:use-signal-instead-of-bsd-signal, r=alexcrichton
Use now available link name "signal" instead of "bsd_signal"

On android, the `bsd_signal` is gone, the `signal` is available.

While this is the most obvious solution, I am not sure of a few things:
- How are we going to keep compatibility with older NDKs where `signal` does not exist;
- Was something dependent on this being different on android and thus would break (for example, the rust compiler uses this function, so it may break somewhere).

Fixes #236.
2016-04-06 16:50:11 -07:00
Nerijus Arlauskas 0b7ccdd119 Do not skip "signal" when building libc tests. 2016-04-06 20:56:54 +03:00
bors f4411ad7db Auto merge of #250 - mrhota:readme_update, r=alexcrichton
Remove iOS doc links from README

Fixes #243
2016-04-04 22:28:30 -07:00
bors c2d1c71eef Auto merge of #248 - mrhota:langinfo, r=alexcrichton
langinfo bindings and defs
2016-04-04 21:54:14 -07:00
A.J. Gardner 24c84f1360 Define xlocale and langinfo interfaces
There are many constants defined by langinfo, but we have the
new types, locale_t and nl_item.

We also have several functions, not all of which exist for every
platform:

nl_langinfo
nl_langinfo_l
newlocale
duplocale
freelocale
uselocale
querylocale
2016-04-04 20:51:44 -05:00
bors 7265c17d18 Auto merge of #254 - alexcrichton:rtld-default, r=alexcrichton
Add RTLD_DEFAULT to more platforms
2016-04-04 13:46:14 -07:00
Alex Crichton 031a450aeb Add RTLD_DEFAULT to more platforms 2016-04-04 13:14:54 -07:00
bors 2ded9aeae3 Auto merge of #249 - alexcrichton:fix-link, r=alexcrichton
Link to libraries when disabling `use_std`

This crate currently relies on libraries being linked to come from libstd, but
if `use_std` is disabled that's not true! In that case we need to pull in the
libraries ourselves.

Closes rust-lang/rust#32661
2016-04-04 10:03:27 -07:00
Alex Crichton a28ec43900 Link to libraries when disabling `use_std`
This crate currently relies on libraries being linked to come from libstd, but
if `use_std` is disabled that's not true! In that case we need to pull in the
libraries ourselves.

Closes rust-lang/rust#32661
2016-04-04 10:02:52 -07:00
bors fb2f0bbdab Auto merge of #253 - nodakai:strerror_r, r=alexcrichton
On non-musl Linux, strerror_r should be linked to __xpg_strerror_r

Currently `libc::strerror_r()` wrongly returns a `c_char` pointer as a large `c_int`.

Also exclude `MS_RMT_MASK` from `libc-test`.
2016-04-03 14:48:34 -07:00
bors 46cca7a06e Auto merge of #252 - mneumann:freebsd_dragonfly_pthread, r=alexcrichton
Add several pthread functions for DragonFly/FreeBSD

These are needed in order to fix/implement the guard page code of Rust
for DragonFly.
2016-04-03 11:54:31 -07:00
bors 331d70519e Auto merge of #247 - nodakai:clock_getres, r=alexcrichton
Add clock_getres(3) and improve clockid_t constants.

This is still a draft
2016-04-03 09:02:16 -07:00
NODA, Kai 4d1efd9e8a
Exclude MS_RMT_MASK from libc-test
It was updated recently, so the test is known to fail depending on the
libc version of the test environment.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-04-03 22:16:52 +08:00
NODA, Kai 75a69bf8e2
On non-musl Linux, strerror_r should be linked to __xpg_strerror_r
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-04-03 22:16:43 +08:00