Commit Graph

207 Commits

Author SHA1 Message Date
Carl Lerche
2391ec3da1 Deploy docs to S3 2015-05-28 15:05:48 -07:00
Carl Lerche
3106b3ca37 Move nix::mq -> nix::mqueue to mirror header 2015-05-28 12:40:27 -07:00
Carl Lerche
b786012118 Run CI on linux & os x 2015-05-28 12:28:50 -07:00
Phil Dawes
e71077d824 Add sys::socket send and recv 2015-05-27 11:47:11 -07:00
Cole Reynolds
718591938b Change epoll_wait to use isize timeout_ms.
A timeout of -1 makes epoll block indefinitely, a usize timeout means we can't specify this behavior; using isize fixes this.
2015-05-24 20:16:40 -04:00
Carl Lerche
21fb1394a1 Fix NixPath yield with CStr instead of OsStr
As described in #117, the `AsExtStr` trait is defined to return a raw `*const
libc::c_char`. Its impl for `OsStr` simply borrowed the byte slice from its
`OsStr` argument and cast it to a `*const libc::c_char`, which does not
construct a proper null-terminated C string.

Given this, the `AsExtStr` is not necessary and is removed. `NixPath` is
updated to yield `CStr`.

Fixes #117, #120
Thanks to @dead10ck
2015-05-21 16:38:54 -07:00
Carl Lerche
3fc83b942a Fix travis tests 2015-05-21 15:34:50 -07:00
Carl Lerche
74d1831880 Test sockopt const values 2015-05-21 15:02:12 -07:00
hoxnox
075c037f8b Add socket::shutdown function
libc::funcs::bsd43::shutdown is used
2015-05-21 11:58:56 +03:00
Carl Lerche
d645d911d5 Bump version to v0.3.6 2015-05-19 23:02:28 -07:00
Markus Jais
f2ca2b0d3c added getpid and getppid 2015-05-19 20:38:52 +02:00
Markus Jais
a0073d1f9f cleaned up mq unit tests 2015-05-16 10:45:01 +02:00
Paul Osborne
c4a9598ec1 docs: fix module documentation for ioctl
Two problems were fixed:

1. All of the comments for the module were prefixed with `///!` instead
   of just `//!`
2. There was no newline before lists which is required in markdown, so
   they were not rendering correctly.
2015-05-13 00:46:37 -05:00
Paul Osborne
e29ea45de7 ioctl: modify type signatures to match common ioctl usage and libc impls
The ioctl interface expected by most external parties is that of
an unsigned long (c_ulong).  The libc crate expects as an int.  This
change exposes c_ulong (via ioctl_op_t) to external users and
casts to c_int before calling the libc function.

The only documentation in SUSv3 for ioctl has to do with stream
devices.  The support documented there is not widely supported (it
is not supported by the Linux kernel)[1].

[1] The Linux Programming Interface, Page 86.
2015-05-12 22:25:22 -07:00
Paul Osborne
a43613ac77 ioctl: implement generic support for the ioctl syscall and supporting functions
This commit provides a new implementation for ioctl that is much
more generic, allowing for clients to use send any manner of ioctl
requests at special files.  The implementation provides two main features
that help to raise the level of abstraction over that provided by libc.

1. The module now provides functions that provide the same functionality
   as the linux kernel _IO* macros.  These are used frequently in the
   linux kernel for building ops for ioctls.  The use of these helper
   functions are not required.
2. Functions are provided for the 3 main types of ioctl usage patterns
   (read, write, and execute).  For many subystems, the read() call
   which returns a Result<T> and the write calls taking a &T provide
   a nice interface.

All of the methods wrapping ioctl are unsafe and will probably need to
remain that way unless knowledge of the semantics of every possible
ioctl call are added to the nix library.  The best that exists for
ioctls are some conventions around the op, but even these conventions
are really only used for newer devices added to the kernel.

