~sircmpwn/hare-dev

os: document std{in,out}_bufio v1 REJECTED

Cormac Stephenson: 1
 os: document std{in,out}_bufio

 2 files changed, 4 insertions(+), 0 deletions(-)
I think that would be better, since it's already a member of
bufio::bufstream. The names should probably be changed to
bufio::std{in,out}_bufstream if this is kept though, since bufio isn't
a type.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-dev/patches/31822/mbox | git am -3
Learn more about email & git

[PATCH] os: document std{in,out}_bufio Export this patch

Signed-off-by: Cormac Stephenson <c7s@kasku.net>
---
 os/+freebsd/stdfd.ha | 2 ++
 os/+linux/stdfd.ha   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/os/+freebsd/stdfd.ha b/os/+freebsd/stdfd.ha
index 92ba939d..87659587 100644
--- a/os/+freebsd/stdfd.ha
+++ b/os/+freebsd/stdfd.ha
@@ -4,11 +4,13 @@
use bufio;
use io;

// The standard input, as a [[bufio::bufstream]]. This handle is buffered.
export let stdin_bufio: bufio::bufstream = bufio::bufstream {
	source = 0,
	...
};

// The standard output, as a [[bufio::bufstream]]. This handle is buffered.
export let stdout_bufio: bufio::bufstream = bufio::bufstream {
	source = 1,
	...
diff --git a/os/+linux/stdfd.ha b/os/+linux/stdfd.ha
index 92ba939d..87659587 100644
--- a/os/+linux/stdfd.ha
+++ b/os/+linux/stdfd.ha
@@ -4,11 +4,13 @@
use bufio;
use io;

// The standard input, as a [[bufio::bufstream]]. This handle is buffered.
export let stdin_bufio: bufio::bufstream = bufio::bufstream {
	source = 0,
	...
};

// The standard output, as a [[bufio::bufstream]]. This handle is buffered.
export let stdout_bufio: bufio::bufstream = bufio::bufstream {
	source = 1,
	...
-- 
2.36.0
I'm not sure about this solution. I was thinking that a better approach
might be to have bufio::flush accept any io::handle and flush it if
there's a buffered stream inside.