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. */ |
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 |
{ |
{ |
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, |
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 |
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" |