Explorar o código

Document the strange usage of W_APPEND mode for stderr

Nicolas Schodet %!s(int64=7) %!d(string=hai) anos
pai
achega
aaa1c60ee3
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/hio.rs

+ 4 - 0
src/hio.rs

@@ -41,6 +41,10 @@ impl fmt::Write for HStdout {
 
 /// Construct a new handle to the host's standard error.
 pub fn hstderr() -> Result<HStderr, ()> {
+    // There is actually no stderr access in ARM Semihosting documentation. Use
+    // convention used in libgloss.
+    // See: libgloss/arm/syscalls.c, line 139.
+    // https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=libgloss/arm/syscalls.c#l139
     open(":tt\0", nr::open::W_APPEND).map(|fd| HStderr { fd })
 }