Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 1997 00:49:34 -0500 (EST)
From:      Peter Dufault <dufault@hda.com>
To:        koshy@india.hp.com (A JOSEPH KOSHY)
Cc:        current@freebsd.org
Subject:   Re: Internal clock
Message-ID:  <199704030549.AAA03090@hda.hda.com>
In-Reply-To: <199704030423.AA299151399@fakir.india.hp.com> from A JOSEPH KOSHY at "Apr 3, 97 09:23:19 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> Shortly after the patches had been sent out I had folded them into the then
> -current tree (Dec/Jan); the original patches were against 2.1.5 I think.  
> They were working fine under the limited testing I had done then.
> 
> The Lite2 merge has touched many of the same files that the patches affected,
> so I plan to redo this effort sometime in the (near?) future.  I'm still
> catching up with Lite2.

Just a heads up that I'm working on this now.  I'm not planning on
committing until this sort of program works as expected and is reviewed.
If I stop working on it I'll let the list know.

#define _POSIX_SOURCE
#define _POSIX_C_SOURCE 199309

#include <unistd.h>

#include <stdio.h>
#include <string.h>
#include <errno.h>

#include <sched.h>

int main(int ac, char *av[])
{
	int scheduler;

#if _POSIX_VERSION < 199309
	fprintf(stderr, "POSIX.4 is not supported\n");
	exit(-1);
#else

#if !defined(_POSIX_PRIORITY_SCHEDULING)
	fprintf(stderr, "POSIX priority scheduling is not supported.\n");
	exit(-1);
#endif

	/* Is priority scheduling configured?
	 */
	errno = 0;
	if (sysconf(_SC_PRIORITY_SCHEDULING) == -1) {
		if (errno != 0) {
			/* This isn't valid - may be a standard violation
			 */
			perror("sysconf(_SC_PRIORITY_SCHEDULING)");
			exit(errno);
		}
		else {
			fprintf(stderr, "Priority scheduling not supported.\n");
			exit(-1);
		}
	}

	scheduler = sched_getscheduler(0);

	printf("sched_getscheduler says scheduler is %d.\n", scheduler);
	return 0;
#endif	/* _POSIX_VERSION < 199309 */
}


-- 
Peter Dufault (dufault@hda.com)   Realtime Machine Control and Simulation
HD Associates, Inc.               Voice: 508 433 6936



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704030549.AAA03090>