<commit_before>/* $Id$ */
/* Copyright (c) 2012 <NAME> <<EMAIL>> */
/* This file is part of DeforaOS System libc */
/* This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. */



#include <sys/types.h>
#include <sys/ptrace.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>


/* prototypes */
static int _ptrace(char const * progname);

static int _error(char const * progname, char const * message, int ret);


/* functions */
/* ptrace */
static int _ptrace(char const * progname)
{
	if(ptrace(PT_TRACE_ME, 0, NULL, 0) != 0)
		return -_error(progname, "PT_TRACE_ME", 1);
	if(ptrace(PT_ATTACH, getpid(), NULL, 0) != 0
			&& errno != EBUSY)
		return -_error(progname, "PT_ATTACH", 1);
	return 0;
}


/* error */
static int _error(char const * progname, char const * message, int ret)
{
	fprintf(stderr, "%s: %s: %s\n", progname, message, strerror(errno));
	return ret;
}


/* main */
int main(int argc, char * argv[])
{<commit_msg>No longer fail the ptrace test on NetBSD<commit_after>/* $Id$ */
/* Copyright (c) 2012 <NAME> <<EMAIL>> */
/* This file is part of DeforaOS System libc */
/* This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. */



#include <sys/types.h>
#include <sys/ptrace.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>


/* prototypes */
static int _ptrace(char const * progname);

static int _error(char const * progname, char const * message, int ret);


/* functions */
/* ptrace */
static int _ptrace(char const * progname)
{
	if(ptrace(PT_TRACE_ME, 0, NULL, 0) != 0)
		return -_error(progname, "PT_TRACE_ME", 1);
	if(ptrace(PT_ATTACH, getpid(), NULL, 0) != 0
			&& errno != EBUSY && errno != EINVAL)
		return -_error(progname, "PT_ATTACH", 1);
	return 0;
}


/* error */
static int _error(char const * progname, char const * message, int ret)
{
	fprintf(stderr, "%s: %s: %s\n", progname, message, strerror(errno));
	return ret;
}


/* main */
int main(int argc, char * argv[])
{
{'fraction_non_alphanumeric': 0.12926509186351706, 'fraction_numerical': 0.00853018372703412, 'mean_word_length': 3.855095541401274, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7341252', 'n_tokens_mistral': 1035, 'n_tokens_neox': 962, 'n_words': 387}