1 |
/* Demuxer for pager library |
/* Demuxer for pager library |
2 |
Copyright (C) 1994, 1995 Free Software Foundation |
Copyright (C) 1994, 1995, 2002 Free Software Foundation |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
5 |
modify it under the terms of the GNU General Public License as |
modify it under the terms of the GNU General Public License as |
20 |
#include "notify_S.h" |
#include "notify_S.h" |
21 |
|
|
22 |
/* Demultiplex a single message directed at a pager port; INP is the |
/* Demultiplex a single message directed at a pager port; INP is the |
23 |
message received; fille OUTP with the reply. */ |
message received; fill OUTP with the reply. */ |
24 |
int |
int |
25 |
pager_demuxer (mach_msg_header_t *inp, |
pager_demuxer (mach_msg_header_t *inp, |
26 |
mach_msg_header_t *outp) |
mach_msg_header_t *outp) |
30 |
extern int _pager_seqnos_notify_server (mach_msg_header_t *inp, |
extern int _pager_seqnos_notify_server (mach_msg_header_t *inp, |
31 |
mach_msg_header_t *outp); |
mach_msg_header_t *outp); |
32 |
|
|
33 |
return (_pager_seqnos_memory_object_server (inp, outp) |
int result = _pager_seqnos_memory_object_server (inp, outp) |
34 |
|| _pager_seqnos_notify_server (inp, outp)); |
|| _pager_seqnos_notify_server (inp, outp); |
35 |
|
if (!result) |
36 |
|
{ |
37 |
|
struct pager *p; |
38 |
|
|
39 |
|
p = ports_lookup_port (0, inp->msgh_remote_port, _pager_class); |
40 |
|
if (p) |
41 |
|
{ |
42 |
|
mutex_lock (&p->interlock); |
43 |
|
_pager_wait_for_seqno (p, seqno); |
44 |
|
_pager_release_seqno (p, seqno); |
45 |
|
mutex_unlock (&p->interlock); |
46 |
|
ports_port_deref (p); |
47 |
|
} |
48 |
|
} |
49 |
|
return result; |
50 |
} |
} |
51 |
|
|
52 |
|
|
53 |
|
|