hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

isatty.ha (251B)


      1 // SPDX-License-Identifier: MPL-2.0
      2 // (c) Hare authors <https://harelang.org>
      3 
      4 use rt;
      5 use io;
      6 
      7 // Returns whether the given stream is connected to a terminal.
      8 export fn isatty(fd: io::file) bool = {
      9 	return rt::fcntl(fd, rt::F_ISATTY, 0) is int;
     10 };