diff --git a/newlib/libc/sys/jehanne/libposix_conf.c b/newlib/libc/sys/jehanne/libposix_conf.c index 568189fe3..b2549c16f 100644 --- a/newlib/libc/sys/jehanne/libposix_conf.c +++ b/newlib/libc/sys/jehanne/libposix_conf.c @@ -425,3 +425,11 @@ jehanne_fprint(2, "_fcntl_r(%d, %d, %d) from %#p\n", fd, cmd, arg, jehanne_getca } return POSIX_fcntl(errnop, fd, pcmd, arg); } + +int +__fail_with_einval(void) +{ + int *errnop = &_REENT->_errno; + *errnop = EINVAL; + return -1; +} diff --git a/newlib/libc/sys/jehanne/sysfcntl.c b/newlib/libc/sys/jehanne/sysfcntl.c index d1acf57e7..7c041aebc 100644 --- a/newlib/libc/sys/jehanne/sysfcntl.c +++ b/newlib/libc/sys/jehanne/sysfcntl.c @@ -20,9 +20,24 @@ #include #include -extern _fcntl_r(struct _reent *r, int fd, int cmd, int arg); +extern int __fail_with_einval(void); + int fcntl(int fd, int cmd, int arg) { return _fcntl_r (_REENT, fd, cmd, arg); } + +long +fpathconf(int fildes, int name) +{ + extern int _fcntl_r(struct _reent *r, int fd, int cmd, int arg); + return __fail_with_einval(); +} + +long +pathconf(const char *path, int name) +{ + extern int _fcntl_r(struct _reent *r, int fd, int cmd, int arg); + return __fail_with_einval(); +} diff --git a/newlib/libc/sys/jehanne/termios.c b/newlib/libc/sys/jehanne/termios.c index daab3fdbc..576ceb36a 100644 --- a/newlib/libc/sys/jehanne/termios.c +++ b/newlib/libc/sys/jehanne/termios.c @@ -84,3 +84,29 @@ tcsetattr(int fd, int optactions, const struct termios *t) return 0; return -1; } + +speed_t +cfgetispeed(const struct termios *t) +{ + return 38400; +} + +speed_t +cfgetospeed(const struct termios *t) +{ + return 38400; +} + +int +cfsetispeed(struct termios *tp, speed_t speed) +{ + extern int _fcntl_r(struct _reent *r, int fd, int cmd, int arg); + return __fail_with_einval(); +} + +int +cfsetospeed(struct termios *tp, speed_t speed) +{ + extern int _fcntl_r(struct _reent *r, int fd, int cmd, int arg); + return __fail_with_einval(); +}