OSDN Git Service

* select.cc (select_stuff::wait): Temporarily disallow APCS.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / miscfuncs.h
1 /* miscfuncs.h: main Cygwin header file.
2
3    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4    2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
5
6 This file is part of Cygwin.
7
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
10 details. */
11
12 #ifndef _MISCFUNCS_H
13 #define _MISCFUNCS_H
14 int winprio_to_nice (DWORD) __attribute__ ((regparm (1)));
15 DWORD nice_to_winprio (int &) __attribute__ ((regparm (1)));
16
17 bool __stdcall create_pipe (PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD)
18   __attribute__ ((regparm (3)));
19
20 BOOL WINAPI CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handle,
21                                   LPSECURITY_ATTRIBUTES sa);
22 BOOL WINAPI ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len,
23                                 LPDWORD ret_len, DWORD timeout);
24 BOOL WINAPI WritePipeOverlapped (HANDLE h, PCVOID buf, DWORD len,
25                                  LPDWORD ret_len, DWORD timeout);
26
27 extern "C" void yield ();
28
29 void backslashify (const char *, char *, bool);
30 void slashify (const char *, char *, bool);
31 #define isslash(c) ((c) == '/')
32
33 extern void transform_chars (PWCHAR, PWCHAR);
34 inline void
35 transform_chars (PUNICODE_STRING upath, USHORT start_idx)
36 {
37   transform_chars (upath->Buffer + start_idx,
38                    upath->Buffer + upath->Length / sizeof (WCHAR) - 1);
39 }
40
41 /* Memory checking */
42 int __stdcall check_invalid_virtual_addr (const void *s, unsigned sz) __attribute__ ((regparm(2)));
43
44 ssize_t check_iovec (const struct iovec *, int, bool) __attribute__ ((regparm(3)));
45 #define check_iovec_for_read(a, b) check_iovec ((a), (b), false)
46 #define check_iovec_for_write(a, b) check_iovec ((a), (b), true)
47
48 extern "C" HANDLE WINAPI CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func,
49                                              PVOID thread_arg, PVOID stackaddr,
50                                              ULONG stacksize, ULONG guardsize,
51                                              DWORD creation_flags,
52                                              LPDWORD thread_id);
53
54 #endif /*_MISCFUNCS_H*/