* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
sizeof(struct kinfo_proc), 0 };
- if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1)
+ if (sysctl(mib, G_N_ELEMENTS (mib), NULL, &len, NULL, 0) == -1)
return (-1);
mib[5] = (len / sizeof(struct kinfo_proc));
- if (sysctl(mib, nitems(mib), &kp, &len, NULL, 0) < 0)
+ if (sysctl(mib, G_N_ELEMENTS (mib), &kp, &len, NULL, 0) < 0)
return -1;
ppid = kp.p_ppid;
key_len = strlen (key);
ret = NULL;
- if (sysctl(mib, nitems(mib), strs, &len, NULL, 0) != -1)
+ if (sysctl(mib, G_N_ELEMENTS (mib), strs, &len, NULL, 0) != -1)
{
for (i = 0; strs[i] != NULL; i++)
{
strs = (char **)realloc(strs, len);
- if (sysctl(mib, nitems(mib), strs, &len, NULL, 0) == -1) {
+ if (sysctl(mib, G_N_ELEMENTS (mib), strs, &len, NULL, 0) == -1) {
g_free (strs);
return ret;
}