From: Siva Chandra Reddy Date: Tue, 14 Mar 2023 01:00:23 +0000 (+0000) Subject: [libc] Switch termios implementations to libc_errno. X-Git-Tag: upstream/17.0.6~14957 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb03705726ef1357dbb5ac2bccc890b6b105db9e;p=platform%2Fupstream%2Fllvm.git [libc] Switch termios implementations to libc_errno. --- diff --git a/libc/src/termios/linux/tcdrain.cpp b/libc/src/termios/linux/tcdrain.cpp index 910e62b..1a51cd3 100644 --- a/libc/src/termios/linux/tcdrain.cpp +++ b/libc/src/termios/linux/tcdrain.cpp @@ -21,7 +21,7 @@ namespace __llvm_libc { LLVM_LIBC_FUNCTION(int, tcdrain, (int fd)) { long ret = __llvm_libc::syscall_impl(SYS_ioctl, fd, TCSBRK, 1); if (ret < 0) { - errno = -ret; + libc_errno = -ret; return -1; } return 0; diff --git a/libc/src/termios/linux/tcflush.cpp b/libc/src/termios/linux/tcflush.cpp index fd876af..8e1f407 100644 --- a/libc/src/termios/linux/tcflush.cpp +++ b/libc/src/termios/linux/tcflush.cpp @@ -21,7 +21,7 @@ namespace __llvm_libc { LLVM_LIBC_FUNCTION(int, tcflush, (int fd, int queue_selector)) { long ret = __llvm_libc::syscall_impl(SYS_ioctl, fd, TCFLSH, queue_selector); if (ret < 0) { - errno = -ret; + libc_errno = -ret; return -1; } return 0; diff --git a/libc/src/termios/linux/tcgetsid.cpp b/libc/src/termios/linux/tcgetsid.cpp index b366fd4..c0491d9 100644 --- a/libc/src/termios/linux/tcgetsid.cpp +++ b/libc/src/termios/linux/tcgetsid.cpp @@ -22,7 +22,7 @@ LLVM_LIBC_FUNCTION(pid_t, tcgetsid, (int fd)) { pid_t sid; long ret = __llvm_libc::syscall_impl(SYS_ioctl, fd, TIOCGSID, &sid); if (ret < 0) { - errno = -ret; + libc_errno = -ret; return -1; } return sid;