Commit Graph

267 Commits

Author SHA1 Message Date
Alex Crichton
852db737b3 Merge pull request #441 from billiob/setfsuid
Add setfsgid()/setfsuid() on linux
2016-11-06 00:37:48 -07:00
Boris Faure
28d0afa657 Add setfsgid()/setfsuid() on linux 2016-11-05 21:19:53 +01:00
Boris Faure
da445b99f2 Fix typo in comment 2016-11-05 20:16:50 +01:00
Alex Crichton
78070bdf28 Try to fix powerpc64 and update to crates.io ctest 2016-10-20 17:23:23 -07:00
Alex Crichton
739edbc468 Use workspaces in this repo
Also cache on appveyor to speed up builds.
2016-10-08 17:26:56 -07:00
Alex Crichton
10142aa24a Add checksums to cargo lock files 2016-09-29 19:20:58 -07:00
Philipp Keller
04d0b71d2c Add missing header shadow.h 2016-09-27 07:19:17 +02:00
Alexander Schlarb
7590565993 Add System V message queue bindings for Linux (glibc/musl) 2016-09-18 13:14:28 +02:00
Jorge Aparicio
bcc44dfee8 libc-test: cargo update 2016-09-11 17:52:45 -05:00
Alex Crichton
351df2ddef Bump to 0.2.16 2016-09-08 15:01:24 -07:00
bors
af23c1e5f1 Auto merge of #365 - alexcrichton:more-arch, r=alexcrichton
Add more architectures to libc-test

* `i686-unknown-linux-musl`
* `powerpc-unknown-linux-gnu`
* `powerpc64-unknown-linux-gnu`

cc @japaric
cc https://github.com/rust-lang/rust/issues/36006
2016-08-27 11:26:39 -07:00
Alex Crichton
a097ff6d35 Add ci for i686-unknown-linux-musl 2016-08-26 19:49:16 -07:00
Knight
866c9e4cb7 libc-test: ignore user-defined struct 2016-08-09 14:38:11 +08:00
Knight
0e0fb686d6 libc-test: allow deprecated functions
glibc-2.24 deprecates readdir_r() and readdir64_r()
2016-08-09 14:38:11 +08:00
Alex Crichton
6c18f30543 Bump to 0.2.15 2016-08-04 08:19:48 -07:00
Knight
a6b283b133 Add header file for utmp(x) 2016-07-27 19:42:36 +08:00
Tomasz Miąsko
c4947bbb6d Define _NETBSD_SOURCE when building on NetBSD.
Both pthread_condattr_setclock and pthread_condattr_getclock are guarded
by #if defined(_NETBSD_SOURCE) on NetBSD.
2016-07-21 08:14:58 +02:00
Sergey Bugaev
a98c983cf0 Linux: add reboot() and constants 2016-07-12 13:22:51 +03:00
Alex Crichton
1f946a018a Bump to 0.2.14 2016-07-11 09:04:28 -07:00
Alex Crichton
760dd0b6dc Bump to 0.2.13 2016-06-28 10:02:55 -07:00
Alex Crichton
91c5dbf579 Bump to 0.2.12 2016-06-10 05:19:19 -07:00
Steven Fackler
41699f7406 Add semaphore APIs 2016-06-05 17:26:11 +01:00
Raphael Cohn
e6150ae2b9 Adding sysinfo() and sysinfo struct for Linux and Android.
Sadly, the sysinfo struct varies slightly between Musl and Glibc / Bionic.

This means that users need to be careful when using the uptime, and should
always cast it to a signed value. Why uptime can be signed is beyond me...
2016-05-20 11:17:22 +01:00
Raphael Cohn
7fc0969900 Substantial changes to better support Solaris and BSD variants.
Removed CODE, as its definition and name varies too wildy and I
have no current code using it to test permutations with.

Moved LOG_NFACILITIES down, as Mac OS X defines this value
differently.

Added Mac OS X specific LOG_* facilities.

Added FreeBSD / DragonFly BSD specific LOG_* facilities.

Moved LOG_PERROR down, as all platforms bar Solaris define this.

Moved LOG_CRON down, as Solaris defines this with a different value.

