]> git.saurik.com Git - apple/libc.git/blame - pthreads/mk_pthread_impl.c
Libc-262.3.2.tar.gz
[apple/libc.git] / pthreads / mk_pthread_impl.c
CommitLineData
e9ce8d39
A
1/*
2 * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
3 * All Rights Reserved
4 *
5 * Permission to use, copy, modify, and distribute this software and
6 * its documentation for any purpose and without fee is hereby granted,
7 * provided that the above copyright notice appears in all copies and
8 * that both the copyright notice and this permission notice appear in
9 * supporting documentation.
10 *
11 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
12 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13 * FOR A PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
16 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
18 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
19 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 *
21 */
22/*
23 * MkLinux
24 */
25
26/*
27 * This program will generate the stuff necessary to "publish" the POSIX
28 * header <pthread.h> in a machine dependent fashion.
29 */
30
31#include <pthread_internals.h>
32#include <stdio.h>
33
34int
35main(void)
36{
37 printf("#ifndef _PTHREAD_IMPL_H_\n");
38 printf("#define _PTHREAD_IMPL_H_\n");
39 printf("/*\n");
40 printf(" * Internal implementation details\n");
41 printf(" */\n");
42 printf("\n");
43 printf("#define __PTHREAD_SIZE__ %ld\n", (long) sizeof(struct _pthread)-sizeof(long));
44 printf("#define __PTHREAD_ATTR_SIZE__ %ld\n", (long) sizeof(pthread_attr_t)-sizeof(long));
45 printf("#define __PTHREAD_MUTEXATTR_SIZE__ %ld\n", (long) sizeof(pthread_mutexattr_t)-sizeof(long));
46 printf("#define __PTHREAD_MUTEX_SIZE__ %ld\n", (long) sizeof(pthread_mutex_t)-sizeof(long));
47 printf("#define __PTHREAD_CONDATTR_SIZE__ %ld\n", (long) sizeof(pthread_condattr_t)-sizeof(long));
48 printf("#define __PTHREAD_COND_SIZE__ %ld\n", (long) sizeof(pthread_cond_t)-sizeof(long));
49 printf("#define __PTHREAD_ONCE_SIZE__ %ld\n", (long) sizeof(pthread_once_t)-sizeof(long));
50 printf("/*\n");
51 printf(" * [Internal] data structure signatures\n");
52 printf(" */\n");
53 printf("#define _PTHREAD_MUTEX_SIG_init 0x%08X\n", _PTHREAD_MUTEX_SIG_init);
54 printf("#define _PTHREAD_COND_SIG_init 0x%08X\n", _PTHREAD_COND_SIG_init);
55 printf("#define _PTHREAD_ONCE_SIG_init 0x%08X\n", _PTHREAD_ONCE_SIG_init);
56 printf("/*\n");
57 printf(" * POSIX scheduling policies \n");
58 printf(" */\n");
59 printf("#define SCHED_OTHER %d\n", SCHED_OTHER);
60 printf("#define SCHED_FIFO %d\n", SCHED_FIFO);
61 printf("#define SCHED_RR %d\n", SCHED_RR);
62 printf("\n");
63 printf("#define __SCHED_PARAM_SIZE__ %ld\n", (long) sizeof(struct sched_param)-sizeof(int));
64 printf("\n");
65 printf("#endif _PTHREAD_IMPL_H_\n");
66
67 exit(0);
68}