/[hurd]/hurd/console/console.c
ViewVC logotype

Diff of /hurd/console/console.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by marcus, Wed Jun 12 14:38:39 2002 UTC revision 1.10 by marcus, Thu Jun 13 00:24:26 2002 UTC
# Line 52  volatile struct mapped_time_value *conso Line 52  volatile struct mapped_time_value *conso
52  #define DEFAULT_ENCODING "ISO-8859-1"  #define DEFAULT_ENCODING "ISO-8859-1"
53    
54    
55    /* A handle for a console device.  */
56    typedef struct cons *cons_t;
57    
58    /* A handle for a virtual console device.  */
59    typedef struct vcons *vcons_t;
60    
61  struct vcons  struct vcons
62  {  {
63    /* Protected by cons->lock.  */    /* Protected by cons->lock.  */
# Line 75  struct vcons Line 81  struct vcons
81    struct node *disp_node;    struct node *disp_node;
82    struct node *inpt_node;    struct node *inpt_node;
83  };  };
 /* A handle for a virtual console device.  */  
 typedef struct vcons *vcons_t;  
84    
85  struct cons  struct cons
86  {  {
# Line 93  struct cons Line 97  struct cons
97    /* A template for the stat information of all nodes.  */    /* A template for the stat information of all nodes.  */
98    struct stat stat_template;    struct stat stat_template;
99  };  };
 /* A handle for a console device.  */  
 typedef struct cons *cons_t;  
100    
101    
102  /* Lookup the virtual console with number ID in the console CONS,  /* Lookup the virtual console with number ID in the console CONS,
# Line 1051  netfs_attempt_read (struct iouser *cred, Line 1053  netfs_attempt_read (struct iouser *cred,
1053        ssize_t amt = *len;        ssize_t amt = *len;
1054        assert (np == vcons->disp_node);        assert (np == vcons->disp_node);
1055    
1056        if (amt > np->nn_stat.st_size)        if (offset + amt > np->nn_stat.st_size)
1057          amt = np->nn_stat.st_size;          amt = np->nn_stat.st_size - offset;
1058        amt = display_read (vcons->display,        if (amt < 0)
1059                            /* cred->po->openstat & O_NONBLOCK */ 0,          amt = 0;
1060                            offset, data, amt);        else
1061            amt = display_read (vcons->display,
1062                                /* cred->po->openstat & O_NONBLOCK */ 0,
1063                                offset, data, amt);
1064        if (amt == -1)        if (amt == -1)
1065          err = errno;          err = errno;
1066        else        else
# Line 1166  netfs_S_io_map (struct protid *cred, Line 1171  netfs_S_io_map (struct protid *cred,
1171  }  }
1172    
1173    
1174    kern_return_t
1175    netfs_S_file_notice_changes (struct protid *cred, mach_port_t notify)
1176    {
1177      struct node *np;
1178      vcons_t vcons;
1179    
1180      if (!cred)
1181        return EOPNOTSUPP;
1182    
1183      np = cred->po->np;
1184      vcons = np->nn->vcons;
1185      if (!vcons || np != vcons->disp_node)
1186        return EOPNOTSUPP;
1187    
1188      return display_notice_changes (vcons->display, notify);
1189    }
1190    
1191    
1192  static const struct argp_option options[] =  static const struct argp_option options[] =
1193  {  {
1194    {"encoding",  'e', "NAME", 0, "Set encoding of virtual consoles to"    {"encoding",  'e', "NAME", 0, "Set encoding of virtual consoles to"

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26