Moved LOG_AUTHPRIV and LOG_FTP down, as all platforms bar Solaris
define these.

Looks like Solaris is suffering from the bit rot of commercial Unix...
2016-05-05 15:41:21 +01:00
Alex Crichton
959c6ab21b Bump to 0.2.11 2016-05-03 09:39:11 -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
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
Alex Crichton
b302bed9d2 Bump to 0.2.10 2016-04-12 11:09:00 -07: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
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
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
Kamal Marhubi
9c4af10e88 unix: Add openpty(3) and forkpty(3) for non-Apple platforms
The functions were added for Apple in #202. Adding them to other
platforms was pending an amendment to RFC 1291 to expand the scope of
libc to include libutil. The amendment was merged as
  https://github.com/rust-lang/rfcs/pull/1529
2016-04-02 09:33:55 -04:00
bors
dfc1ab5f2b Auto merge of #244 - mrhota:basic_locale, r=alexcrichton
Add lconv type, and locale support for UNIX

We have lconv struct, setlocale(), and localeconv(). Constants live
under notbsd for now.
2016-03-31 10:15:53 -07:00
Alex Crichton
3de1107244 Bump to 0.2.9 2016-03-30 17:40:32 -07:00
A.J. Gardner
b788a5c736 Add locale.h in libc-test 2016-03-30 01:13:55 -05:00
Alex Crichton
609693dae1 Update winapi 2016-03-14 21:59:21 -07:00
Kamal Marhubi
89a7700e23 apple: Add openpty(3) and forkpty(3) 2016-03-08 23:47:03 -05:00
Alex Crichton
95a56522db Update the libc-test lockfile 2016-03-07 13:12:43 -08:00
Alex Crichton
c173d9c5d5 Merge branch 'ucontext' of https://github.com/fiveop/libc into merge 2016-02-29 21:12:03 -08:00
Philipp Matthias Schaefer
7e3a151289 Add ucontext struct for Linux/x86 2016-02-29 19:44:41 +01:00
Sebastian Wicki
35420e2e03 Re-enable some Rumprun tests 2016-02-29 19:32:51 +01:00
Michael Neumann
a09fe71617 Fix a couple of issues spotted by alexcrichton.
See comments https://github.com/rust-lang/libc/pull/194.

Note on struct utsname: Neither using a constant, nor a conditional
macro seems to work, so I just created an ugly utsname with conditions
on each field. This should also fix the CI fallout. #[cfg] on macros
doesn't work?

As DragonFly only supports one platform, I merged  x86_64.rs into
dragonfly/mod.rs.
2016-02-21 12:28:10 +01:00
Michael Neumann
a6a64d17a0 Squashed commit of the following:
Running libc-test: PASSED 3426 tests

commit 1a7ee714db34f17abd33dc9262d3e10275eec68d
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:30:56 2016 +0100

    Fix RLIM_POSIXLOCKS ->  RLIMIT_POSIXLOCKS

commit 09c49a97ebebf087486659ef8277610d99e5c7b3
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:29:24 2016 +0100

    Ignore signedness check for uuid_t on DragonFly

commit aab4d11f59917686280c271683bf00ff34c8040d
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:23:21 2016 +0100

    Move FreeBSD-only function into freebsd/mod.rs

commit 9921f030b103dbccb37930ab1d64cf1dd587bd48
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:21:42 2016 +0100

    Move POSIX_FADV_* to freebsd/mod.rs

commit 2921c2db1e3d0314375aa371936bd227cc6c6e2a
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:20:11 2016 +0100

    Fix signedness of blksize_t for DragonFly

commit 65e817baee9e01d2d7c86c6202c63ee46d218914
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:19:02 2016 +0100

    Fix Q_{GET,SET}QUOTA for DragonFly

commit a0d2d63ef88206d321222140ae6b3d92c93b51bd
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:17:27 2016 +0100

    Fix RLIMIT_* for DragonFly

commit d04a1600a7c66a792a481e1524a1652234a69939
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:12:09 2016 +0100

    Fix ELAST for DragonFly

commit d120b9278426a76ee106e91e6c999885c1f5c7f4
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:10:28 2016 +0100

    Fix F_GETLK, F_SETLK, F_SETLKW for DragonFly

