2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
27 * 15 October 2000 (debo)
31 #include <mach/mach_types.h>
36 task_policy_flavor_t flavor
,
37 task_policy_t policy_info
,
38 mach_msg_type_number_t count
)
40 if (task
== TASK_NULL
)
41 return (KERN_INVALID_ARGUMENT
);
45 case TASK_CATEGORY_POLICY
:
47 task_category_policy_t info
= (task_category_policy_t
)policy_info
;
49 if (count
< TASK_CATEGORY_POLICY_COUNT
)
50 return (KERN_INVALID_ARGUMENT
);
54 case TASK_UNSPECIFIED
:
55 case TASK_FOREGROUND_APPLICATION
:
56 case TASK_BACKGROUND_APPLICATION
:
57 case TASK_CONTROL_APPLICATION
:
58 case TASK_GRAPHICS_SERVER
:
59 return (KERN_SUCCESS
);
62 return (KERN_INVALID_ARGUMENT
);
69 return (KERN_INVALID_ARGUMENT
);
72 return (KERN_SUCCESS
);
78 task_policy_flavor_t flavor
,
79 task_policy_t policy_info
,
80 mach_msg_type_number_t
*count
,
81 boolean_t
*get_default
)
83 if (task
== TASK_NULL
)
84 return (KERN_INVALID_ARGUMENT
);
88 case TASK_CATEGORY_POLICY
:
90 task_category_policy_t info
= (task_category_policy_t
)policy_info
;
92 if (*count
< TASK_CATEGORY_POLICY_COUNT
)
93 return (KERN_INVALID_ARGUMENT
);
95 info
->role
= TASK_UNSPECIFIED
;
100 return (KERN_INVALID_ARGUMENT
);
103 return (KERN_SUCCESS
);