[libc-commits] [PATCH] D135618: [libc] add isatty

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Oct 10 14:45:47 PDT 2022


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
michaelrj requested review of this revision.

The isatty function uses the side effects of an ioctl call to determine
if a specific file descriptor is a terminal. I chose TIOCGETD (get line
discipline of terminal) because it didn't require any new structs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135618

Files:
  libc/config/linux/x86_64/entrypoints.txt
  libc/config/linux/x86_64/headers.txt
  libc/include/CMakeLists.txt
  libc/include/llvm-libc-macros/CMakeLists.txt
  libc/include/llvm-libc-macros/linux/CMakeLists.txt
  libc/include/llvm-libc-macros/linux/sys-ioctl-macros.h
  libc/include/llvm-libc-macros/sys-ioctl-macros.h
  libc/include/sys/ioctl.h.def
  libc/spec/posix.td
  libc/src/unistd/CMakeLists.txt
  libc/src/unistd/isatty.h
  libc/src/unistd/linux/CMakeLists.txt
  libc/src/unistd/linux/isatty.cpp
  libc/test/src/unistd/CMakeLists.txt
  libc/test/src/unistd/isatty_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135618.466628.patch
Type: text/x-patch
Size: 11245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221010/ab8c5bf1/attachment.bin>


More information about the libc-commits mailing list