commit 963f7da270a14f4d12ea1a52301e363ce745c897
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:08:51 2016 +0100

    Fix O_CLOEXEC for DragonFly

commit f4d6c9d5991d690c7cb4460790a8e37e713bc034
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:07:18 2016 +0100

    Fix RAND_MAX for DragonFly

commit ba48336da7be613a49702ad9de445ab3850ebb7c
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 13:04:48 2016 +0100

    Fix statvfs for DragonFly

commit 9ae480c60a7d77b31a17d34320464f4179e40a4a
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 12:51:47 2016 +0100

    Fix fd_set for DragonFly

commit a15e027838288c4980371c503252cca7e32356c0
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 12:42:24 2016 +0100

    Fix all remaining issues on DragonFly

    Missing functions and missing constats.

commit 3966e4fce0cb81bd0b3ed8cdf50611e6982f7767
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 12:27:14 2016 +0100

    Use a macro instead of a constant.

    When using a constant, the libc-test thinks this constant
    exists as an C equivalent.

commit 9b5659aaf54419f317250cb3a4692a1c14fdbc33
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 12:21:01 2016 +0100

    Use a constant in utsname

commit 50484eda3c978a9c0a9652f6fc619c41ad349c2d
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 12:17:55 2016 +0100

    Fix struct utsname

commit 832e94248fabc91574d6d42630168da3542c153f
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 12:07:08 2016 +0100

    DragonFly has different stat, dirent, clock_t, ino_t, nlink_t, blksize_t

