revert disabling stdio buffer

This commit is contained in:
Haolan
2025-11-13 11:31:27 +08:00
parent b36be05c1e
commit c46ca84122
4 changed files with 6 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
//go:build !nogc && !baremetal
//go:build !nogc
// +build !nogc
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.

View File

@@ -1,4 +1,5 @@
//go:build nogc || baremetal
//go:build nogc
// +build nogc
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.

View File

@@ -25,16 +25,3 @@ import (
var Stdin FilePtr = Fopen(Str("/dev/stdin"), Str("r"))
var Stdout FilePtr = Fopen(Str("/dev/stdout"), Str("w"))
var Stderr FilePtr = Stdout
//go:linkname setvbuf C.setvbuf
func setvbuf(fp FilePtr, buf *Char, typ Int, size SizeT)
const (
_IONBF = 2 // No buffering - immediate output
)
func init() {
// Disable buffering for baremetal targets to ensure immediate output
setvbuf(Stdout, nil, _IONBF, 0)
setvbuf(Stdin, nil, _IONBF, 0)
}

View File

@@ -1,4 +1,5 @@
//go:build darwin && !baremetal
//go:build darwin
// +build darwin
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.