This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bug report - g++ + linuxthreads == seg fault
on Tue, May 09, 2000 at 08:57:29PM -0600, llewelly@dbritsch.dsl.xmission.com typed aloud:
| On Tue, 9 May 2000, Brent Verner wrote:
|
| I compiled and ran this source on my i686-pc-linux-gnu (redhat 6.1 +
| mods), and I got:
|
| {~/cc_exer}g++ -g -Wall -O2 -lpthread c++_threads.cc
| {~/cc_exer}./a.out
| calling thread
| running me
| thread joined
| {~/cc_exer}gcc --version
| 2.95.2
|
| binutils: 2.95.0.41
| glibc: 2.1.2, with matching linux threads
I have:
glibc 2.1.3 + matching linuxthreads
gcc version 2.96 20000508 (experimental) [cvs co about 2pm]
binutils 2.95.0.41
note, that I've seen this problem since the 'cvs co egcs' on 20000428.
| So upgrading each of the above may help.
|
| gcc is easiest to upgrade, so try upgrading it first (if you do not have
| 2.95.2 already) (do not forget to pass --enable-threads to configure.)
|
| glibc + linuxthreads is probably the most difficult upgrade, so try that
| last.
|
| If you already have the versions above (or newer), you may have an
| installation problem.
what can I do to fix any installation problem if that's what it is?
| >
| > ==========================
| > the source:
| > ==========================
| > (g++ -v --save-temps -O2 -lpthreads breaks.cc) [attached]
|
| hm. I did not get any attachements.
sorry. ddd hung my box, so I quickly sent (w/o attachment) email
so I could kill X...
it is now attached.
brent
# 1 "breaks.cc"
extern "C" {
# 1 "/usr/include/stdio.h" 1 3
# 18 "/usr/include/stdio.h" 3
# 1 "/usr/include/features.h" 1 3
# 18 "/usr/include/features.h" 3
# 80 "/usr/include/features.h" 3
# 139 "/usr/include/features.h" 3
# 197 "/usr/include/features.h" 3
# 1 "/usr/include/sys/cdefs.h" 1 3
# 18 "/usr/include/sys/cdefs.h" 3
# 72 "/usr/include/sys/cdefs.h" 3
# 104 "/usr/include/sys/cdefs.h" 3
# 124 "/usr/include/sys/cdefs.h" 3
# 250 "/usr/include/features.h" 2 3
# 1 "/usr/include/gnu/stubs.h" 1 3
# 278 "/usr/include/features.h" 2 3
# 27 "/usr/include/stdio.h" 2 3
extern "C" {
# 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 49 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 91 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 161 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
typedef unsigned int size_t;
# 304 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 316 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 349 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 33 "/usr/include/stdio.h" 2 3
# 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stdarg.h" 1 3
# 19 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 136 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stdarg.h" 3
# 38 "/usr/include/stdio.h" 2 3
# 1 "/usr/include/bits/types.h" 1 3
# 18 "/usr/include/bits/types.h" 3
# 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 49 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 91 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 161 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 218 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 304 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 316 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 349 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 29 "/usr/include/bits/types.h" 2 3
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
# 49 "/usr/include/bits/types.h" 3
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;
typedef __quad_t *__qaddr_t;
typedef __u_quad_t __dev_t;
typedef __u_int __uid_t;
typedef __u_int __gid_t;
typedef __u_long __ino_t;
typedef __u_int __mode_t;
typedef __u_int __nlink_t;
typedef long int __off_t;
typedef __quad_t __loff_t;
typedef int __pid_t;
typedef int __ssize_t;
typedef __u_long __rlim_t;
typedef __u_quad_t __rlim64_t;
typedef __u_int __id_t;
typedef struct
{
int __val[2];
} __fsid_t;
typedef int __daddr_t;
typedef char *__caddr_t;
typedef long int __time_t;
typedef long int __swblk_t;
typedef long int __clock_t;
typedef unsigned long int __fd_mask;
typedef struct
{
__fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
} __fd_set;
typedef int __key_t;
typedef unsigned short int __ipc_pid_t;
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;
typedef __u_long __ino64_t;
typedef __loff_t __off64_t;
typedef long int __t_scalar_t;
typedef unsigned long int __t_uscalar_t;
typedef int __intptr_t;
# 40 "/usr/include/stdio.h" 2 3
typedef struct _IO_FILE FILE;
# 1 "/usr/include/libio.h" 1 3
# 26 "/usr/include/libio.h" 3
# 1 "/usr/include/_G_config.h" 1 3
# 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 49 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 91 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 161 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 218 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 267 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 281 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
typedef unsigned int wint_t;
# 349 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 14 "/usr/include/_G_config.h" 2 3
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 30 "/usr/include/libio.h" 2 3
# 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stdarg.h" 1 3
# 19 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stdarg.h" 3
# 136 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stdarg.h" 3
# 48 "/usr/include/libio.h" 2 3
# 68 "/usr/include/libio.h" 3
# 99 "/usr/include/libio.h" 3
struct _IO_jump_t; struct _IO_FILE;
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 187 "/usr/include/libio.h" 3
};
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
int _unused2[16];
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
typedef __ssize_t __io_read_fn (void * __cookie, char *__buf,
size_t __nbytes);
typedef __ssize_t __io_write_fn (void * __cookie, __const char *__buf,
size_t __n);
typedef int __io_seek_fn (void * __cookie, __off_t __pos, int __w);
typedef int __io_close_fn (void * __cookie);
# 312 "/usr/include/libio.h" 3
extern "C" {
extern int __underflow (_IO_FILE *) throw ();
extern int __uflow (_IO_FILE *) throw ();
extern int __overflow (_IO_FILE *, int) throw ();
extern int _IO_getc (_IO_FILE *__fp) throw ();
extern int _IO_putc (int __c, _IO_FILE *__fp) throw ();
extern int _IO_feof (_IO_FILE *__fp) throw ();
extern int _IO_ferror (_IO_FILE *__fp) throw ();
extern int _IO_peekc_locked (_IO_FILE *__fp) throw ();
extern void _IO_flockfile (_IO_FILE *) throw ();
extern void _IO_funlockfile (_IO_FILE *) throw ();
extern int _IO_ftrylockfile (_IO_FILE *) throw ();
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list, int *__restrict) throw ();
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list) throw ();
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) throw ();
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) throw ();
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) throw ();
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) throw ();
extern void _IO_free_backup_area (_IO_FILE *) throw ();
}
# 57 "/usr/include/stdio.h" 2 3
typedef __off_t fpos_t;
# 110 "/usr/include/stdio.h" 3
# 1 "/usr/include/bits/stdio_lim.h" 1 3
# 18 "/usr/include/bits/stdio_lim.h" 3
# 110 "/usr/include/stdio.h" 2 3
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern int remove (__const char *__filename) throw ();
extern int rename (__const char *__old, __const char *__new) throw ();
extern FILE *tmpfile (void) throw ();
extern char *tmpnam (char *__s) throw ();
extern char *tmpnam_r (char *__s) throw ();
extern char *tempnam (__const char *__dir, __const char *__pfx) throw ();
extern int fclose (FILE *__stream) throw ();
extern int fflush (FILE *__stream) throw ();
extern int fflush_unlocked (FILE *__stream) throw ();
extern FILE *fopen (__const char *__restrict __filename,
__const char *__restrict __modes) throw ();
extern FILE *freopen (__const char *__restrict __filename,
__const char *__restrict __modes,
# 187 "/usr/include/stdio.h" 3
FILE *__restrict __stream) throw ();
# 202 "/usr/include/stdio.h" 3
extern FILE *fdopen (int __fd, __const char *__modes) throw ();
# 228 "/usr/include/stdio.h" 3
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) throw ();
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) throw ();
extern void setlinebuf (FILE *__stream) throw ();
extern int fprintf (FILE *__restrict __stream,
__const char *__restrict __format, ...) throw ();
extern int printf (__const char *__restrict __format, ...) throw ();
extern int sprintf (char *__restrict __s,
__const char *__restrict __format, ...) throw ();
extern int vfprintf (FILE *__restrict __s,
__const char *__restrict __format,
# 262 "/usr/include/stdio.h" 3
__gnuc_va_list __arg) throw ();
extern int vprintf (__const char *__restrict __format,
__gnuc_va_list __arg) throw ();
extern int vsprintf (char *__restrict __s,
__const char *__restrict __format,
# 269 "/usr/include/stdio.h" 3
__gnuc_va_list __arg) throw ();
extern int snprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, ...) throw ()
__attribute__ ((__format__ (__printf__, 3, 4)));
extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format,
# 279 "/usr/include/stdio.h" 3
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__printf__, 3, 0)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format,
# 283 "/usr/include/stdio.h" 3
__gnuc_va_list __arg) throw ()
__attribute__ ((__format__ (__printf__, 3, 0)));
# 307 "/usr/include/stdio.h" 3
extern int fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...) throw ();
extern int scanf (__const char *__restrict __format, ...) throw ();
extern int sscanf (__const char *__restrict __s,
__const char *__restrict __format, ...) throw ();
# 335 "/usr/include/stdio.h" 3
extern int fgetc (FILE *__stream) throw ();
extern int getc (FILE *__stream) throw ();
extern int getchar (void) throw ();
extern int getc_unlocked (FILE *__stream) throw ();
extern int getchar_unlocked (void) throw ();
extern int fgetc_unlocked (FILE *__stream) throw ();
extern int fputc (int __c, FILE *__stream) throw ();
extern int putc (int __c, FILE *__stream) throw ();
extern int putchar (int __c) throw ();
extern int fputc_unlocked (int __c, FILE *__stream) throw ();
extern int putc_unlocked (int __c, FILE *__stream) throw ();
extern int putchar_unlocked (int __c) throw ();
extern int getw (FILE *__stream) throw ();
extern int putw (int __w, FILE *__stream) throw ();
extern char *fgets (char *__restrict __s, int __n,
FILE *__restrict __stream) throw ();
extern char *gets (char *__s) throw ();
# 425 "/usr/include/stdio.h" 3
extern int fputs (__const char *__restrict __s,
FILE *__restrict __stream) throw ();
extern int puts (__const char *__s) throw ();
extern int ungetc (int __c, FILE *__stream) throw ();
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) throw ();
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) throw ();
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) throw ();
extern size_t fwrite_unlocked (__const void *__restrict __ptr,
size_t __size, size_t __n,
# 458 "/usr/include/stdio.h" 3
FILE *__restrict __stream) throw ();
extern int fseek (FILE *__stream, long int __off, int __whence) throw ();
extern long int ftell (FILE *__stream) throw ();
extern void rewind (FILE *__stream) throw ();
typedef __off_t off_t;
extern int fgetpos (FILE *__restrict __stream,
fpos_t *__restrict __pos) throw ();
extern int fsetpos (FILE *__stream, __const fpos_t *__pos) throw ();
# 524 "/usr/include/stdio.h" 3
# 534 "/usr/include/stdio.h" 3
extern void clearerr (FILE *__stream) throw ();
extern int feof (FILE *__stream) throw ();
extern int ferror (FILE *__stream) throw ();
extern void clearerr_unlocked (FILE *__stream) throw ();
extern int feof_unlocked (FILE *__stream) throw ();
extern int ferror_unlocked (FILE *__stream) throw ();
extern void perror (__const char *__s) throw ();
extern int sys_nerr;
extern __const char *__const sys_errlist[];
extern int fileno (FILE *__stream) throw ();
extern int fileno_unlocked (FILE *__stream) throw ();
extern FILE *popen (__const char *__command, __const char *__modes) throw ();
extern int pclose (FILE *__stream) throw ();
extern char *ctermid (char *__s) throw ();
# 608 "/usr/include/stdio.h" 3
extern void flockfile (FILE *__stream) throw ();
extern int ftrylockfile (FILE *__stream) throw ();
extern void funlockfile (FILE *__stream) throw ();
# 1 "/usr/include/bits/stdio.h" 1 3
# 18 "/usr/include/bits/stdio.h" 3
inline int
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) throw ()
{
return vfprintf (stdout, __fmt, __arg);
}
inline int
getchar (void) throw ()
{
return _IO_getc (stdin);
}
inline int
getc_unlocked (FILE *__fp) throw ()
{
return ((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
inline int
getchar_unlocked (void) throw ()
{
return ((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
}
inline int
putchar (int __c) throw ()
{
return _IO_putc (__c, stdout);
}
inline int
fputc_unlocked (int __c, FILE *__stream) throw ()
{
return ((( __stream)->_IO_write_ptr >= ( __stream)->_IO_write_end) ? __overflow ( __stream, (unsigned char) (__c)) : (unsigned char) (*( __stream)->_IO_write_ptr++ = (__c)));
}
inline int
putc_unlocked (int __c, FILE *__stream) throw ()
{
return ((( __stream)->_IO_write_ptr >= ( __stream)->_IO_write_end) ? __overflow ( __stream, (unsigned char) (__c)) : (unsigned char) (*( __stream)->_IO_write_ptr++ = (__c)));
}
inline int
putchar_unlocked (int __c) throw ()
{
return ((( stdout)->_IO_write_ptr >= ( stdout)->_IO_write_end) ? __overflow ( stdout, (unsigned char) (__c)) : (unsigned char) (*( stdout)->_IO_write_ptr++ = (__c)));
}
inline int
feof_unlocked (FILE *__stream) throw ()
{
return (((__stream)->_flags & 0x10) != 0);
}
inline int
ferror_unlocked (FILE *__stream) throw ()
{
return (((__stream)->_flags & 0x20) != 0);
}
# 149 "/usr/include/bits/stdio.h" 3
# 165 "/usr/include/bits/stdio.h" 3
# 635 "/usr/include/stdio.h" 2 3
}
# 2 "breaks.cc" 2
# 1 "/usr/include/pthread.h" 1 3
# 1 "/usr/include/sched.h" 1 3
# 19 "/usr/include/sched.h" 3
# 1 "/usr/include/time.h" 1 3
# 18 "/usr/include/time.h" 3
# 52 "/usr/include/time.h" 3
# 63 "/usr/include/time.h" 3
# 74 "/usr/include/time.h" 3
struct timespec
{
long int tv_sec;
long int tv_nsec;
};
# 280 "/usr/include/time.h" 3
# 29 "/usr/include/sched.h" 2 3
# 1 "/usr/include/bits/sched.h" 1 3
# 20 "/usr/include/bits/sched.h" 3
struct sched_param
{
int sched_priority;
};
extern "C" {
extern int clone (int (*__fn) (void *__arg), void *__child_stack,
int __flags, void *__arg) throw ();
}
struct __sched_param
{
int sched_priority;
};
# 32 "/usr/include/sched.h" 2 3
extern "C" {
extern int __sched_setparam (__pid_t __pid,
__const struct sched_param *__param) throw ();
extern int sched_setparam (__pid_t __pid,
__const struct sched_param *__param) throw ();
extern int __sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
extern int __sched_setscheduler (__pid_t __pid, int __policy,
__const struct sched_param *__param) throw ();
extern int sched_setscheduler (__pid_t __pid, int __policy,
__const struct sched_param *__param) throw ();
extern int __sched_getscheduler (__pid_t __pid) throw ();
extern int sched_getscheduler (__pid_t __pid) throw ();
extern int __sched_yield (void) throw ();
extern int sched_yield (void) throw ();
extern int __sched_get_priority_max (int __algorithm) throw ();
extern int sched_get_priority_max (int __algorithm) throw ();
extern int __sched_get_priority_min (int __algorithm) throw ();
extern int sched_get_priority_min (int __algorithm) throw ();
extern int __sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
}
# 20 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/time.h" 1 3
# 18 "/usr/include/time.h" 3
extern "C" {
# 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 49 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 91 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 161 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 218 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 304 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 316 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 349 "/usr/lib/gcc-lib/i686-pc-linux-gnu/2.96/include/stddef.h" 3
# 38 "/usr/include/time.h" 2 3
# 1 "/usr/include/bits/time.h" 1 3
# 19 "/usr/include/bits/time.h" 3
# 60 "/usr/include/bits/time.h" 3
# 42 "/usr/include/time.h" 2 3
typedef __clock_t clock_t;
typedef __time_t time_t;
# 90 "/usr/include/time.h" 3
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long int tm_gmtoff;
__const char *tm_zone;
};
extern clock_t clock (void) throw ();
extern time_t time (time_t *__timer) throw ();
extern double difftime (time_t __time1, time_t __time0) throw ()
__attribute__ ((__const__));
extern time_t mktime (struct tm *__tp) throw ();
extern size_t strftime (char *__restrict __s, size_t __maxsize,
__const char *__restrict __format,
# 137 "/usr/include/time.h" 3
__const struct tm *__restrict __tp) throw ();
extern struct tm *gmtime (__const time_t *__timer) throw ();
extern struct tm *localtime (__const time_t *__timer) throw ();
extern struct tm *__gmtime_r (__const time_t *__restrict __timer,
struct tm *__restrict __tp) throw ();
extern struct tm *gmtime_r (__const time_t *__restrict __timer,
struct tm *__restrict __tp) throw ();
extern struct tm *localtime_r (__const time_t *__restrict __timer,
struct tm *__restrict __tp) throw ();
extern char *asctime (__const struct tm *__tp) throw ();
extern char *ctime (__const time_t *__timer) throw ();
extern char *asctime_r (__const struct tm *__restrict __tp,
char *__restrict __buf) throw ();
extern char *ctime_r (__const time_t *__restrict __timer,
char *__restrict __buf) throw ();
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;
extern char *tzname[2];
extern void tzset (void) throw ();
extern int daylight;
extern long int timezone;
extern int stime (__const time_t *__when) throw ();
extern time_t timegm (struct tm *__tp) throw ();
extern time_t timelocal (struct tm *__tp) throw ();
extern int dysize (int __year) throw ();
extern int nanosleep (__const struct timespec *__requested_time,
struct timespec *__remaining) throw ();
# 265 "/usr/include/time.h" 3
# 275 "/usr/include/time.h" 3
}
# 21 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/signal.h" 1 3
# 18 "/usr/include/signal.h" 3
extern "C" {
# 1 "/usr/include/bits/sigset.h" 1 3
# 19 "/usr/include/bits/sigset.h" 3
typedef int __sig_atomic_t;
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 126 "/usr/include/bits/sigset.h" 3
# 33 "/usr/include/signal.h" 2 3
typedef __sigset_t sigset_t;
# 361 "/usr/include/signal.h" 3
}
# 24 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/bits/pthreadtypes.h" 1 3
# 1 "/usr/include/bits/sched.h" 1 3
# 20 "/usr/include/bits/sched.h" 3
# 63 "/usr/include/bits/sched.h" 3
# 74 "/usr/include/bits/sched.h" 3
# 23 "/usr/include/bits/pthreadtypes.h" 2 3
struct _pthread_fastlock
{
long int __status;
int __spinlock;
};
typedef struct _pthread_descr_struct *_pthread_descr;
typedef struct
{
int __detachstate;
int __schedpolicy;
struct __sched_param __schedparam;
int __inheritsched;
int __scope;
size_t __guardsize;
int __stackaddr_set;
void *__stackaddr;
size_t __stacksize;
} pthread_attr_t;
typedef struct
{
struct _pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
} pthread_cond_t;
typedef struct
{
int __dummy;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef struct
{
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
struct _pthread_fastlock __m_lock;
} pthread_mutex_t;
typedef struct
{
int __mutexkind;
} pthread_mutexattr_t;
typedef int pthread_once_t;
# 117 "/usr/include/bits/pthreadtypes.h" 3
typedef unsigned long int pthread_t;
# 25 "/usr/include/pthread.h" 2 3
extern "C" {
enum
{
PTHREAD_CREATE_JOINABLE,
PTHREAD_CREATE_DETACHED
};
enum
{
PTHREAD_INHERIT_SCHED,
PTHREAD_EXPLICIT_SCHED
};
enum
{
PTHREAD_SCOPE_SYSTEM,
PTHREAD_SCOPE_PROCESS
};
enum
{
PTHREAD_MUTEX_FAST_NP,
PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK_NP
};
enum
{
PTHREAD_PROCESS_PRIVATE,
PTHREAD_PROCESS_SHARED
};
# 104 "/usr/include/pthread.h" 3
struct _pthread_cleanup_buffer
{
void (*__routine) (void *);
void *__arg;
int __canceltype;
struct _pthread_cleanup_buffer *__prev;
};
enum
{
PTHREAD_CANCEL_ENABLE,
PTHREAD_CANCEL_DISABLE
};
enum
{
PTHREAD_CANCEL_DEFERRED,
PTHREAD_CANCEL_ASYNCHRONOUS
};
extern int pthread_create (pthread_t *__thread,
__const pthread_attr_t *__attr,
# 144 "/usr/include/pthread.h" 3
void *(*__start_routine) (void *),
# 144 "/usr/include/pthread.h" 3
void *__arg) throw ();
extern pthread_t pthread_self (void) throw ();
extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();
extern void pthread_exit (void *__retval) throw () __attribute__ ((__noreturn__));
extern int pthread_join (pthread_t __th, void **__thread_return) throw ();
extern int pthread_detach (pthread_t __th) throw ();
extern int pthread_attr_init (pthread_attr_t *__attr) throw ();
extern int pthread_attr_destroy (pthread_attr_t *__attr) throw ();
extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
int __detachstate) throw ();
extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
int *__detachstate) throw ();
extern int pthread_attr_setschedparam (pthread_attr_t *__attr,
__const struct sched_param *__param) throw ();
extern int pthread_attr_getschedparam (__const pthread_attr_t *__attr,
struct sched_param *__param) throw ();
extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr,
int __policy) throw ();
extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__attr,
int *__policy) throw ();
extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
int __inherit) throw ();
extern int pthread_attr_getinheritsched (__const pthread_attr_t *__attr,
int *__inherit) throw ();
extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) throw ();
extern int pthread_attr_getscope (__const pthread_attr_t *__attr,
int *__scope) throw ();
# 225 "/usr/include/pthread.h" 3
extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
void *__stackaddr) throw ();
extern int pthread_attr_getstackaddr (__const pthread_attr_t *__attr,
void **__stackaddr) throw ();
extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
size_t __stacksize) throw ();
extern int pthread_attr_getstacksize (__const pthread_attr_t *__attr,
size_t *__stacksize) throw ();
extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
__const struct sched_param *__param) throw ();
extern int pthread_getschedparam (pthread_t __target_thread,
int *__policy,
# 257 "/usr/include/pthread.h" 3
struct sched_param *__param) throw ();
extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
__const pthread_mutexattr_t *__mutex_attr) throw ();
extern int pthread_mutex_init (pthread_mutex_t *__mutex,
__const pthread_mutexattr_t *__mutex_attr) throw ();
extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex) throw ();
extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw ();
extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex) throw ();
extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw ();
extern int __pthread_mutex_lock (pthread_mutex_t *__mutex) throw ();
extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw ();
extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex) throw ();
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw ();
extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw ();
extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw ();
extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw ();
extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw ();
# 317 "/usr/include/pthread.h" 3
extern int pthread_cond_init (pthread_cond_t *__cond,
__const pthread_condattr_t *__cond_attr) throw ();
extern int pthread_cond_destroy (pthread_cond_t *__cond) throw ();
extern int pthread_cond_signal (pthread_cond_t *__cond) throw ();
extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw ();
extern int pthread_cond_wait (pthread_cond_t *__cond,
pthread_mutex_t *__mutex) throw ();
extern int pthread_cond_timedwait (pthread_cond_t *__cond,
pthread_mutex_t *__mutex,
# 346 "/usr/include/pthread.h" 3
__const struct timespec *__abstime) throw ();
extern int pthread_condattr_init (pthread_condattr_t *__attr) throw ();
extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw ();
# 410 "/usr/include/pthread.h" 3
extern int __pthread_key_create (pthread_key_t *__key,
void (*__destr_function) (void *)) throw ();
extern int pthread_key_create (pthread_key_t *__key,
void (*__destr_function) (void *)) throw ();
extern int pthread_key_delete (pthread_key_t __key) throw ();
extern int __pthread_setspecific (pthread_key_t __key,
__const void *__pointer) throw ();
extern int pthread_setspecific (pthread_key_t __key,
__const void *__pointer) throw ();
extern void *__pthread_getspecific (pthread_key_t __key) throw ();
extern void *pthread_getspecific (pthread_key_t __key) throw ();
extern int __pthread_once (pthread_once_t *__once_control,
void (*__init_routine) (void)) throw ();
extern int pthread_once (pthread_once_t *__once_control,
void (*__init_routine) (void)) throw ();
extern int pthread_setcancelstate (int __state, int *__oldstate) throw ();
extern int pthread_setcanceltype (int __type, int *__oldtype) throw ();
extern int pthread_cancel (pthread_t __thread) throw ();
extern void pthread_testcancel (void) throw ();
extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
void (*__routine) (void *),
# 483 "/usr/include/pthread.h" 3
void *__arg) throw ();
extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
int __execute) throw ();
# 516 "/usr/include/pthread.h" 3
# 1 "/usr/include/bits/sigthread.h" 1 3
# 19 "/usr/include/bits/sigthread.h" 3
extern int pthread_sigmask (int __how, __const __sigset_t *__newmask,
__sigset_t *__oldmask) throw ();
extern int pthread_kill (pthread_t __thread, int __signo) throw ();
# 518 "/usr/include/pthread.h" 2 3
# 533 "/usr/include/pthread.h" 3
extern int __pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
# 536 "/usr/include/pthread.h" 3
void (*__child) (void)) throw ();
extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
# 539 "/usr/include/pthread.h" 3
void (*__child) (void)) throw ();
extern void pthread_kill_other_threads_np (void) throw ();
extern void __pthread_initialize (void) throw ();
}
# 3 "breaks.cc" 2
}
using namespace std;
void* runme(void* arg){
puts("running me");
pthread_exit((void*)0);
}
int
main(int argc, char** argv){
pthread_t th;
puts("calling thread");
pthread_create( &th, __null, runme, (void*)0);
if( pthread_join(th,__null) ){
puts("join error");
}
puts("thread joined");
return 0;
}