1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2015 Mohamed A. Khalfella <khalfella@gmail.com>
14 */
15
16 /*
17 * General pidnode routines are stored in this file.
18 */
19
20 #include <sys/pidnode.h>
21
22
23 /*
24 * Compare two pid_node_t elements. Used by AVL trees.
25 */
26
27 int
28 pid_node_comparator(const void *l, const void *r)
29 {
30 const pid_node_t *li = l;
31 const pid_node_t *ri = r;
32
33 if (li->pn_pid > ri->pn_pid)
34 return (1);
35 if (li->pn_pid < ri->pn_pid)
36 return (-1);
37 return (0);
38 }