3 Copyright 2003 Red Hat, Inc.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
16 #define _NOMNTENT_FUNCS
18 #undef _NOMNTENT_FUNCS
20 #define CYGTLS_INITIALIZED 0x43227
21 #define CYGTLS_EXCEPTION (0x43227 + true)
24 # define CYG_MAX_PATH 260
35 Needed for the group functions
50 char pass[_PASSWORD_LEN];
56 unsigned available_drives;
59 char mnt_fsname[CYG_MAX_PATH];
60 char mnt_dir[CYG_MAX_PATH];
63 char strerror_buf[20];
72 char timezone_buf[20];
73 struct tm _localtime_buf;
76 char username[UNLEN + 1];
80 struct protoent *protoent_buf;
81 struct servent *servent_buf;
82 struct hostent *hostent_buf;
85 /* Please keep this file simple. Changes to the below structure may require
86 acompanying changes to the very simple parser in the perl script
87 'gentls_offsets' (<<-- start parsing here). */
89 typedef __uint32_t __stack_t;
92 void (*func) /*gentls_offsets*/(int)/*gentls_offsets*/;
101 sigset_t sigwait_mask;
102 siginfo_t *sigwait_info;
105 struct _reent local_clib;
106 struct _local_storage locals;
107 struct _threadinfo *prev, *next;
113 static CRITICAL_SECTION protect_linked_list;
115 void init_thread (void *) __attribute__ ((regparm (2)));
116 static void call (DWORD (*) (void *, void *), void *) __attribute__ ((regparm (3)));
117 static void call2 (DWORD (*) (void *, void *), void *, void *) __attribute__ ((regparm (3)));
118 static struct _threadinfo *find_tls (int sig);
120 void push (__stack_t, bool = false);
122 bool isinitialized () {return initialized == CYGTLS_INITIALIZED || initialized == CYGTLS_EXCEPTION;}
123 void set_state (bool);
124 void reset_exception ();
125 bool interrupt_now (CONTEXT *, int, void *, struct sigaction&)
126 __attribute__((regparm(3)));
127 void __stdcall interrupt_setup (int sig, void *handler, struct sigaction& siga, __stack_t retaddr)
128 __attribute__((regparm(3)));
129 operator HANDLE () const {return tid->win32_obj_id;}
134 extern char *_tlsbase __asm__ ("%fs:4");
135 extern char *_tlstop __asm__ ("%fs:8");
136 #define _my_tls (((_threadinfo *) _tlsbase)[-1])
137 extern _threadinfo *_main_tls;
139 #define __getreent() (&_my_tls.local_clib)
141 #define CYGTLS_PADSIZE (sizeof (_threadinfo))