1
私はioctl(0, TIOCGWINSZ, (struct winsize *))
を使用して、プログラムが実行されている端末ウィンドウのサイズを調べるプログラムを持っています。端末で実行すると問題なく動作しますが、LLDBを使用するとioctl
はLLDB 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;
}
ターミナルトランスクリプト:0 X 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