OSDN Git Service

* cygtls.h (_threadinfo::call): Remove regparm declaration to work around
[pf3gnuchains/sourceware.git] / winsup / cygwin / winsup.h
index f0d534d..6c2e58f 100644 (file)
@@ -8,6 +8,12 @@ This software is a copyrighted work licensed under the terms of the
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifdef DEBUGIT
+#define spf(a, b, c) small_printf (a, b, c)
+#else
+#define spf(a, b, c) do {} while (0)
+#endif
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -55,6 +61,23 @@ extern unsigned long cygwin_inet_addr (const char *cp);
 }
 #endif
 
+/* Note that MAX_PATH is defined in the windows headers */
+/* There is also PATH_MAX and MAXPATHLEN.
+   PATH_MAX is from Posix and does *not* include the trailing NUL.
+   MAXPATHLEN is from Unix.
+
+   Thou shalt use CYG_MAX_PATH throughout.  It avoids the NUL vs no-NUL
+   issue and is neither of the Unixy ones [so we can punt on which
+   one is the right one to use]. 
+   
+   Windows ANSI calls are limited to MAX_PATH in length. Cygwin calls that
+   thunk through to Windows Wide calls are limited to 32K. We define
+   CYG_MAX_PATH as a convenient, not to short, not too long 'happy medium'.
+   
+   */
+
+#define CYG_MAX_PATH (MAX_PATH)
+
 #ifdef __cplusplus
 
 extern const char case_folded_lower[];
@@ -133,11 +156,11 @@ extern HANDLE title_mutex;
     })
 
 /* Convert a signal to a signal mask */
-#define SIGTOMASK(sig) (1<<((sig) - signal_shift_subtract))
+#define SIGTOMASK(sig) (1 << ((sig) - signal_shift_subtract))
 extern unsigned int signal_shift_subtract;
 
 #ifdef NEW_MACRO_VARARGS
-# define api_fatal(...) __api_fatal ("%P: *** " __VA_ARGS__)
+# define api_fatal(...) __api_fatal (__VA_ARGS__)
 #else
 # define api_fatal(fmt, args...) __api_fatal ("%P: *** " fmt,## args)
 #endif
@@ -257,6 +280,8 @@ int __stdcall __check_invalid_read_ptr_errno (const void *s, unsigned sz) __attr
   __check_null_invalid_struct ((s), sizeof (*(s)))
 #define check_null_invalid_struct_errno(s) \
   __check_null_invalid_struct_errno ((s), sizeof (*(s)))
+#define check_invalid_read_struct_errno(s) \
+  __check_invalid_read_ptr_errno ((s), sizeof (*(s)))
 
 struct iovec;
 ssize_t check_iovec_for_read (const struct iovec *, int) __attribute__ ((regparm(2)));
@@ -277,11 +302,15 @@ int symlink_worker (const char *, const char *, bool, bool)
   __attribute__ ((regparm (3)));
 
 class path_conv;
-int access_worker (path_conv&, int) __attribute__ ((regparm (2)));
+int access_worker (path_conv&, int, class fhandler_base * = NULL) __attribute__ ((regparm (3)));
+
+int fcntl_worker (int fd, int cmd, void *arg);
 
 extern "C" int low_priority_sleep (DWORD) __attribute__ ((regparm (1)));
 #define SLEEP_0_STAY_LOW INFINITE
 
+size_t getshmlba (void);
+
 /**************************** Exports ******************************/
 
 extern "C" {
@@ -304,14 +333,6 @@ extern SYSTEM_INFO system_info;
 
 #define WM_ASYNCIO     0x8000          // WM_APP
 
-/* Note that MAX_PATH is defined in the windows headers */
-/* There is also PATH_MAX and MAXPATHLEN.
-   PATH_MAX is from Posix and does *not* include the trailing NUL.
-   MAXPATHLEN is from Unix.
-
-   Thou shalt use MAX_PATH throughout.  It avoids the NUL vs no-NUL
-   issue and is neither of the Unixy ones [so we can punt on which
-   one is the right one to use].  */
 
 #define STD_RBITS (S_IRUSR | S_IRGRP | S_IROTH)
 #define STD_WBITS (S_IWUSR)
@@ -328,8 +349,6 @@ extern HANDLE hMainThread;
 extern HANDLE hMainProc;
 
 extern bool cygwin_testing;
-extern unsigned _cygwin_testing_magic;
-extern HMODULE cygwin_hmodule;
 
 extern char almost_null[];