In the resolute container I get the following output

./check_tcgets_2504 /dev/pts/0
/dev/pts/0 is a terminal (tty) using TCGETS.
/dev/pts/0 is NOT a terminal (tty) using TCGETS2.

with this program

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/tty.h>                 // For TCGETS2
#include <asm-generic/termbits.h>      // For struct termios2

int main(int argc, char *argv[]) {
    // Check for the correct number of command-line arguments
    if (argc != 2) {
        fprintf(stderr, "Usage: %s <device>\n", argv[0]);
        return 1;
    }

    // Open the specified device
    int fd = open(argv[1], O_RDONLY);
    if (fd < 0) {
        perror("Failed to open device");
        return 1;
    }

    // Check using TCGETS
    struct termios tty;
    if (ioctl(fd, TCGETS, &tty) == 0) {
        printf("%s is a terminal (tty) using TCGETS.\n", argv[1]);
    } else {
        printf("%s is NOT a terminal (tty) using TCGETS.\n", argv[1]);
    }

    // Check using TCGETS2 with struct termios2
    struct termios2 tty2;
    if (ioctl(fd, TCGETS2, &tty2) == 0) {
        printf("%s is a terminal (tty) using TCGETS2.\n", argv[1]);
    } else {
        printf("%s is NOT a terminal (tty) using TCGETS2.\n", argv[1]);
    }

    // Close the device
    close(fd);
    return 0;
}

Something might be wrong in the translation of TCGETS2 in QEMU.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2133188

Title:
  Illegal instruction in memset under qemu-user for riscv64

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/2133188/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to