]> andersk Git - openssh.git/blame - next-posix.c
- (djm) Started merge of Ben Lindstrom's <mouring@pconline.com> NeXT support
[openssh.git] / next-posix.c
CommitLineData
729bfe59 1#include "config.h"
2
3#ifdef HAVE_NEXT
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7#include <errno.h>
8#include <unistd.h>
9
10#include <sys/types.h>
11#include <sys/stat.h>
12#include <fcntl.h>
13
14#include <sys/fcntl.h>
15#include <sys/ioctl.h>
16#include <sys/time.h>
17#include <sys/file.h>
18#include <errno.h>
19#include <termios.h>
20#include <sys/wait.h>
21#ifdef HAVE_STDDEF_H
22#include <stddef.h>
23#endif
24
25#include "xmalloc.h"
26#include "ssh.h"
27#include "next-posix.h"
28
29int
30waitpid(int pid, int *stat_loc, int options)
31{
32 if (pid <= 0) {
33 if (pid != -1) {
34 errno = EINVAL;
35 return -1;
36 }
37 pid = 0; /* wait4() expects pid=0 for indiscriminate wait. */
38 }
39 return wait4(pid, (union wait *)stat_loc, options, NULL);
40}
41
42pid_t setsid(void)
43{
44 return setpgrp(0, getpid());
45}
46
47int
48tcgetattr(int fd, struct termios *t)
49{
50 return (ioctl(fd, TIOCGETA, t));
51}
52
53int
54tcsetattr(int fd, int opt, const struct termios *t)
55{
56 struct termios localterm;
57
58 if (opt & TCSASOFT) {
59 localterm = *t;
60 localterm.c_cflag |= CIGNORE;
61 t = &localterm;
62 }
63 switch (opt & ~TCSASOFT) {
64 case TCSANOW:
65 return (ioctl(fd, TIOCSETA, t));
66 case TCSADRAIN:
67 return (ioctl(fd, TIOCSETAW, t));
68 case TCSAFLUSH:
69 return (ioctl(fd, TIOCSETAF, t));
70 default:
71 errno = EINVAL;
72 return (-1);
73 }
74}
75
76int tcsetpgrp(int fd, pid_t pgrp)
77{
78 int s;
79
80 s = pgrp;
81 return (ioctl(fd, TIOCSPGRP, &s));
82}
83
84speed_t cfgetospeed(const struct termios *t)
85{
86 return (t->c_ospeed);
87}
88
89speed_t cfgetispeed(const struct termios *t)
90{
91 return (t->c_ispeed);
92}
93
94int
95cfsetospeed(struct termios *t,int speed)
96{
97 t->c_ospeed = speed;
98 return (0);
99}
100
101int
102cfsetispeed(struct termios *t, speed_t speed)
103{
104 t->c_ispeed = speed;
105 return (0);
106}
107
108#if 0
109
110/*define sigset_t int*/
111
112/* This whole thing is insane. It's purely wrong, but it's a first
113 go a it. -bl */
114
115int sigemptyset(sigset_t *set)
116{
117 return 0;
118}
119
120int sigaddset(sigset_t *set, int signum)
121{
122 *set |= (1 << (signum - 1));
123 return set;
124}
125
126int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
127{
128 switch(how) {
129 case SIG_BLOCK:
130 return 0;
131 case SIG_UNBLOCK:
132 return ( 0 & ~ *set);
133 default:
134 return 0;
135 }
136}
137
138int sigsuspend(const sigset_t *mask)
139{
140}
141
142int sigaction(int signum,const struct sigaction *act, struct sigaction *oldact)
143{
144}
145
146#endif /* 0 */
147
148#endif /* HAVE_NEXT */
This page took 0.082824 seconds and 5 git commands to generate.