1
프로그램을 실행하는 터미널 창의 크기를 찾기 위해 ioctl(0, TIOCGWINSZ, (struct winsize *))
을 사용하는 프로그램이 있습니다. 터미널에서 실행할 때 제대로 작동하지만 LLDB를 사용할 때 ioctl
은 0 X 0LLDB ioctl 문제
예의 창 크기 :
#include <unistd.h>
#include <sys/ioctl.h>
#include <stdio.h>
int main(){
struct winsize tty_window_size;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &tty_window_size);
printf("Rows: %i, Cols: %i\n", tty_window_size.ws_row, tty_window_size.ws_col);
return 0;
}
터미널 성적 증명서 :
$ clang test.c
$ ./a.out
Rows: 24, Cols: 80
$ lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) r
Process 32763 launched: './a.out' (x86_64)
Rows: 0, Cols: 0
Process 32763 exited with status = 0 (0x00000000)
는 이런 일이 발생하는 이유 사람, 또는 방법이 문제를 해결합니까
?미리 감사드립니다.
감사합니다.'process launch -tty'는 훌륭했습니다! – Xenon