Skip to content

Commit

Permalink
Join print args before syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Nov 2, 2024
1 parent 5751592 commit fca2755
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Reading the real time clock (RTC):
Changing the system time:

```
> print "2025-01-01 00:00:00" => /dev/clk/rtc
> print 2025-01-01 00:00:00 => /dev/clk/rtc
[580.327629] RTC 2025-01-01 00:00:00 +0000
```

Expand Down
2 changes: 1 addition & 1 deletion doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ You can print the date with `date`:
You can update the real time clock by writing the correct time to its device
file:

> print "2023-03-21 10:00:00" => /dev/clk/rtc
> print 2023-03-21 10:00:00 => /dev/clk/rtc

> date
2023-03-21 10:00:00 +0000
Expand Down
8 changes: 1 addition & 7 deletions src/bin/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ use moros::entry_point;
entry_point!(main);

fn main(args: &[&str]) {
let n = args.len();
for i in 1..n {
syscall::write(1, args[i].as_bytes());
if i < n - 1 {
syscall::write(1, b" ");
}
}
syscall::write(1, args[1..].join(" ").as_bytes());
syscall::write(1, b"\n");
}

0 comments on commit fca2755

Please sign in to comment.