-
Notifications
You must be signed in to change notification settings - Fork 3
/
UPosixIPC.java
executable file
·189 lines (186 loc) · 7.25 KB
/
UPosixIPC.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package jtux;
public class UPosixIPC {
/*
Not sure yet where this should be.
*/
static {
System.loadLibrary("jtux");
System.out.println("Loaded jtux OK.");
}
/**
Java version of C struct mq_attr.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#struct_mq_attr">here</a>} for Posix/SUS C API.</i></b></font>
*/
static public class s_mq_attr {
public long mq_flags; // flags
public long mq_maxmsg; // max number of messages
public long mq_msgsize; // max message size
public long mq_curmsgs; // number of messages currently queued
}
/**
Calls mmap.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mmap">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static long mmap(long addr, int len, int prot, int flags, int fd, long off) throws UErrorException;
/**
Calls mq_close.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_close">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_close(long mqd) throws UErrorException;
/**
Calls mq_getattr.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_getattr">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_getattr(long mqd, s_mq_attr attr) throws UErrorException;
/**
Calls mq_notify.
<p>
SIGEV_THREAD not supported. Almost works for SIGEV_SIGNAL, but JNI code for
signal handler is unable to find some classes it needs (on Solaris and Java 1.3,
anyway).
Calls mq_notify.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_notify">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_notify(long mqd, UProcess.s_sigevent ep) throws UErrorException;
/**
Calls mq_open.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_open">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static long mq_open(String name, int flags) throws UErrorException;
/**
Calls mq_open.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_open">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static long mq_open(String name, int flags, int perms, s_mq_attr attr) throws UErrorException;
/**
Calls mq_receive.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_receive">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static int mq_receive(long mqd, byte[] msg, int msgsize,
UUtil.IntHolder priority) throws UErrorException;
/**
Calls mq_send.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_send">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_send(long mqd, byte[] msg, int msgsize,
int priority) throws UErrorException;
/**
Calls mq_setattr.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_setattr">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_setattr(long mqd, s_mq_attr attr, s_mq_attr oattr) throws UErrorException;
/**
Calls mq_timedreceive.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_timedreceive">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static int mq_timedreceive(long mqd, byte[] msg, int msgsize,
UUtil.IntHolder priority, UProcess.s_timespec tmout) throws UErrorException;
/**
Calls mq_timedsend.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_timedsend">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_timedsend(long mqd, byte[] msg, int msgsize,
int priority, UProcess.s_timespec tmout) throws UErrorException;
/**
Calls mq_unlink.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#mq_unlink">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void mq_unlink(String name) throws UErrorException;
/**
Calls munmap.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#munmap">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void munmap(long addr, int len) throws UErrorException;
/**
Calls sem_close.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_close">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_close(long sem) throws UErrorException;
/**
Calls sem_destroy.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_destroy">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_destroy(long sem) throws UErrorException;
/**
Calls sem_getvalue.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_getvalue">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_getvalue(long sem, UUtil.IntHolder valuep) throws UErrorException;
/**
Calls sem_init.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_init">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_init(long sem, int pshared, int value) throws UErrorException;
/**
Calls sem_open.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_open">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static long sem_open(String name, int flags) throws UErrorException;
/**
Calls sem_open.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_open">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static long sem_open(String name, int flags, int perms, int value) throws UErrorException;
/**
Calls sem_post.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_post">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_post(long sem) throws UErrorException;
/**
Calls sem_timedwait.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_timedwait">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_timedwait(long sem, UProcess.s_timespec time) throws UErrorException;
/**
Calls sem_trywait.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_trywait">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_trywait(long sem) throws UErrorException;
/**
Calls sem_unlink.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_unlink">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_unlink(String name) throws UErrorException;
/**
Calls sem_wait.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#sem_wait">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void sem_wait(long sem) throws UErrorException;
/**
Calls shm_open.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#shm_open">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static int shm_open(String name, int flags, int perms) throws UErrorException;
/**
Calls shm_unlink.
<p>
<font size="-1"><b><i>Click {@link <a href="doc-files/synopses.html#shm_unlink">here</a>} for Posix/SUS C API.</i></b></font>
*/
public native static void shm_unlink(String name) throws UErrorException;
}