21 |
#include <hurd.h> |
#include <hurd.h> |
22 |
#include <fcntl.h> |
#include <fcntl.h> |
23 |
#include <hurd/trivfs.h> |
#include <hurd/trivfs.h> |
24 |
|
#include <hurd/fsys.h> |
25 |
#include <stdio.h> |
#include <stdio.h> |
26 |
#include <argp.h> |
#include <argp.h> |
27 |
#include <hurd/fsys.h> |
#include <error.h> |
28 |
#include <string.h> |
#include <string.h> |
29 |
|
|
30 |
#include <version.h> |
#include <version.h> |
46 |
int trivfs_allow_open = O_READ|O_WRITE; |
int trivfs_allow_open = O_READ|O_WRITE; |
47 |
|
|
48 |
/* Properties of the underlying node. */ |
/* Properties of the underlying node. */ |
49 |
int console_mode; |
mode_t console_mode; |
50 |
int console_owner; |
uid_t console_owner; |
51 |
int console_group; |
gid_t console_group; |
52 |
|
|
53 |
/* The argument line options. */ |
/* The argument line options. */ |
54 |
struct |
struct |
126 |
struct stat st; |
struct stat st; |
127 |
|
|
128 |
argp_parse (&main_argp, argc, argv, 0, 0, 0); |
argp_parse (&main_argp, argc, argv, 0, 0, 0); |
129 |
|
|
130 |
task_get_bootstrap_port (mach_task_self (), &bootstrap); |
task_get_bootstrap_port (mach_task_self (), &bootstrap); |
131 |
if (bootstrap == MACH_PORT_NULL) |
if (bootstrap == MACH_PORT_NULL) |
132 |
{ |
{ |
138 |
err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0, &fsys); |
err = trivfs_startup (bootstrap, 0, 0, 0, 0, 0, &fsys); |
139 |
mach_port_deallocate (mach_task_self (), bootstrap); |
mach_port_deallocate (mach_task_self (), bootstrap); |
140 |
if (err) |
if (err) |
141 |
{ |
error (1, err, "Starting translator"); |
|
perror ("Starting translator"); |
|
|
exit (1); |
|
|
} |
|
142 |
|
|
143 |
/* Initialize status from underlying node. */ |
/* Initialize status from underlying node. */ |
144 |
err = io_stat (fsys->underlying, &st); |
err = io_stat (fsys->underlying, &st); |
162 |
0, 0, 0); |
0, 0, 0); |
163 |
|
|
164 |
return 0; |
return 0; |
165 |
} |
} |
|
|
|
166 |
|
|
167 |
kern_return_t |
kern_return_t |
168 |
S_tioctl_tiocflush (struct trivfs_protid *cred, int queue_selector) |
S_tioctl_tiocflush (struct trivfs_protid *cred, int queue_selector) |
180 |
|
|
181 |
if (queue_selector & O_READ) |
if (queue_selector & O_READ) |
182 |
vcons_flush_input (vcons); |
vcons_flush_input (vcons); |
183 |
if (queue_selector & O_WRITE) |
if (queue_selector & O_WRITE) |
184 |
vcons_discard_output (vcons); |
vcons_discard_output (vcons); |
185 |
|
|
186 |
return 0; |
return 0; |