This change resolves #108
2015-05-12 22:25:22 -07:00
Andrew J. Stone
1a2d6d51f4 Get the library to build on freebsd
`cargo build` works.
2015-05-11 22:06:19 -07:00
Skyler Hawthorne
ecbbf1a817 Add lstat 2015-05-08 14:11:44 -07:00
Carl Lerche
d01c032b1c Scope to unix platforms 2015-05-07 22:19:49 -07:00
Carl Lerche
07916d4dd0 More multicast support 2015-05-07 20:57:02 -07:00
Qingping Hou
40539b5c23 feat: add execvpe 2015-05-05 05:23:05 -04:00
Qingping Hou
05b7749fdc feat: add chroot syscall 2015-04-28 01:59:17 -04:00
Markus Jais
8127b4dd6d Basic Posix MQ support 2015-04-27 13:37:18 -07:00
Carl Lerche
dc363728f1 Bump version to v0.3.5 2015-04-26 12:18:51 -07:00
Paul Osborne
bc84ac1358 sched: add support for arm linux using same cpuset_attribs as android
The limit of 32 cores may not actually be a limit with arm-linux, but
I am not aware of anything in excess of 32 processors out there currently
and this is what I have been running for awhile now on a beaglebone
black (`--target=arm-unknown-linux-gnueabihf`).

This change addresses #95 and relates to #97.
2015-04-24 16:12:56 -07:00
Carl Lerche
e17c4b652d Run CI on beta and nightly 2015-04-24 15:36:22 -07:00
Florian Hartwig
6bbc43beac FromPrimitive is no more 2015-04-24 00:23:44 +02:00
Carl Lerche
86680639ba Bump version to v0.3.4 2015-04-20 14:21:07 -07:00
Carl Lerche
4314477b4d Fix build on Rust nightlies 2015-04-20 14:10:45 -07:00
Valerii Hiora
d2c9d67a55 Added OOB_INLINE socket option 2015-04-18 12:00:51 +03:00
Tobias Bucher
a9ce14cd5a Make sigaction unsafe
This is done because interrupted execution has soundness bugs regarding
thread-local storage. Fixes #90.
2015-04-14 16:34:51 +02:00
Florian Hartwig
e3d86a9ccd Add socketpair 2015-04-11 23:51:13 +02:00
Carl Lerche
9b0a534962 Bring back eventfd behind a feature flag
At some point, feature flags will be switched to a conditional build system.
2015-04-08 10:58:06 -07:00
Carl Lerche
c5c21c4c96 Bump version to v0.3.3 2015-04-07 14:51:16 -07:00
Carl Lerche
58dcbb811d Error on warnings 2015-04-07 14:41:10 -07:00
Carl Lerche
7fb87b5dce Add Error::from_errno 2015-04-07 13:26:18 -07:00
Carl Lerche
f43ecde470 Use fcntl:Fd vs. std::os::unix::io::RawFd 2015-04-06 17:40:26 -07:00
Carl Lerche
9e935330dd Get compiling on Rust 1.0 beta
Initially support this by assuming the lowest common denominator. The long
term solution is to improve the build system to allow pulling in more specific
features that are available on the target system.
2015-04-06 17:33:17 -07:00
Florian Hartwig
e5ae756203 'derive(Copy)' needs Clone now 2015-04-03 20:55:39 +02:00
Florian Hartwig
7d48278859 Fd ist now RawFd 2015-04-03 02:16:45 +02:00
Carl Lerche
a3dbdffe6f Bump version to v0.3.2 2015-04-01 20:39:47 -07:00
Carl Lerche
13a1d556b4 Bump dependency versions 2015-04-01 20:39:43 -07:00
Carl Lerche
ffc8826dfe Remove usage of std::num::Int 2015-04-01 20:35:24 -07:00
Florian Hartwig
30ea974431 Fix argument order for copy* functions 2015-04-01 20:28:48 +02:00
Carl Lerche
abb40497ee Track Rust nightly 2015-03-31 14:29:50 -07:00
Carl Lerche
15256eb1c2 Track Rust nightly 2015-03-28 17:05:47 -07:00
Carl Lerche
c252b4d534 Use libc from crates.io 2015-03-25 18:41:57 -07:00
Carl Lerche
bf3d7c4939 Tweak conversion in test 2015-03-25 16:39:51 -07:00
Carl Lerche
c07fb83d39 Fix manifest excludes 2015-03-25 11:28:57 -07:00
Carl Lerche
0a0a45e723 Bump version to 0.3.1 2015-03-25 11:24:15 -07:00
Carl Lerche
0d5ea0b16d Track Rust master 2015-03-25 10:52:05 -07:00