Implementation of TCXONC.

Reviewed by: bde
This commit is contained in:
marcel 1999-07-17 08:24:57 +00:00
parent 29e416a92d
commit 90eec5398e
4 changed files with 76 additions and 6 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: linux.h,v 1.28 1999/07/06 06:54:00 cracauer Exp $
* $Id: linux.h,v 1.29 1999/07/08 16:15:18 marcel Exp $
*/
#ifndef _I386_LINUX_LINUX_H_
@ -243,7 +243,11 @@ struct trapframe;
#define LINUX_VT_ACTIVATE 0x5606
#define LINUX_VT_WAITACTIVE 0x5607
/* arguments for tcflow() and LINUX_TCXONC */
#define LINUX_TCOOFF 0
#define LINUX_TCOON 1
#define LINUX_TCIOFF 2
#define LINUX_TCION 3
/* arguments for tcflush() and LINUX_TCFLSH */
#define LINUX_TCIFLUSH 0

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: linux_ioctl.c,v 1.34 1999/07/06 11:41:48 marcel Exp $
* $Id: linux_ioctl.c,v 1.35 1999/07/08 16:15:19 marcel Exp $
*/
#include <sys/param.h>
@ -986,6 +986,37 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args)
linux_tiocsserial(fp, (struct linux_serial_struct *)args->arg);
return 0;
case LINUX_TCXONC:
switch (args->arg) {
case LINUX_TCOOFF:
args->cmd = TIOCSTOP;
break;
case LINUX_TCOON:
args->cmd = TIOCSTART;
break;
case LINUX_TCIOFF:
case LINUX_TCION: {
u_char c;
struct write_args wr;
error = (*func)(fp, TIOCGETA, (caddr_t)&bsd_termios, p);
if (error != 0)
return error;
c = bsd_termios.c_cc[args->arg == LINUX_TCIOFF ? VSTOP : VSTART];
if (c != _POSIX_VDISABLE) {
wr.fd = args->fd;
wr.buf = &c;
wr.nbyte = sizeof(c);
return write(p, &wr);
}
else
return (0);
}
default:
return EINVAL;
}
args->arg = 0;
return ioctl(p, (struct ioctl_args *)args);
case LINUX_TCFLSH:
args->cmd = TIOCFLUSH;
switch (args->arg) {

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: linux.h,v 1.28 1999/07/06 06:54:00 cracauer Exp $
* $Id: linux.h,v 1.29 1999/07/08 16:15:18 marcel Exp $
*/
#ifndef _I386_LINUX_LINUX_H_
@ -243,7 +243,11 @@ struct trapframe;
#define LINUX_VT_ACTIVATE 0x5606
#define LINUX_VT_WAITACTIVE 0x5607
/* arguments for tcflow() and LINUX_TCXONC */
#define LINUX_TCOOFF 0
#define LINUX_TCOON 1
#define LINUX_TCIOFF 2
#define LINUX_TCION 3
/* arguments for tcflush() and LINUX_TCFLSH */
#define LINUX_TCIFLUSH 0

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: linux_ioctl.c,v 1.34 1999/07/06 11:41:48 marcel Exp $
* $Id: linux_ioctl.c,v 1.35 1999/07/08 16:15:19 marcel Exp $
*/
#include <sys/param.h>
@ -986,6 +986,37 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args)
linux_tiocsserial(fp, (struct linux_serial_struct *)args->arg);
return 0;
case LINUX_TCXONC:
switch (args->arg) {
case LINUX_TCOOFF:
args->cmd = TIOCSTOP;
break;
case LINUX_TCOON:
args->cmd = TIOCSTART;
break;
case LINUX_TCIOFF:
case LINUX_TCION: {
u_char c;
struct write_args wr;
error = (*func)(fp, TIOCGETA, (caddr_t)&bsd_termios, p);
if (error != 0)
return error;
c = bsd_termios.c_cc[args->arg == LINUX_TCIOFF ? VSTOP : VSTART];
if (c != _POSIX_VDISABLE) {
wr.fd = args->fd;
wr.buf = &c;
wr.nbyte = sizeof(c);
return write(p, &wr);
}
else
return (0);
}
default:
return EINVAL;
}
args->arg = 0;
return ioctl(p, (struct ioctl_args *)args);
case LINUX_TCFLSH:
args->cmd = TIOCFLUSH;
switch (args->arg) {