]> andersk Git - openssh.git/blame - next-posix.c
- (djm) Fix printing of $DISPLAY hack if set by system type. Report from
[openssh.git] / next-posix.c
CommitLineData
729bfe59 1#include "config.h"
2
3#ifdef HAVE_NEXT
729bfe59 4#include <errno.h>
729bfe59 5#include "next-posix.h"
6
7int
8waitpid(int pid, int *stat_loc, int options)
9{
10 if (pid <= 0) {
11 if (pid != -1) {
12 errno = EINVAL;
13 return -1;
14 }
15 pid = 0; /* wait4() expects pid=0 for indiscriminate wait. */
16 }
17 return wait4(pid, (union wait *)stat_loc, options, NULL);
18}
19
20pid_t setsid(void)
21{
22 return setpgrp(0, getpid());
23}
24
25int
26tcgetattr(int fd, struct termios *t)
27{
28 return (ioctl(fd, TIOCGETA, t));
29}
30
31int
32tcsetattr(int fd, int opt, const struct termios *t)
33{
34 struct termios localterm;
35
36 if (opt & TCSASOFT) {
37 localterm = *t;
38 localterm.c_cflag |= CIGNORE;
39 t = &localterm;
40 }
41 switch (opt & ~TCSASOFT) {
42 case TCSANOW:
43 return (ioctl(fd, TIOCSETA, t));
44 case TCSADRAIN:
45 return (ioctl(fd, TIOCSETAW, t));
46 case TCSAFLUSH:
47 return (ioctl(fd, TIOCSETAF, t));
48 default:
49 errno = EINVAL;
50 return (-1);
51 }
52}
53
54int tcsetpgrp(int fd, pid_t pgrp)
55{
56 int s;
57
58 s = pgrp;
59 return (ioctl(fd, TIOCSPGRP, &s));
60}
61
62speed_t cfgetospeed(const struct termios *t)
63{
64 return (t->c_ospeed);
65}
66
67speed_t cfgetispeed(const struct termios *t)
68{
69 return (t->c_ispeed);
70}
71
72int
73cfsetospeed(struct termios *t,int speed)
74{
75 t->c_ospeed = speed;
76 return (0);
77}
78
79int
5bf9cfe9 80cfsetispeed(struct termios *t, int speed)
729bfe59 81{
82 t->c_ispeed = speed;
83 return (0);
84}
729bfe59 85#endif /* HAVE_NEXT */
This page took 1.471894 seconds and 5 git commands to generate.