commit f3152a369d75ae8c1558afa5a59aa55e33b33ec6
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 11:52:54 2016 +0100

    Move DragonFly related stuff into dragonfly/*

    Replicate x86_64.rs from FreeBSD. Need some twists.

commit 9fe35124064aa92303171d019004df119f948223
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 11:49:38 2016 +0100

    Move FreeBSD code under freebsd/*.

    Next commit will replicate some of the architecture dependent stuff
    for DragonFly.

commit e91983df8deb14004f7a0fe47878f0e4eb31198d
Author: Michael Neumann <mneumann@ntecs.de>
Date:   Sat Feb 20 11:44:25 2016 +0100

    struct utsname has a different size on DragonFly
2016-02-20 13:34:01 +01:00
Alex Crichton
87e6c65c74 Bump to 0.2.7 2016-02-09 13:26:02 -08:00
Kamal Marhubi
143358bb97 unix: Add sendfile to platforms that support it 2016-02-06 15:02:19 -05:00
Brian Anderson
773aab8293 Add musl definitions for x86, arm and asmjs
I've tested x86 against C locally, but not arm or asmjs.
I added the arm definitions because asmjs's C is derived from arms.

Mysteriously, my locally-built musl does not contain a
definition for _SC_2_C_VERSION, so I just removed it.
2016-01-29 21:51:06 +00:00
Alex Crichton
381be4bcb0 Bump to 0.2.6 2016-01-26 16:02:21 -08:00
Alex Crichton
2abaf33ed0 Bump to 0.2.5 2016-01-21 09:53:49 -08:00
Alex Crichton
bb6f198a20 Fix all definitions on FreeBSD
* The `flock` structure has an extra field
* Some `flock`-related constants have different value
* Some constants like `TABN` don't exist
* The `fsblkcnt_t` and `fsfilcnt_t` type definitions are u64 for x86_64 FreeBSD
* The `d_namelen` field in `dirent` was renamed correctly to `d_namlen`
* The alignment of `fd_set` was off, and the macros were updated to not always
  assume a 32-bit integer is used.
2016-01-18 22:54:28 -08:00
Alex Crichton
d820c4a8f7 Add OpenBSD and FreeBSD CI to Travis
This commit adds support to test all libc definitions on both OpenBSD and
FreeBSD via QEMU userspace emulation. Specially prepared images for each OS are
used which are essentially intended to run a script on startup and then exit.
Documentation has been added to the `ci/README.md` file describing this new
system.
2016-01-18 22:54:28 -08:00
Jim Blandy
f8772f7e52 Skip C/Rust type checks for eventfd. 2016-01-12 16:28:07 -08:00
Jim Blandy
9b53e54dd5 Don't #include <linux/fs.h>; libc's API is described by <sys/mount.h>.
Adjust MIPS MS_RMT_MASK to match <sys/mount.h>.
2016-01-11 21:02:45 -08:00
Alex Crichton
fc1b0ad67c Merge branch 'master' of https://github.com/diwic/libc into merge 2016-01-10 14:21:13 -08:00
David Henningsson
9d2493e8bf Add poll API
Signed-off-by: David Henningsson <diwic@ubuntu.com>
2015-12-25 23:06:37 +01:00
Sébastien Marie
6c8a63a9e2 keep openbsd name for dirent field member 2015-12-23 20:23:06 +01:00
Sébastien Marie
c618f366f3 add openbsd support to libc-test 2015-12-23 11:03:10 +01:00
Alex Crichton
881ef9b966 Update the android CI image
It's got a new toolchain which should hopefully support some more modern
definitions.
2015-12-18 13:15:09 -08:00
Alex Crichton
ff38c3a121 Bump to 0.2.4 2015-12-17 14:44:50 -08:00
Alex Crichton
79d989996b Bump to 0.2.3 2015-12-16 11:46:54 -08:00
Alex Crichton
8dce9ada5c Add a load of constants/definitions from nix
This is a blanket import of lots of constants and function from nix-rust
2015-12-16 08:16:41 -08:00
Alexander Polakov
58501564c4 SysV shared memory APIs 2015-12-15 18:15:05 +03:00
Alexander Polakov
30baed0f7e Add getxattr()/setxattr()/listxattr()/removexattr() variations 2015-12-02 12:22:01 +03:00
Alex Crichton
49d7bca8aa Add rumprun CI and get tests passing 2015-12-01 17:16:43 -08:00
Alex Crichton
0af5e2312b Check in Cargo.lock for libc-test
This should help the repo be resilient to ctest changes upstream.
2015-11-30 15:07:28 -08:00
Alexander Polakov
26974c7ff7 Add SCHED_* constants for linux & freebsd 2015-11-30 16:56:52 +03:00
Alexander Polakov
420f2e4c80 Disable sockaddr_nl on musl target
See https://github.com/rust-lang-nursery/libc/pull/50 for details
2015-11-11 13:24:16 +03:00
Alexander Polakov
6b58ed3bc1 Add netlink.h in attempt to fix test 2015-11-11 13:22:12 +03:00
Dan Burkert
85a76f8eb2 statvfs(3) bindings 2015-11-04 22:25:30 -08:00
Alex Crichton
568705e830 Add time bindings 2015-11-04 14:18:07 -08:00
Alex Crichton
88d23e7ef8 Add dladdr bindings 2015-11-02 23:37:57 -08:00
Alex Crichton
74825222cf Add bindings for -D_FILE_OFFSET_BITS=64
They're all added under the `foo64` names with the `foo64` types added as well,
so they still need to be explicitly chosen.
2015-11-02 10:11:21 -08:00
Alex Crichton
07d3a0dacc Add more bindings for signals and select/pselect 2015-10-30 13:55:42 -07:00
Alex Crichton
3a572fda25 Be more selective about skipped pthread on musl tests
Fixup the value of PTHREAD_STACK_MIN as well
2015-10-29 22:59:57 -07:00
Alex Crichton
baef6116da iOS support 2015-09-21 14:37:14 -07:00
Alex Crichton
a1b948e34a Fix FreeBSD 2015-09-18 14:33:42 -07:00
Alex Crichton
15b83c244f Use musl-gcc, fix musl headers 2015-09-17 17:25:52 -07:00
Alex Crichton
de9736da96 Fix all tests on OSX 2015-09-17 15:47:44 -07:00
Alex Crichton
1ff961010b Fix android 2015-09-17 15:09:02 -07:00
Alex Crichton
cd9b33e32b Import lots of the stdlib 2015-09-17 14:47:40 -07:00
Alex Crichton
b5da7c0f01 Fix unused variable warning 2015-09-16 17:44:40 -07:00
Alex Crichton
094f44db79 Fix android 2015-09-16 16:27:29 -07:00
Alex Crichton
f3b9748e4c Start testing types of struct fields 2015-09-16 14:13:20 -07:00
Alex Crichton
e0f4d107fa Skip the pointer check for functions on windows 2015-09-16 09:48:14 -07:00
Alex Crichton
d11e9141b2 Switch to ctest crate
Extracted tests!
2015-09-15 23:28:52 -07:00
Alex Crichton
1846918fe2 Fix windows build 2015-09-15 20:57:42 -07:00
Alex Crichton
7b28c271d6 Fix build on MSVC 2015-09-15 20:56:16 -07:00
Alex Crichton
8293cede01 Get FreeBSD compiling 2015-09-15 17:05:19 -07:00
Alex Crichton
eef03da0f9 Don't test mach_timebase_info_t signedness
It's just a struct
2015-09-15 16:57:06 -07:00
Alex Crichton
6d3cfdb3e3 Test signedness of integer types 2015-09-15 14:53:01 -07:00
Alex Crichton
8fc95d25d4 Get tests for mips passing 2015-09-14 11:06:20 -07:00
Alex Crichton
5a28433bb1 Run all tests manually
Running a test per thread really doesn't play well with QEMU emulation, so just
make it easy on ourselves and don't run threads.
2015-09-13 23:33:33 -07:00
Alex Crichton
1398566d67 Revert alloc_system change 2015-09-13 21:43:02 -07:00
Alex Crichton
1cf98aec58 Get MUSL working 2015-09-13 11:19:02 -07:00
Alex Crichton
9e97afd91f Break apart src/unix/other.rs a bit
Also sysctl isn't defined on MUSL
2015-09-13 11:16:53 -07:00
Alex Crichton
d3d77922eb Get android tests working 2015-09-11 17:22:57 -07:00
Alex Crichton
f81e3d3672 Compat back to 1.0.0 2015-09-11 15:27:20 -07:00
Alex Crichton
5d6cf05d8b Let's just juggle everything around!
[ci skip]
2015-09-11 14:52:34 -07:00
Alex Crichton
2d3608eb17 Correct ip6_mreq => ipv6_mreq 2015-09-11 12:55:15 -07:00
Alex Crichton
31504843db Windows 32-bit fixes 2015-09-11 11:44:25 -07:00
Alex Crichton
7da9b10fc6 More windows compat
[ci skip]
2015-09-10 21:26:09 -07:00
Alex Crichton
e8606192d8 Get OSX tests compiling 2015-09-10 20:19:44 -07:00
Alex Crichton
2237882ddc Test some functions! 2015-09-10 19:59:23 -07:00
Alex Crichton
26333d3147 Semi-pin to a version of syntex_syntax 2015-09-10 19:12:03 -07:00
Alex Crichton
13a6f2daf1 More windows fixes
[ci skip]
2015-09-10 19:13:19 -07:00
Alex Crichton
5f624a579c arg => flag 2015-09-10 18:10:52 -07:00
Alex Crichton
671376bac3 No parameters in C 2015-09-10 17:39:03 -07:00
Alex Crichton
b01a8ccd7c Don't worry about unused parameters 2015-09-10 17:37:22 -07:00
Alex Crichton
ac2bd85245 Windows MSVC support
[ci skip]
2015-09-10 17:36:10 -07:00
Alex Crichton
e7afdd81ba Handle when constants aren't defined 2015-09-10 17:15:20 -07:00
Alex Crichton
0df7c1076e Test constant values 2015-09-10 16:35:37 -07:00
Alex Crichton
c8b895cee7 Attempt to fix 32-bit 2015-09-10 13:24:15 -07:00
Alex Crichton
310d623acf Tweak script, fix on linux 2015-09-10 10:56:31 -07:00
Alex Crichton
3e5155b345 Test struct field offsets/sizes 2015-09-09 23:46:19 -07:00
Alex Crichton
a9adfbf56c Test size/align of structs 2015-09-09 23:21:27 -07:00
Alex Crichton
1608306b1b Get size/align tests working for typedefs 2015-09-09 22:59:24 -07:00
Alex Crichton
8e5f0cd827 Add skeleton testing framework 2015-09-09 22:46:19 -07:00