add tcgetwinsize and tcsetwinsize functions, move struct winsize
these have been adopted for future issue of POSIX as the outcome of Austin Group issue 1151, and are simply functions performing the roles of the historical ioctls. since struct winsize is being standardized along with them, its definition is moved to the appropriate header. there is some chance this will break source files that expect struct winsize to be defined by sys/ioctl.h without including termios.h. if this happens, further changes will be needed to have sys/ioctl.h expose it too.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "stdio_impl.h"
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "stdio_impl.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
|
||||
size_t __stdout_write(FILE *f, const unsigned char *buf, size_t len)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int tcgetwinsize(int fd, struct winsize *wsz)
|
||||
{
|
||||
return syscall(SYS_ioctl, fd, TIOCGWINSZ, wsz);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int tcsetwinsize(int fd, const struct winsize *wsz)
|
||||
{
|
||||
return syscall(SYS_ioctl, fd, TIOCSWINSZ, wsz);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int isatty(int fd)
|
||||
|
||||
Reference in New Issue
Block a user