hare

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

isatty.ha (259B)


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