lwp.h revision 2a12f85ad140e332791b4bad1208a734c3f26bf3
4b22b9337f359bfd063322244f5336cc7c6ffcfars/*
4b22b9337f359bfd063322244f5336cc7c6ffcfars * CDDL HEADER START
4b22b9337f359bfd063322244f5336cc7c6ffcfars *
4b22b9337f359bfd063322244f5336cc7c6ffcfars * The contents of this file are subject to the terms of the
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Common Development and Distribution License (the "License").
4b22b9337f359bfd063322244f5336cc7c6ffcfars * You may not use this file except in compliance with the License.
4b22b9337f359bfd063322244f5336cc7c6ffcfars *
4b22b9337f359bfd063322244f5336cc7c6ffcfars * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4b22b9337f359bfd063322244f5336cc7c6ffcfars * or http://www.opensolaris.org/os/licensing.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * See the License for the specific language governing permissions
4b22b9337f359bfd063322244f5336cc7c6ffcfars * and limitations under the License.
4b22b9337f359bfd063322244f5336cc7c6ffcfars *
4b22b9337f359bfd063322244f5336cc7c6ffcfars * When distributing Covered Code, include this CDDL HEADER in each
4b22b9337f359bfd063322244f5336cc7c6ffcfars * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * If applicable, add the following below this CDDL HEADER, with the
4b22b9337f359bfd063322244f5336cc7c6ffcfars * fields enclosed by brackets "[]" replaced with your own identifying
4b22b9337f359bfd063322244f5336cc7c6ffcfars * information: Portions Copyright [yyyy] [name of copyright owner]
4b22b9337f359bfd063322244f5336cc7c6ffcfars *
4b22b9337f359bfd063322244f5336cc7c6ffcfars * CDDL HEADER END
4b22b9337f359bfd063322244f5336cc7c6ffcfars */
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars/*
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Use is subject to license terms.
4b22b9337f359bfd063322244f5336cc7c6ffcfars */
4b22b9337f359bfd063322244f5336cc7c6ffcfars/*
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Copyright (c) 2013 by Delphix. All rights reserved.
4b22b9337f359bfd063322244f5336cc7c6ffcfars */
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars#ifndef _SYS_LWP_H
4b22b9337f359bfd063322244f5336cc7c6ffcfars#define _SYS_LWP_H
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars#include <sys/synch.h>
4b22b9337f359bfd063322244f5336cc7c6ffcfars#include <sys/ucontext.h>
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars#ifdef __cplusplus
4b22b9337f359bfd063322244f5336cc7c6ffcfarsextern "C" {
4b22b9337f359bfd063322244f5336cc7c6ffcfars#endif
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars/*
4b22b9337f359bfd063322244f5336cc7c6ffcfars * lwp create flags
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross */
4b22b9337f359bfd063322244f5336cc7c6ffcfars#define LWP_DAEMON 0x00000020
4b22b9337f359bfd063322244f5336cc7c6ffcfars#define LWP_DETACHED 0x00000040
4b22b9337f359bfd063322244f5336cc7c6ffcfars#define LWP_SUSPENDED 0x00000080
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars/*
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Definitions for user programs calling into the _lwp interface.
4b22b9337f359bfd063322244f5336cc7c6ffcfars */
4b22b9337f359bfd063322244f5336cc7c6ffcfarsstruct lwpinfo {
4b22b9337f359bfd063322244f5336cc7c6ffcfars timestruc_t lwp_utime;
4b22b9337f359bfd063322244f5336cc7c6ffcfars timestruc_t lwp_stime;
4b22b9337f359bfd063322244f5336cc7c6ffcfars long lwpinfo_pad[64];
4b22b9337f359bfd063322244f5336cc7c6ffcfars};
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars#if defined(_SYSCALL32)
4b22b9337f359bfd063322244f5336cc7c6ffcfars
4b22b9337f359bfd063322244f5336cc7c6ffcfars/* Kernel's view of user ILP32 lwpinfo structure */
struct lwpinfo32 {
timestruc32_t lwp_utime;
timestruc32_t lwp_stime;
int32_t lwpinfo_pad[64];
};
#endif /* _SYSCALL32 */
typedef uint_t lwpid_t;
#define _LWP_FSBASE 0
#define _LWP_GSBASE 1
#define _LWP_SETPRIVATE 0
#define _LWP_GETPRIVATE 1
#ifndef _KERNEL
int _lwp_kill(lwpid_t, int);
int _lwp_info(struct lwpinfo *);
lwpid_t _lwp_self(void);
int _lwp_suspend(lwpid_t);
int _lwp_continue(lwpid_t);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_LWP_H */