diff options
author | Alan Somers <asomers@axcient.com> | 2020-04-07 21:52:04 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2021-07-12 20:55:30 -0600 |
commit | 3eafb3b0b937f7afd5d1ef1e65e81c1648225788 (patch) | |
tree | e710de821b129750fff6dedb22793e55d25392c4 /src/unix/redox | |
parent | 13c8ceb1ed9077295edf68747bb282a6bee5f31c (diff) | |
download | rust-libc-3eafb3b0b937f7afd5d1ef1e65e81c1648225788.tar.gz |
FD_ISSET: take a *const fd_set instead of *mut fd_set
FD_ISSET does not modify its fd_set argument, so it may as well take a
const pointer. AFAICT the only reason to take a *mut pointer is because
the Linux man page documents it that way (though since glibc implements
it as a macro, the constedness is undefined). But since libc implements
it directly rather than calling a (nonexistent on most platforms) C
function, we're defining the API ourselves.
Diffstat (limited to 'src/unix/redox')
-rw-r--r-- | src/unix/redox/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 1601a8adfb..05c7fad454 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -898,7 +898,7 @@ f! { return } - pub fn FD_ISSET(fd: ::c_int, set: *mut fd_set) -> bool { + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { let fd = fd as usize; let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 |