jehanne: completed termios and drafted (f)pathconf
I/O baudrate hard coded at 38400 (set functions fail with EINVAL). fpathconf and pathconf fail with EINVAL
This commit is contained in:
@@ -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);
|
return POSIX_fcntl(errnop, fd, pcmd, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
__fail_with_einval(void)
|
||||||
|
{
|
||||||
|
int *errnop = &_REENT->_errno;
|
||||||
|
*errnop = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
@@ -20,9 +20,24 @@
|
|||||||
#include <posix.h>
|
#include <posix.h>
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
|
|
||||||
extern _fcntl_r(struct _reent *r, int fd, int cmd, int arg);
|
extern int __fail_with_einval(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
fcntl(int fd, int cmd, int arg)
|
fcntl(int fd, int cmd, int arg)
|
||||||
{
|
{
|
||||||
return _fcntl_r (_REENT, fd, cmd, 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();
|
||||||
|
}
|
||||||
|
@@ -84,3 +84,29 @@ tcsetattr(int fd, int optactions, const struct termios *t)
|
|||||||
return 0;
|
return 0;
|
||||||
return -1;
|
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();
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user