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
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.
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]
23 * Copyright 1997-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
36 * exit() system call -- executed by subject process.
39 pr_exit(struct ps_prochandle
*Pr
, int status
)
41 sysret_t rval
; /* return value from exit() */
42 argdes_t argd
[1]; /* arg descriptors for exit() */
46 if (Pr
== NULL
) { /* no subject process */
48 return (0); /* not reached */
51 adp
= &argd
[0]; /* status argument */
52 adp
->arg_value
= status
;
53 adp
->arg_object
= NULL
;
54 adp
->arg_type
= AT_BYVAL
;
55 adp
->arg_inout
= AI_INPUT
;
58 error
= Psyscall(Pr
, &rval
, SYS_exit
, 1, &argd
[0]);
59 /* actually -- never returns. Expect ENOENT */
62 if (errno
== ENOENT
) /* expected case */
68 if (error
== 0) /* can't happen? */
69 return (rval
.sys_rval1
);
71 if (error
== ENOENT
) /* expected case */
79 * lwp_exit() system call -- executed by subject lwp.
82 pr_lwp_exit(struct ps_prochandle
*Pr
)
84 sysret_t rval
; /* return value from lwp_exit() */
87 if (Pr
== NULL
) { /* no subject process */
88 (void) syscall(SYS_lwp_exit
);
89 return (0); /* not reached */
92 error
= Psyscall(Pr
, &rval
, SYS_lwp_exit
, 0, NULL
);
93 /* actually -- never returns. Expect ENOENT */
96 if (errno
== ENOENT
) /* expected case */
102 if (error
== 0) /* can't happen? */
103 return (rval
.sys_rval1
);
105 if (error
== ENOENT
) /* expected case */