summaryrefslogtreecommitdiff
path: root/tests/test-termident.lua
blob: 5cde143fd96af9798bfa6d1832c4b6f8b92c7f36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
l = require "luxio"

print("ctermid()", l.ctermid())
print("ttyname(STDIN_FILENO)", l.ttyname(l.STDIN_FILENO))
print("ttyname(STDOUT_FILENO)", l.ttyname(l.STDOUT_FILENO))

local tfd, tpath = l.mkstemp(nil)

print("isatty(STDIN_FILENO)", l.isatty(l.STDIN_FILENO))

istty, what = l.isatty(tfd)

print(("isatty(%s)"):format(tpath), istty, l.strerror(what))

print(l.strerror(l.ENOTTY))

l.unlink(tpath)