LibC: Define winsize in both termios.h and sys/ioctl.h

This commit is contained in:
2026-07-09 23:25:21 +03:00
parent 2c340c5532
commit 87006e277f
3 changed files with 24 additions and 8 deletions

View File

@@ -0,0 +1,20 @@
#ifndef _BITS_TYPES_WINSIZE_H
#define _BITS_TYPES_WINSIZE_H 1
// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/termios.h.html
#include <sys/cdefs.h>
__BEGIN_DECLS
struct winsize
{
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel; /* unused by kernel */
unsigned short ws_ypixel; /* unused by kernel */
};
__END_DECLS
#endif

View File

@@ -7,6 +7,8 @@ __BEGIN_DECLS
#include <stdint.h>
#include <bits/types/winsize.h>
#define I_ATMARK 1
#define I_CANPUT 2
#define I_CKBAND 3

View File

@@ -10,6 +10,8 @@ __BEGIN_DECLS
#define __need_pid_t
#include <sys/types.h>
#include <bits/types/winsize.h>
typedef unsigned int cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
@@ -39,14 +41,6 @@ struct termios
speed_t c_ispeed;
};
struct winsize
{
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel; /* unused by kernel */
unsigned short ws_ypixel; /* unused by kernel */
};
#define BRKINT 0x001
#define ICRNL 0x002
#define IGNBRK 0x004