summaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-08-22 19:10:52 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-08-22 19:10:52 +0000
commit4062fb2fcf938bb6a9c5d8f6404586cab11fe227 (patch)
tree698256c7c29a4d23410c0292ba7971af10af8774 /console
parenta0dd4055ce2b0d7cce5ccb5d9dad7a62bd83a8dc (diff)
2002-08-22 Marcus Brinkmann <marcus@gnu.org>
* display.h: Add prototype for display_get_size. * display.c (display_get_size): New function. (nowait_file_changed): Update for new interfaces. * console.c (new_node): Use display_get_size to retrieve size of display node. (netfs_get_dirents): Initialize FIRST_VCONS to silence gcc warning.
Diffstat (limited to 'console')
-rw-r--r--console/ChangeLog9
-rw-r--r--console/console.c6
-rw-r--r--console/display.c26
-rw-r--r--console/display.h3
4 files changed, 33 insertions, 11 deletions
diff --git a/console/ChangeLog b/console/ChangeLog
index 9ea01606..146451b2 100644
--- a/console/ChangeLog
+++ b/console/ChangeLog
@@ -1,3 +1,12 @@
+2002-08-22 Marcus Brinkmann <marcus@gnu.org>
+
+ * display.h: Add prototype for display_get_size.
+ * display.c (display_get_size): New function.
+ (nowait_file_changed): Update for new interfaces.
+ * console.c (new_node): Use display_get_size to retrieve size of
+ display node.
+ (netfs_get_dirents): Initialize FIRST_VCONS to silence gcc warning.
+
2002-07-15 Marcus Brinkmann <marcus@gnu.org>
* display.c: Restore copyright notice until the papers by Kalle
diff --git a/console/console.c b/console/console.c
index d25a3cf3..b493f64e 100644
--- a/console/console.c
+++ b/console/console.c
@@ -357,8 +357,7 @@ new_node (struct node **np, vcons_t vcons, vcons_node_type type)
(*np)->nn_stat.st_ino = (vcons->id << 2) + 2;
(*np)->nn_stat.st_mode |= S_IFREG;
(*np)->nn_stat.st_mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
- (*np)->nn_stat.st_size = 80*50 * (sizeof (wchar_t) + 4)
- + 16 * 4 + 512 * 8; /* XXX */
+ (*np)->nn_stat.st_size = display_get_size (vcons->display);
break;
case VCONS_NODE_INPUT:
(*np)->nn_stat.st_ino = (vcons->id << 2) + 3;
@@ -728,7 +727,8 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
error_t err;
int count = 0;
size_t size = 0; /* Total size of our return block. */
- struct vcons *first_vcons, *vcons;
+ struct vcons *first_vcons = NULL;
+ struct vcons *vcons;
/* Add the length of a directory entry for NAME to SIZE and return true,
unless it would overflow MAX_DATA_LEN or NUM_ENTRIES, in which case
diff --git a/console/display.c b/console/display.c
index 393034de..fb0a6b0f 100644
--- a/console/display.c
+++ b/console/display.c
@@ -304,9 +304,9 @@ nowait_file_changed (mach_port_t notify_port, natural_t tickno,
mach_msg_type_t changeType;
file_changed_type_t change;
mach_msg_type_t startType;
- off_t start;
+ loff_t start;
mach_msg_type_t endType;
- off_t end;
+ loff_t end;
} Request;
union
{
@@ -335,8 +335,8 @@ nowait_file_changed (mach_port_t notify_port, natural_t tickno,
};
static const mach_msg_type_t startType = {
- /* msgt_name = */ 2,
- /* msgt_size = */ 32,
+ /* msgt_name = */ 11,
+ /* msgt_size = */ 64,
/* msgt_number = */ 1,
/* msgt_inline = */ TRUE,
/* msgt_longform = */ FALSE,
@@ -345,8 +345,8 @@ nowait_file_changed (mach_port_t notify_port, natural_t tickno,
};
static const mach_msg_type_t endType = {
- /* msgt_name = */ 2,
- /* msgt_size = */ 32,
+ /* msgt_name = */ 11,
+ /* msgt_size = */ 64,
/* msgt_number = */ 1,
/* msgt_inline = */ TRUE,
/* msgt_longform = */ FALSE,
@@ -372,11 +372,11 @@ nowait_file_changed (mach_port_t notify_port, natural_t tickno,
if (notify == MACH_PORT_NULL)
return mach_msg (&InP->Head, MACH_SEND_MSG | MACH_MSG_OPTION_NONE,
- 56, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
+ 64, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
MACH_PORT_NULL);
else
return mach_msg (&InP->Head, MACH_SEND_MSG | MACH_SEND_NOTIFY,
- 56, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
+ 64, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
notify);
}
@@ -1752,6 +1752,16 @@ display_destroy_complete (void *pi)
}
+/* Return the dimension of the display in bytes. */
+off_t
+display_get_size (display_t display)
+{
+ return sizeof (struct cons_display)
+ + (sizeof (conchar_t) * display->user->screen.width
+ * display->user->screen.lines);
+}
+
+
/* Return the dimensions of the display DISPLAY in *WINSIZE. */
void
display_getsize (display_t display, struct winsize *winsize)
diff --git a/console/display.h b/console/display.h
index 4f9b7586..26430cd3 100644
--- a/console/display.h
+++ b/console/display.h
@@ -36,6 +36,9 @@ error_t display_create (display_t *r_display, const char *encoding,
/* Destroy the display DISPLAY. */
void display_destroy (display_t display);
+/* Return the dimension of the display in bytes. */
+off_t display_get_size (display_t display);
+
/* Return the dimensions of the display DISPLAY in *WINSIZE. */
void display_getsize (display_t display, struct winsize *winsize);