Merge branch 'default' into kernigh-linuxppc

This commit is contained in:
George Koehler 2016-09-30 13:55:06 -04:00
commit 9017ba9dea
2 changed files with 18 additions and 8 deletions

11
plat/linux/libsys/ioctl.c Normal file
View file

@ -0,0 +1,11 @@
#include "libsys.h"
/*
* The usual prototype is ioctl(int, unsigned long, ...). We use a
* different prototype to easily get argp, and we don't include any
* header file that would declare the usual prototype.
*/
int ioctl(int fd, unsigned long request, void *argp)
{
return _syscall(__NR_ioctl, fd, request, argp);
}

View file

@ -1,13 +1,12 @@
/* $Source: /cvsroot/tack/Ack/plat/linux386/libsys/isatty.c,v $ /*
* $State: Exp $ * XXX - can't #include <sys/ioctl.h> because libcc.ansi and libsys
* $Revision: 1.1 $ * both provide it, and we might find the wrong one.
*/ */
#define TIOCGETD 0x5424
#include <stdlib.h> int ioctl(int fd, unsigned long, ...);
#include <errno.h>
#include <unistd.h>
int isatty(int fd) int isatty(int fd)
{ {
return 0; int line_disc;
return 0 <= ioctl(fd, TIOCGETD, &line_disc);
} }