-int generic_window_size(int fd, void *unused, unsigned short *rows_out,
- unsigned short *cols_out)
-{
- struct winsize size;
- int ret = 0;
-
- if(ioctl(fd, TIOCGWINSZ, &size) == 0){
- ret = ((*rows_out != size.ws_row) ||
- (*cols_out != size.ws_col));
- *rows_out = size.ws_row;
- *cols_out = size.ws_col;
- }
- return(ret);
-}
-
-void generic_free(void *data)
-{
- kfree(data);
-}
+/*
+ * UML SIGWINCH handling
+ *
+ * The point of this is to handle SIGWINCH on consoles which have host ttys and
+ * relay them inside UML to whatever might be running on the console and cares
+ * about the window size (since SIGWINCH notifies about terminal size changes).
+ *
+ * So, we have a separate thread for each host tty attached to a UML device
+ * (side-issue - I'm annoyed that one thread can't have multiple controlling
+ * ttys for purposed of handling SIGWINCH, but I imagine there are other reasons
+ * that doesn't make any sense).
+ *
+ * SIGWINCH can't be received synchronously, so you have to set up to receive it
+ * as a signal. That being the case, if you are going to wait for it, it is
+ * convenient to sit in sigsuspend() and wait for the signal to bounce you out of
+ * it (see below for how we make sure to exit only on SIGWINCH).
+ */