blob: b587f0b7a5dc6632105afce563b9c65135fdce9c [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25#ifndef _JAVASOFT_SYSSHMEM_H
26
27#include <jni.h>
28#include "sys.h"
29#include "shmem_md.h"
30
31int sysSharedMemCreate(const char *name, int length, sys_shmem_t *, void **buffer);
32int sysSharedMemOpen(const char *name, sys_shmem_t *, void **buffer);
33int sysSharedMemClose(sys_shmem_t, void *buffer);
34
35/* Mutexes that can be used for inter-process communication */
36int sysIPMutexCreate(const char *name, sys_ipmutex_t *mutex);
37int sysIPMutexOpen(const char *name, sys_ipmutex_t *mutex);
38int sysIPMutexEnter(sys_ipmutex_t mutex, sys_event_t event);
39int sysIPMutexExit(sys_ipmutex_t mutex);
40int sysIPMutexClose(sys_ipmutex_t mutex);
41
42/* Inter-process events */
43int sysEventCreate(const char *name, sys_event_t *event, jboolean manualreset);
44int sysEventOpen(const char *name, sys_event_t *event);
45int sysEventWait(sys_process_t otherProcess, sys_event_t event, long timeout);
46int sysEventSignal(sys_event_t event);
47int sysEventClose(sys_event_t event);
48
49jlong sysProcessGetID();
50int sysProcessOpen(jlong processID, sys_process_t *process);
51int sysProcessClose(sys_process_t *process);
52
53/* access to errno or equivalent */
54int sysGetLastError(char *buf, int size);
55
56/* access to thread-local storage */
57int sysTlsAlloc();
58void sysTlsFree(int index);
59void sysTlsPut(int index, void *value);
60void *sysTlsGet(int index);
61
62/* misc. functions */
63void sysSleep(long duration);
64
65#endif