~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

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

Details
Message ID
<20220502062012.18027-1-c7s@kasku.net>
DKIM signature
missing
Download raw message
Patch: +4 -0
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
Details
Message ID
<CJP843LPEHZQ.3DUDORIC58U1J@taiga>
In-Reply-To
<20220502062012.18027-1-c7s@kasku.net> (view parent)
DKIM signature
missing
Download raw message
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.
Details
Message ID
<CJP9S0S99MW1.301GI9CMAT42I@kasku>
In-Reply-To
<CJP843LPEHZQ.3DUDORIC58U1J@taiga> (view parent)
DKIM signature
missing
Download raw message
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.
Reply to thread Export thread (mbox)