-/*
- * Pass back c to the user at his location u_base;
- * update u_base, u_count, and u_offset. Return -1
- * on the last character of the user's read.
- * u_base is in the user address space unless u_segflg is set.
- */
-passc(c)
-register c;
-{
- register id;
-
- if ((id = u.u_segflg) == 1)
- *u.u_base = c;
- else
- if (id?suibyte(u.u_base, c):subyte(u.u_base, c) < 0) {
- u.u_error = EFAULT;
- return (-1);
- }
- u.u_count--;
- u.u_offset++;
- u.u_base++;
- return (u.u_count == 0? -1: 0);
-}
-
-#include "ct.h"
-#if NCT > 0
-/*
- * Pick up and return the next character from the user's
- * write call at location u_base;
- * update u_base, u_count, and u_offset. Return -1
- * when u_count is exhausted. u_base is in the user's
- * address space unless u_segflg is set.
- */
-cpass()
-{
- register c, id;
-
- if (u.u_count == 0)
- return (-1);
- if ((id = u.u_segflg) == 1)
- c = *u.u_base;
- else
- if ((c = id==0?fubyte(u.u_base):fuibyte(u.u_base)) < 0) {
- u.u_error = EFAULT;
- return (-1);
- }
- u.u_count--;
- u.u_offset++;
- u.u_base++;
- return (c&0377);
-}
-#endif
-