jehanne: mock ioctl and tcflush
This commit is contained in:
@ -8,7 +8,7 @@ if MAY_SUPPLY_SYSCALLS
|
|||||||
extra_objs = syscalls.o libposix_conf.o chown.o getrusage.o ids.o \
|
extra_objs = syscalls.o libposix_conf.o chown.o getrusage.o ids.o \
|
||||||
chmod.o sigsets.o sigaction.o sigsuspend.o sigwaitinfo.o \
|
chmod.o sigsets.o sigaction.o sigsuspend.o sigwaitinfo.o \
|
||||||
sigtimedwait.o sigwait.o alarm.o sigqueue.o siglongjmp.o \
|
sigtimedwait.o sigwait.o alarm.o sigqueue.o siglongjmp.o \
|
||||||
termios.o
|
termios.o ioctl.o
|
||||||
else
|
else
|
||||||
extra_objs =
|
extra_objs =
|
||||||
endif
|
endif
|
||||||
@ -21,7 +21,7 @@ lib_a_LIBADD = $(extra_objs)
|
|||||||
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \
|
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \
|
||||||
ids.c chmod.c sigsets.c sigaction.c sigsuspend.c sigwaitinfo.c \
|
ids.c chmod.c sigsets.c sigaction.c sigsuspend.c sigwaitinfo.c \
|
||||||
sigtimedwait.c sigwait.c alarm.c sigqueue.c siglongjmp.c \
|
sigtimedwait.c sigwait.c alarm.c sigqueue.c siglongjmp.c \
|
||||||
termios.c
|
termios.c ioctl.c
|
||||||
lib_a_DEPENDENCIES = $(extra_objs)
|
lib_a_DEPENDENCIES = $(extra_objs)
|
||||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||||
|
@ -56,7 +56,8 @@ lib_a_AR = $(AR) $(ARFLAGS)
|
|||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ ids.o chmod.o sigsets.o sigaction.o \
|
@MAY_SUPPLY_SYSCALLS_TRUE@ ids.o chmod.o sigsets.o sigaction.o \
|
||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ sigsuspend.o sigwaitinfo.o \
|
@MAY_SUPPLY_SYSCALLS_TRUE@ sigsuspend.o sigwaitinfo.o \
|
||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ sigtimedwait.o sigwait.o alarm.o \
|
@MAY_SUPPLY_SYSCALLS_TRUE@ sigtimedwait.o sigwait.o alarm.o \
|
||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ sigqueue.o siglongjmp.o termios.o
|
@MAY_SUPPLY_SYSCALLS_TRUE@ sigqueue.o siglongjmp.o termios.o \
|
||||||
|
@MAY_SUPPLY_SYSCALLS_TRUE@ ioctl.o
|
||||||
am_lib_a_OBJECTS = lib_a-getenv_r.$(OBJEXT) lib_a-getenv.$(OBJEXT) \
|
am_lib_a_OBJECTS = lib_a-getenv_r.$(OBJEXT) lib_a-getenv.$(OBJEXT) \
|
||||||
lib_a-malloc.$(OBJEXT) lib_a-mallocr.$(OBJEXT) \
|
lib_a-malloc.$(OBJEXT) lib_a-mallocr.$(OBJEXT) \
|
||||||
lib_a-free.$(OBJEXT) lib_a-freer.$(OBJEXT) \
|
lib_a-free.$(OBJEXT) lib_a-freer.$(OBJEXT) \
|
||||||
@ -187,7 +188,7 @@ noinst_LIBRARIES = lib.a
|
|||||||
@MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = syscalls.o libposix_conf.o chown.o getrusage.o ids.o \
|
@MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = syscalls.o libposix_conf.o chown.o getrusage.o ids.o \
|
||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ chmod.o sigsets.o sigaction.o sigsuspend.o sigwaitinfo.o \
|
@MAY_SUPPLY_SYSCALLS_TRUE@ chmod.o sigsets.o sigaction.o sigsuspend.o sigwaitinfo.o \
|
||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ sigtimedwait.o sigwait.o alarm.o sigqueue.o siglongjmp.o \
|
@MAY_SUPPLY_SYSCALLS_TRUE@ sigtimedwait.o sigwait.o alarm.o sigqueue.o siglongjmp.o \
|
||||||
@MAY_SUPPLY_SYSCALLS_TRUE@ termios.o
|
@MAY_SUPPLY_SYSCALLS_TRUE@ termios.o ioctl.o
|
||||||
|
|
||||||
lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \
|
lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \
|
||||||
calloc.c callocr.c realloc.c reallocr.c environ.c signal.c \
|
calloc.c callocr.c realloc.c reallocr.c environ.c signal.c \
|
||||||
@ -197,7 +198,7 @@ lib_a_LIBADD = $(extra_objs)
|
|||||||
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \
|
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c chown.c getrusage.c \
|
||||||
ids.c chmod.c sigsets.c sigaction.c sigsuspend.c sigwaitinfo.c \
|
ids.c chmod.c sigsets.c sigaction.c sigsuspend.c sigwaitinfo.c \
|
||||||
sigtimedwait.c sigwait.c alarm.c sigqueue.c siglongjmp.c \
|
sigtimedwait.c sigwait.c alarm.c sigqueue.c siglongjmp.c \
|
||||||
termios.c
|
termios.c ioctl.c
|
||||||
|
|
||||||
lib_a_DEPENDENCIES = $(extra_objs)
|
lib_a_DEPENDENCIES = $(extra_objs)
|
||||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||||
@ -452,6 +453,12 @@ lib_a-termios.o: termios.c
|
|||||||
lib_a-termios.obj: termios.c
|
lib_a-termios.obj: termios.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-termios.obj `if test -f 'termios.c'; then $(CYGPATH_W) 'termios.c'; else $(CYGPATH_W) '$(srcdir)/termios.c'; fi`
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-termios.obj `if test -f 'termios.c'; then $(CYGPATH_W) 'termios.c'; else $(CYGPATH_W) '$(srcdir)/termios.c'; fi`
|
||||||
|
|
||||||
|
lib_a-ioctl.o: ioctl.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ioctl.o `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c
|
||||||
|
|
||||||
|
lib_a-ioctl.obj: ioctl.c
|
||||||
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ioctl.obj `if test -f 'ioctl.c'; then $(CYGPATH_W) 'ioctl.c'; else $(CYGPATH_W) '$(srcdir)/ioctl.c'; fi`
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
unique=`for i in $$list; do \
|
unique=`for i in $$list; do \
|
||||||
|
29
newlib/libc/sys/jehanne/ioctl.c
Normal file
29
newlib/libc/sys/jehanne/ioctl.c
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Jehanne.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, version 3 of the License.
|
||||||
|
*
|
||||||
|
* Jehanne is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <u.h>
|
||||||
|
#include <libc.h>
|
||||||
|
#include <posix.h>
|
||||||
|
#include <reent.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
ioctl(int fd, int request, ...)
|
||||||
|
{
|
||||||
|
// blatant lie
|
||||||
|
return 0;
|
||||||
|
}
|
@ -35,6 +35,13 @@ tcsetpgrp(int fd, int pgrp)
|
|||||||
return POSIX_tcsetpgrp(errnop, fd, pgrp);
|
return POSIX_tcsetpgrp(errnop, fd, pgrp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
tcflush(int fd, int queue_selector)
|
||||||
|
{
|
||||||
|
// blatant lie
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#define CESC '\\'
|
#define CESC '\\'
|
||||||
#define CINTR 0177 /* DEL */
|
#define CINTR 0177 /* DEL */
|
||||||
#define CQUIT 034 /* FS, cntl | */
|
#define CQUIT 034 /* FS, cntl | */
|
||||||
|
Reference in New Issue
Block a user