Exemple #1
0
/**
 * 终端读写操作(同rw_ttyx,增加了对进程是否有控制终端的检测)
 * @param[in]	rw		读写命令
 * @param[in]	minor	终端子设备号
 * @param[in]	buf		缓冲区
 * @param[in]	count	读写字节数
 * @param[in]	pos		读写操作当前指针(对于终端操作,该指针无用)
 * @retval		实际读写的字节数.若失败则返回出错码
 */
static int rw_tty(int rw,unsigned minor,char * buf,int count, off_t * pos)
{
	if (current->tty < 0) {
		return -EPERM;
	}
	return rw_ttyx(rw, current->tty, buf, count, pos);
}
Exemple #2
0
static int rw_tty(int rw,unsigned minor,char * buf,int count)
{
    if (current->tty<0)
	return -EPERM;
    return rw_ttyx(rw,current->tty,buf,count);
}