Skip to content

Commit 69c38ed

Browse files
authored
Add some comments, and minor cleanups. (#118)
1 parent 292856a commit 69c38ed

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

c-gull/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![doc = include_str!("../README.md")]
2-
#![feature(strict_provenance)]
3-
#![feature(c_variadic)]
42
#![feature(sync_unsafe_cell)]
3+
#![feature(strict_provenance)]
54
#![deny(fuzzy_provenance_casts, lossy_provenance_casts)]
65
#![cfg_attr(not(feature = "std"), no_std)]
76

c-gull/src/termios_.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
//! Termios APIs
2+
//!
3+
//! Most of the termios functions are in c-scape, but ttyname is in c-gull
4+
//! because it depends on rustix's procfs feature, which depends on std. Rustix
5+
//! could be changed to avoid using std here, if it becomes important.
26
37
use crate::convert_res;
48
use alloc::ffi::CString;

c-scape/empty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
This directory contains empty static libraries such as libc.a, libm.a, and
22
others, to prevent the linker from opening the platform's version of those
3-
libraries.
3+
libraries, when we're in "take charge" mode.

c-scape/src/math/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ mod complex;
799799

800800
#[cfg(test)]
801801
mod tests {
802-
803802
use super::*;
803+
804804
#[test]
805805
fn is_finite_test() {
806806
unsafe {

c-scape/src/nss.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//! Most of the nss functions are implement in c-gull rather than c-scape.
2+
//! But we provide a `getpwuid_r` stub definition here in no-std mode because
3+
//! it's referenced by libstd. libstd doesn't use it for anything other than
4+
//! a fallback for when the HOME environment variable is unsed, and HOME is
5+
//! set in any reasonable use case where this would be called, so a stub
6+
//! suffices.
7+
18
#[cfg(not(feature = "std"))]
29
#[cfg(not(target_os = "wasi"))]
310
use libc::{c_char, c_int, passwd, uid_t};

c-scape/src/thread/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ unsafe extern "C" fn __tls_get_addr(p: &[usize; 2]) -> *mut c_void {
970970
//libc!(libc::__tls_get_addr(p));
971971
let [module, offset] = *p;
972972
// Offset 0 is the generation field, and we don't support dynamic linking,
973-
// so we should only sever see 1 here.
973+
// so we should only ever see 1 here.
974974
assert_eq!(module, 1);
975975
thread::current_tls_addr(offset)
976976
}

0 commit comments

Comments
 (0)