10 extern pid_t cygwin32_winpid_to_pid (int);
11 extern void cygwin32_win32_to_posix_path_list (const char *, char *);
12 extern int cygwin32_win32_to_posix_path_list_buf_size (const char *);
13 extern void cygwin32_posix_to_win32_path_list (const char *, char *);
14 extern int cygwin32_posix_to_win32_path_list_buf_size (const char *);
15 extern int cygwin32_conv_to_win32_path (const char *, char *);
16 extern int cygwin32_conv_to_full_win32_path (const char *, char *);
17 extern void cygwin32_conv_to_posix_path (const char *, char *);
18 extern void cygwin32_conv_to_full_posix_path (const char *, char *);
19 extern int cygwin32_posix_path_list_p (const char *);
20 extern void cygwin32_split_path (const char *, char *, char *);
22 extern pid_t cygwin_winpid_to_pid (int);
23 extern int cygwin_win32_to_posix_path_list (const char *, char *);
24 extern int cygwin_win32_to_posix_path_list_buf_size (const char *);
25 extern int cygwin_posix_to_win32_path_list (const char *, char *);
26 extern int cygwin_posix_to_win32_path_list_buf_size (const char *);
27 extern int cygwin_conv_to_win32_path (const char *, char *);
28 extern int cygwin_conv_to_full_win32_path (const char *, char *);
29 extern int cygwin_conv_to_posix_path (const char *, char *);
30 extern int cygwin_conv_to_full_posix_path (const char *, char *);
31 extern int cygwin_posix_path_list_p (const char *);
32 extern void cygwin_split_path (const char *, char *, char *);
34 extern void cygwin_premain0 (int argc, char **argv);
35 extern void cygwin_premain1 (int argc, char **argv);
36 extern void cygwin_premain2 (int argc, char **argv);
37 extern void cygwin_premain3 (int argc, char **argv);
39 struct __cygwin_perfile
46 extern HANDLE cygwin_logon_user (const struct passwd *, const char *);
49 /* External interface stuff */
60 CW_READ_V1_MOUNT_TABLES,
63 CW_GET_CYGDRIVE_PREFIXES,
65 } cygwin_getinfo_types;
67 #define CW_NEXTPID 0x80000000 // or with pid to get next one
69 /* Flags associated with process_state */
72 PID_NOT_IN_USE = 0x0000, // Free entry.
73 PID_IN_USE = 0x0001, // Entry in use.
74 PID_ZOMBIE = 0x0002, // Child exited: no parent wait.
75 PID_STOPPED = 0x0004, // Waiting for SIGCONT.
76 PID_TTYIN = 0x0008, // Waiting for terminal input.
77 PID_TTYOU = 0x0010, // Waiting for terminal output.
78 PID_ORPHANED = 0x0020, // Member of an orphaned process group.
79 PID_ACTIVE = 0x0040, // Pid accepts signals.
80 PID_CYGPARENT = 0x0080, // Set if parent was a cygwin app.
81 PID_SPLIT_HEAP = 0x0100, // Set if the heap has been split,
82 // which means we can't fork again.
83 PID_CLEAR = 0x0200, // Flag that pid should be cleared from parent's
85 PID_SOCKETS_USED = 0x0400, // Set if process uses Winsock.
86 PID_INITIALIZING = 0x0800, // Set until ready to receive signals.
87 PID_USETTY = 0x1000, // Setting this enables or disables cygwin's
88 // tty support. This is inherited by
89 // all execed or forked processes.
90 PID_REPARENT = 0x2000, // child has execed
91 PID_EXECED = 0x4000, // redirect to original pid info block
92 PID_NOREDIR = 0x8000 // don't redirect if execed
96 /* This lives in the app and is initialized before jumping into the DLL.
97 It should only contain stuff which the user's process needs to see, or
98 which is needed before the user pointer is initialized, or is needed to
99 carry inheritance information from parent to child. Note that it cannot
100 be used to carry inheritance information across exec!
102 Remember, this structure is linked into the application's executable.
103 Changes to this can invalidate existing executables, so we go to extra
104 lengths to avoid having to do it.
106 When adding/deleting members, remember to adjust {public,internal}_reserved.
107 The size of the class shouldn't change [unless you really are prepared to
108 invalidate all existing executables]. The program does a check (using
109 SIZEOF_PER_PROCESS) to make sure you remember to make the adjustment.
121 /* The offset of these 3 values can never change. */
122 /* magic_biscuit is the size of this class and should never change. */
123 unsigned long magic_biscuit;
124 unsigned long dll_major;
125 unsigned long dll_minor;
127 struct _reent **impure_ptr_ptr;
130 /* Used to point to the memory machine we should use. Usually these
131 point back into the dll, but they can be overridden by the user. */
132 void *(*malloc)(size_t);
133 void (*free)(void *);
134 void *(*realloc)(void *, size_t);
138 int (*main)(int, char **, char **);
139 void (**ctors)(void);
140 void (**dtors)(void);
148 void *(*calloc)(size_t, size_t);
149 /* For future expansion of values set by the app. */
150 void (*premain[4]) (int, char **);
152 /* The rest are *internal* to cygwin.dll.
153 Those that are here because we want the child to inherit the value from
154 the parent (which happens when bss is copied) are marked as such. */
156 /* non-zero of ctors have been run. Inherited from parent. */
161 /* Heap management. Inherited from parent. */
162 void *heapbase; /* bottom of the heap */
163 void *heapptr; /* current index into heap */
164 void *heaptop; /* current top of heap */
166 DWORD unused1; /* unused */
168 /* Non-zero means the task was forked. The value is the pid.
169 Inherited from parent. */
174 DWORD api_major; /* API version that this program was */
175 DWORD api_minor; /* linked with */
176 /* For future expansion, so apps won't have to be relinked if we
180 #ifdef __INSIDE_CYGWIN__
181 ResourceLocks *resourcelocks;
182 MTinterface *threadinterface;
185 void *threadinterface;
187 struct _reent *impure_ptr;
189 #define per_process_overwrite ((unsigned) &(((struct per_process *) NULL)->resourcelocks))
191 extern void cygwin_set_impersonation_token (const HANDLE);
193 /* included if <windows.h> is included */
194 extern int cygwin32_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD);
195 extern int cygwin_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD);
197 #include <sys/resource.h>
199 struct external_pinfo
204 DWORD dwProcessId, dwSpawnedProcessId;
213 struct rusage rusage_self;
214 struct rusage rusage_children;
216 char progname[MAX_PATH];
224 DWORD cygwin_internal (cygwin_getinfo_types, ...);
231 #endif /* _SYS_CYGWIN_H */