1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* 23 * Copyright (c) 2001 by Sun Microsystems, Inc. 24 * All rights reserved. 25 */ 26 27#ifndef _RDTABLE_H 28#define _RDTABLE_H 29 30#pragma ident "%Z%%M% %I% %E% SMI" 31 32#ifdef __cplusplus 33extern "C" { 34#endif 35 36#include <limits.h> 37 38#include "rdimpl.h" 39 40#define LWPID_TBL_SZ 4096 /* hash table of lwpid_t structures */ 41#define LWP_ACTIVE 1 42 43typedef struct { 44 size_t t_size; 45 size_t t_nent; 46 long *t_list; 47} table_t; 48 49typedef struct { 50 uid_t u_id; 51 char u_name[LOGNAME_MAX+1]; 52} name_t; 53 54typedef struct { 55 size_t n_size; 56 size_t n_nent; 57 name_t *n_list; 58} nametbl_t; 59 60typedef struct lwpid { /* linked list of pointers to lwps */ 61 pid_t l_pid; 62 id_t l_lwpid; 63 int l_active; 64 lwp_info_t *l_lwp; 65 struct lwpid *l_next; 66} lwpid_t; 67 68 69extern void lwpid_init(); 70extern void lwpid_add(lwp_info_t *lwp, pid_t pid, id_t lwpid); 71extern void lwpid_del(pid_t pid, id_t lwpid); 72extern lwp_info_t *lwpid_get(pid_t pid, id_t lwpid); 73extern int lwpid_pidcheck(pid_t pid); 74 75#ifdef __cplusplus 76} 77#endif 78 79#endif /* _RDTABLE_H */ 80