aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-files.adb
diff options
context:
space:
mode:
authorJonsba <jonasb@tranquille.ch>2016-06-28 04:26:18 +0200
committertgingold <tgingold@users.noreply.github.com>2016-06-28 04:26:18 +0200
commit2ea6a59083a16e3093116101bc574fce623ff344 (patch)
tree79c94a95baf39f690cbd56f513d695c981ce6e1d /src/grt/grt-files.adb
parentdc8680d3b002df5dbc2c92e86b133803a9e68a39 (diff)
downloadghdl-2ea6a59083a16e3093116101bc574fce623ff344.tar.gz
ghdl-2ea6a59083a16e3093116101bc574fce623ff344.tar.bz2
ghdl-2ea6a59083a16e3093116101bc574fce623ff344.zip
Jonsba/master (#100)
* Add a --unbuffered option for simulation. It disables buffering for stdout, stderr and files opened in write or append mode (TEXTIO). Fixes #87 * Some simplifications made on the previous commit. Documentation added for --unbuffered in Simulation_and_runtime.rst. * Some more simplifications on unbuffered writes support for TEXTIO * Fix a style issue failure reported by Travis-CI
Diffstat (limited to 'src/grt/grt-files.adb')
-rw-r--r--src/grt/grt-files.adb4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/grt/grt-files.adb b/src/grt/grt-files.adb
index a47381289..694572362 100644
--- a/src/grt/grt-files.adb
+++ b/src/grt/grt-files.adb
@@ -26,6 +26,7 @@ with Grt.Errors; use Grt.Errors;
with Grt.Stdio; use Grt.Stdio;
with Grt.C; use Grt.C;
with Grt.Table;
+with Grt.Options;
with System; use System;
pragma Elaborate_All (Grt.Table);
@@ -195,6 +196,9 @@ package body Grt.Files is
if F = NULL_Stream then
return Name_Error;
end if;
+ if Grt.Options.Unbuffered_Writes and Mode /= Read_Mode then
+ setbuf (F, NULL_voids);
+ end if;
end if;
Sig := Files_Table.Table (File).Signature;
if Sig /= null then