203 |
error_t |
error_t |
204 |
trivfs_S_io_read (struct trivfs_protid *cred, |
trivfs_S_io_read (struct trivfs_protid *cred, |
205 |
mach_port_t reply, mach_msg_type_name_t reply_type, |
mach_port_t reply, mach_msg_type_name_t reply_type, |
206 |
vm_address_t *data, mach_msg_type_number_t *data_len, |
char **data, mach_msg_type_number_t *data_len, |
207 |
off_t offs, mach_msg_type_number_t amount) |
loff_t offs, mach_msg_type_number_t amount) |
208 |
{ |
{ |
209 |
error_t err = 0; |
error_t err = 0; |
210 |
|
|
221 |
if (start + amount > max) |
if (start + amount > max) |
222 |
amount = max - start; |
amount = max - start; |
223 |
if (amount > *data_len) |
if (amount > *data_len) |
224 |
*data = (vm_address_t) mmap (0, amount, PROT_READ|PROT_WRITE, |
*data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); |
225 |
MAP_ANON, 0, 0); |
err = (*data == MAP_FAILED) ? errno : 0; |
|
err = (*data == -1) ? errno : 0; |
|
226 |
if (!err && amount > 0) |
if (!err && amount > 0) |
227 |
{ |
{ |
228 |
memcpy ((char *)(*data + start), target, amount); |
memcpy ((char *)(*data + start), target, amount); |
271 |
error_t |
error_t |
272 |
trivfs_S_io_select (struct trivfs_protid *cred, |
trivfs_S_io_select (struct trivfs_protid *cred, |
273 |
mach_port_t reply, mach_msg_type_name_t reply_type, |
mach_port_t reply, mach_msg_type_name_t reply_type, |
274 |
int *type, int *tag) |
int *type) |
275 |
{ |
{ |
276 |
return EOPNOTSUPP; |
return EOPNOTSUPP; |
277 |
} |
} |