291 |
|
|
292 |
/* SimpleRoutine file_changed */ |
/* SimpleRoutine file_changed */ |
293 |
kern_return_t |
kern_return_t |
294 |
nowait_file_changed (mach_port_t notify_port, file_changed_type_t change, |
nowait_file_changed (mach_port_t notify_port, natural_t tickno, |
295 |
|
file_changed_type_t change, |
296 |
off_t start, off_t end, mach_port_t notify) |
off_t start, off_t end, mach_port_t notify) |
297 |
{ |
{ |
298 |
typedef struct |
typedef struct |
299 |
{ |
{ |
300 |
mach_msg_header_t Head; |
mach_msg_header_t Head; |
301 |
|
mach_msg_type_t ticknoType; |
302 |
|
natural_t tickno; |
303 |
mach_msg_type_t changeType; |
mach_msg_type_t changeType; |
304 |
file_changed_type_t change; |
file_changed_type_t change; |
305 |
mach_msg_type_t startType; |
mach_msg_type_t startType; |
312 |
Request In; |
Request In; |
313 |
} Mess; |
} Mess; |
314 |
register Request *InP = &Mess.In; |
register Request *InP = &Mess.In; |
315 |
|
|
316 |
|
static const mach_msg_type_t ticknoType = { |
317 |
|
/* msgt_name = */ 2, |
318 |
|
/* msgt_size = */ 32, |
319 |
|
/* msgt_number = */ 1, |
320 |
|
/* msgt_inline = */ TRUE, |
321 |
|
/* msgt_longform = */ FALSE, |
322 |
|
/* msgt_deallocate = */ FALSE, |
323 |
|
/* msgt_unused = */ 0 |
324 |
|
}; |
325 |
|
|
326 |
static const mach_msg_type_t changeType = { |
static const mach_msg_type_t changeType = { |
327 |
/* msgt_name = */ 2, |
/* msgt_name = */ 2, |
328 |
/* msgt_size = */ 32, |
/* msgt_size = */ 32, |
353 |
/* msgt_unused = */ 0 |
/* msgt_unused = */ 0 |
354 |
}; |
}; |
355 |
|
|
356 |
|
InP->ticknoType = ticknoType; |
357 |
|
InP->tickno = tickno; |
358 |
InP->changeType = changeType; |
InP->changeType = changeType; |
359 |
InP->change = change; |
InP->change = change; |
360 |
InP->startType = startType; |
InP->startType = startType; |
371 |
|
|
372 |
if (notify == MACH_PORT_NULL) |
if (notify == MACH_PORT_NULL) |
373 |
return mach_msg (&InP->Head, MACH_SEND_MSG | MACH_MSG_OPTION_NONE, |
return mach_msg (&InP->Head, MACH_SEND_MSG | MACH_MSG_OPTION_NONE, |
374 |
48, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, |
56, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, |
375 |
MACH_PORT_NULL); |
MACH_PORT_NULL); |
376 |
else |
else |
377 |
return mach_msg (&InP->Head, MACH_SEND_MSG | MACH_SEND_NOTIFY, |
return mach_msg (&InP->Head, MACH_SEND_MSG | MACH_SEND_NOTIFY, |
378 |
48, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, |
56, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, |
379 |
notify); |
notify); |
380 |
} |
} |
381 |
|
|
450 |
/* A request was desired while we were blocking. Send it now |
/* A request was desired while we were blocking. Send it now |
451 |
and stay in pending queue. */ |
and stay in pending queue. */ |
452 |
req->pending = 0; |
req->pending = 0; |
453 |
err = nowait_file_changed (req->port, FILE_CHANGED_WRITE, -1, -1, |
err = nowait_file_changed (req->port, 0, FILE_CHANGED_WRITE, -1, -1, |
454 |
notify); |
notify); |
455 |
if (err && err != MACH_SEND_WILL_NOTIFY) |
if (err && err != MACH_SEND_WILL_NOTIFY) |
456 |
{ |
{ |
499 |
struct modreq *req; |
struct modreq *req; |
500 |
|
|
501 |
mutex_lock (&display->lock); |
mutex_lock (&display->lock); |
502 |
err = nowait_file_changed (notify, FILE_CHANGED_NULL, 0, 0, MACH_PORT_NULL); |
err = nowait_file_changed (notify, 0, FILE_CHANGED_NULL, 0, 0, MACH_PORT_NULL); |
503 |
if (err) |
if (err) |
504 |
{ |
{ |
505 |
mutex_unlock (&display->lock); |
mutex_unlock (&display->lock); |
538 |
{ |
{ |
539 |
req = *preq; |
req = *preq; |
540 |
|
|
541 |
err = nowait_file_changed (req->port, FILE_CHANGED_WRITE, -1, -1, |
err = nowait_file_changed (req->port, 0, FILE_CHANGED_WRITE, -1, -1, |
542 |
notify_port); |
notify_port); |
543 |
if (err) |
if (err) |
544 |
{ |
{ |