xref: /illumos-gate/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Task.xs (revision d8d810637042c2a73a269f125dee75e8ed1421d1)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  *
25  * Task.xs contains XS wrappers for the task maniplulation functions.
26  */
27 
28 #pragma ident	"%Z%%M%	%I%	%E% SMI"
29 
30 /* Solaris includes. */
31 #include <sys/task.h>
32 
33 /* Perl includes. */
34 #include "EXTERN.h"
35 #include "perl.h"
36 #include "XSUB.h"
37 
38 /*
39  * The XS code exported to perl is below here.  Note that the XS preprocessor
40  * has its own commenting syntax, so all comments from this point on are in
41  * that form.
42  */
43 
44 MODULE = Sun::Solaris::Task PACKAGE = Sun::Solaris::Task
45 PROTOTYPES: ENABLE
46 
47  #
48  # Define any constants that need to be exported.  By doing it this way we can
49  # avoid the overhead of using the DynaLoader package, and in addition constants
50  # defined using this mechanism are eligible for inlining by the perl
51  # interpreter at compile time.
52  #
53 BOOT:
54 	{
55 	HV *stash;
56 
57 	stash = gv_stashpv("Sun::Solaris::Task", TRUE);
58 	newCONSTSUB(stash, "TASK_NORMAL", newSViv(TASK_NORMAL));
59 	newCONSTSUB(stash, "TASK_FINAL", newSViv(TASK_FINAL));
60 	newCONSTSUB(stash, "TASK_PROJ_PURGE", newSViv(TASK_PROJ_PURGE));
61 	}
62 
63 taskid_t
64 settaskid(project, flags)
65 	projid_t	project
66 	int		flags
67 
68 taskid_t
69 gettaskid()
70 
71