LinkTed
5964d599ac
Change standard types to libc types
2020-10-10 15:19:12 +02:00
LinkTed
1902711f38
Change name of struct to SocketCred
2020-10-10 15:19:12 +02:00
LinkTed
eeea5c23b4
Change API to unsafe and add doc comments
2020-10-10 15:19:12 +02:00
LinkTed
686964f0f5
Add set_passcred and passcred methods to UnixStream and UnixDatagram
2020-10-10 15:19:12 +02:00
LinkTed
19c5fdda7c
Rename test.rs to tests.rs
2020-10-10 15:19:12 +02:00
LinkTed
a91fd7328c
Add doc comments
2020-10-10 15:19:12 +02:00
LinkTed
46764d48bb
Add doc(cfg(...))
2020-10-10 15:19:12 +02:00
LinkTed
1869141e54
Reduce impl trait by using macro in raw_fd.rs
2020-10-10 15:19:12 +02:00
LinkTed
53791b3ff4
Move conditional compilation to the upper module and sort the target OS list alphabetically
2020-10-10 15:19:12 +02:00
LinkTed
07ed6afc6d
Remove unnecessary path
2020-10-10 15:19:12 +02:00
LinkTed
6ed9bface6
Use fill instead of memset
2020-10-10 15:19:12 +02:00
LinkTed
1f3195a5df
Remove inner function in bind, connect and send_to
2020-10-10 15:19:12 +02:00
LinkTed
4c929a00ee
Remove lifetime annotation in messages function
2020-10-10 15:19:12 +02:00
LinkTed
b82f29d780
Remove Clone trait bound in add_to_ancillary_data
2020-10-10 15:19:11 +02:00
LinkTed
3dfab6fb64
Add integer overflow check
2020-10-10 15:19:11 +02:00
LinkTed
e1084052a7
Replace TryFrom of AncillaryData with a private method.
2020-10-10 15:19:11 +02:00
LinkTed
8784ffbb4e
Using read_unaligned instead of memcpy.
2020-10-10 15:19:11 +02:00
LinkTed
8783b06bd2
Move add_to_ancillary_data and AncillaryDataIter to ancillary.rs
2020-10-10 15:19:11 +02:00
LinkTed
e6984eee6f
Add UCred struct
2020-10-10 15:19:11 +02:00
LinkTed
6f82ddf18e
Add AncillaryError
2020-10-10 15:19:11 +02:00
LinkTed
6fa7c3f79e
Split net.rs into multiple files
2020-10-10 15:19:11 +02:00
LinkTed
0b3c9d8465
unix: Extend UnixStream and UnixDatagram to send and receive file descriptors
...
Add the functions `recv_vectored_fds` and `send_vectored_fds` to send and receive file descriptors, by using `recvmsg` and `sendmsg` system call.
2020-10-10 15:19:11 +02:00
Jonas Schievink
ccc020ab42
Rollup merge of #77182 - GuillaumeGomez:missing-examples-fd-traits, r=pickfire
...
Add missing examples for Fd traits
Not sure what happened here... This is a reopening of #77142
r? @Dylan-DPC
2020-10-03 00:31:10 +02:00
Guillaume Gomez
d6b838b93a
Simplify fd examples
2020-10-02 16:38:15 +02:00
bors
2ad6187ce5
Auto merge of #76969 - withoutboats:rawfd-refexive-traits, r=dtolnay
...
Make RawFd implement the RawFd traits
This PR makes `RawFd` implement `AsRawFd`, `IntoRawFd` and `FromRawFd`, so it can be passed to interfaces that use one of those traits as a bound.
2020-10-01 15:39:33 +00:00
Guillaume Gomez
980e1ff40f
Add missing examples for Fd traits
2020-09-25 21:20:42 +02:00
Joshua Nelson
15f08d6ddf
Revert "Function to convert OpenOptions to c_int"
2020-09-22 23:07:30 -04:00
bors
e0bc267512
Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplett
...
Function to convert OpenOptions to c_int
Fixes : #74943
The creation_mode and access_mode function were already available in the OpenOptions struct, but currently private. I've added a new free functions to unix/fs.rs which takes the OpenOptions, and returns the c_int to be used as parameter for the `open` call.
2020-09-22 13:02:02 +00:00
Federico Ponzi
2f5192280f
enable unstable open_options_ext_as_flags feature in doc comments
2020-09-22 09:54:36 +01:00
Without Boats
acc136ce0a
fix typos
2020-09-20 13:32:49 +02:00
Without Boats
82f5928ca6
Make RawFd implement the RawFd traits
2020-09-20 13:21:42 +02:00
rijenkii
a60f97849b
Add tracking issue for feature(unix_socket_peek)
2020-09-19 21:55:01 +07:00
Federico Ponzi
70292d4506
Sets as_flags as unstable
2020-09-16 19:40:44 +02:00
bors
a874956d94
Auto merge of #75148 - joechrisellis:master, r=Amanieu
...
Implementation of peer credentials for Unix sockets
The code in `ucred.rs` is based on the work done in [PR 13](https://github.com/tokio-rs/tokio-uds/pull/13 ) in the tokio-uds repository on GitHub.
This commit is effectively a port to the stdlib, so credit to Martin Habovštiak (`@Kixunil)` and contributors for the meat of this work. 🥇
Happy to make changes as needed. 🙂
2020-09-15 17:05:57 +00:00
Joe Ellis
68ff495afa
Fix peer credentials for Android
2020-09-14 10:31:56 +01:00
Joe Ellis
72eef6168f
Conditionally compile peer credentials feature for supported platforms
2020-09-14 10:31:56 +01:00
Joe Ellis
fa697dfa81
Add documentation to public fields of UCred struct
2020-09-14 10:31:56 +01:00
Joe Ellis
7c20be387b
Move Unix peer credentials tests to their own file
2020-09-14 10:31:56 +01:00
Joe Ellis
40a830321d
Add pid as an option to UCred struct
...
Currently, PID will be populated for Linux, and set to None for BSDs.
2020-09-14 10:31:56 +01:00
Joe Ellis
cbcf3877b5
Use u32::MAX instead of u32::max_value
...
Co-authored-by: lzutao <taolzu@gmail.com >
2020-09-14 10:31:56 +01:00
Joe Ellis
be2637aba7
Add basic test for Unix peer credentials
2020-09-14 10:31:56 +01:00
Joe Ellis
a9ec61db17
Remove use of MaybeUninit in ucred.rs
...
We can simply init the struct directly. There is no real need to use
uninit memory here.
2020-09-14 10:31:56 +01:00
Joe Ellis
ed20eff92b
Implementation of peer credentials for Unix sockets
...
The code in `ucred.rs` is based on the work done in PR 13 in the
tokio-uds repository on GitHub. Link below for reference:
https://github.com/tokio-rs/tokio-uds/pull/13
Credit to Martin Habovštiak (GitHub username Kixunil) and contributors
for this work!
2020-09-14 10:31:44 +01:00
Nicholas Bishop
2eeb8f18eb
Remove Windows details from Unix and VmWorks symlink() docstrings
...
This note is not relevant to other operating systems.
2020-09-12 15:50:28 -04:00
Ralf Jung
2477f070fc
Rollup merge of #76583 - CDirkx:os-doc, r=jonas-schievink
...
Update `std::os` module documentation.
Adds missing descriptions for the modules `std::os::linux::fs` and `std::os::windows::io`.
Also adds punctuation for consistency with other descriptions.
2020-09-12 10:43:20 +02:00
rijenkii
64b8fd7920
Add peek and peek_from to UnixStream and UnixDatagram
2020-09-11 20:07:08 +07:00
Christiaan Dirkx
954361a3d4
Update std::os module documentation.
...
Adds missing descriptions for the modules std::os::linux::fs and std::os::windows::io.
Also adds punctuation for consistency with other descriptions.
2020-09-11 04:05:19 +02:00
Chris Gillespie
5456414d91
Fix nlink example typo
2020-09-04 14:41:27 -07:00
Joshua Nelson
59a1a05bff
Convert many files to intra-doc links
...
- Use intra-doc links for `std::io` in `std::fs`
- Use intra-doc links for File::read in unix/ext/fs.rs
- Remove explicit intra-doc links for `true` in `net/addr.rs`
- Use intra-doc links in alloc/src/sync.rs
- Use intra-doc links in src/ascii.rs
- Switch to intra-doc links in alloc/rc.rs
- Use intra-doc links in core/pin.rs
- Use intra-doc links in std/prelude
- Use shorter links in `std/fs.rs`
`io` is already in scope.
2020-09-02 17:37:40 -04:00
Federico Ponzi
321b680fe6
Update docs of OpenOptions::as_flags
2020-09-02 10:48:11 +02:00