TIOCSCTTY not implemented in linuxulator?

2002-09-03 Thread Duncan Barclay

Hi

Does anyone know why TIOCSCTTY isn't implemented in compat/linux_ioctl.c?
The last change in this area was back in 1999 when the ioctl handling was
revamped, but this ioctl was not implemented. Do controlling terminals
work okay in the linuxulator?

Implementing this might solve a problem with Matlab, where it refuses to exit.
Matlab issues calls to two unimplemented ioctls on the tty side of a pty/tty
pair.

linux: 'ioctl' fd=4, cmd=0x1 ('',1) not implemented
linux: 'ioctl' fd=4, cmd=0x1 ('',1) not implemented
linux: 'ioctl' fd=4, cmd=0x540e ('T',14) not implemented

0x540e is TIOCSCTTY, and according to /compat/linux/usr/include/asm/ioctls.h
0x1 is TIOCSER_TEMT (Transmitter physically empty)?

I'm using
4.6-PRERELEASE
linux_base-6.1_1
linux_devtools-6.1
linux_kdump-1.4

Thanks

Duncan

-- 

Duncan Barclay  | God smiles upon the little children,
[EMAIL PROTECTED]   | the alcoholics, and the permanently stoned.
[EMAIL PROTECTED]| Steven King

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: TIOCSCTTY

2001-07-03 Thread Kazutaka YOKOTA


 It sounds like moused needs to be fixed to drop its control terminal.
 
But the daemon(3) performs this function, and forked moused(8) runs
without the controlling tty.

Further investigation shows, that after running and killing this small
program (from /etc/rc.local), I can't get a functional moused(8).
It runs OK, and when with -f and -d shows mouse events, but does not
show mouse cursor, etc.

No error message logged by moused(8)?  Very weired, indeed.

Kazu

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



tangled dev_t, struct tty and screen in syscons (was: Re: TIOCSCTTY)

2001-07-03 Thread Kazutaka YOKOTA

JFYI, 

In i386, /dev/console is the same as /dev/consolectl, and all I/O
operations for /dev/console, /dev/concolectl and /dev/ttyv0 take place
in the screen #0, as shown below.  In alpha /dev/console is /dev/ttyv0.
Access to /dev/console is routed to /dev/consolectl's dev_t by
cdevsw functions in kern/tty_cons.c.  

When syscons is not acting as the system/kernel console, /dev/console
is not connected to /dev/console or /dev/ttyv0. But /dev/consolectl
still exists.

  /dev/console /dev/consolectl/dev/ttyv0/dev/ttyvN
  |  || |
  V  || |
dev_t|| |
  |  VV V
  +---dev_tdev_t dev_t
 || |
 VV V
struct tty   struct ttystruct tty
 || |
 +---| |
  | |
  V V
  screen #0 screen #N


As /dev/consolectl doesn't need to get input from or put output to the
screen, it can exist without an associated screen. In that sense, it
perhaps doesn't even need a struct tty.  Maybe we also should give
/dev/console a separate a screen than ttyv0.  See the figure below.

But, even in this configuration, we still have two copies of dev_t for
/dev/console: the native dev_t (*1) and the underlaying dev_t (*2).
As make_dev(9) requires us to supply the name to create a dev_t, dev_t
(*2) will appear under /dev and will be accessible from the user land,
thus, we still have the last close() problem, I guess.

  /dev/console /dev/consolectl/dev/ttyv0/dev/ttyvN
  ||  | |
  V|  | |
dev_t  |  | |
  | *1 |  | |
  +---+|  | |
  ||  | |
  VV  V V
dev_tdev_t  dev_t dev_t
  | *2 |  | |
  VV  V V
 struct tty   (struct tty)   struct ttystruct tty
  |   | |
  +------| |
  |   | |
 ???  | |
  |   | |
  V   V V
  screen #X   screen #0 screen #N


Kazu

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



TIOCSCTTY

2001-07-02 Thread Ruslan Ermilov

Hi!

Could someone please explain why the following code snippet
does not work anymore with the /dev/console argument?

# ./tiocsctty /dev/console
tiocsctty: ioctl(/dev/console, TIOCSCTTY): Operation not permitted


Thanks,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


#include sys/ioctl.h
#include err.h
#include fcntl.h
#include stdio.h
#include stdlib.h

int
main(int argc, char *argv[])
{
int fd;

if (argc != 2)
errx(1, missing argument);
if ((fd = open(argv[1], O_RDWR)) == -1)
err(1, open %s, argv[1]);
if (daemon(1, 1) == -1)
err(1, daemon);
if (ioctl(fd, TIOCSCTTY) == -1)
err(1, ioctl(%s, TIOCSCTTY), argv[1]);

exit(0);
}



Re: TIOCSCTTY

2001-07-02 Thread Alfred Perlstein

* Ruslan Ermilov [EMAIL PROTECTED] [010702 10:51] wrote:
 Hi!
 
 Could someone please explain why the following code snippet
 does not work anymore with the /dev/console argument?
 
 # ./tiocsctty /dev/console
 tiocsctty: ioctl(/dev/console, TIOCSCTTY): Operation not permitted

I think LINT has an option to allow this.  The reason, I think, is
that you don't want non-root users to be able to grab the console
output as it may allow them to obscure evil behavior. :)

-- 
-Alfred Perlstein [[EMAIL PROTECTED]]
Ok, who wrote this damn function called '??'?
And why do my programs keep crashing in it?

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message