xref: /illumos-gate/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Task.xs (revision 269e59f9a28bf47e0f463e64fc5af4a408b73b21)
1 /*
2  * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
3  */
4 /*
5  * Task.xs contains XS wrappers for the task maniplulation functions.
6  */
7 
8 /* Solaris includes. */
9 #include <sys/task.h>
10 
11 /* Perl includes. */
12 #include "EXTERN.h"
13 #include "perl.h"
14 #include "XSUB.h"
15 
16 /*
17  * The XS code exported to perl is below here.  Note that the XS preprocessor
18  * has its own commenting syntax, so all comments from this point on are in
19  * that form.
20  */
21 
22 MODULE = Sun::Solaris::Task PACKAGE = Sun::Solaris::Task
23 PROTOTYPES: ENABLE
24 
25  #
26  # Define any constants that need to be exported.  By doing it this way we can
27  # avoid the overhead of using the DynaLoader package, and in addition constants
28  # defined using this mechanism are eligible for inlining by the perl
29  # interpreter at compile time.
30  #
31 BOOT:
32 	{
33 	HV *stash;
34 
35 	stash = gv_stashpv("Sun::Solaris::Task", TRUE);
36 	newCONSTSUB(stash, "TASK_NORMAL", newSViv(TASK_NORMAL));
37 	newCONSTSUB(stash, "TASK_FINAL", newSViv(TASK_FINAL));
38 	newCONSTSUB(stash, "TASK_PROJ_PURGE", newSViv(TASK_PROJ_PURGE));
39 	}
40 
41 taskid_t
42 settaskid(project, flags)
43 	projid_t	project
44 	int		flags
45 
46 taskid_t
47 gettaskid()
48 
49