| 1 | /* emxdll.h -- Global header file for emx.dll
|
|---|
| 2 | Copyright (c) 1992-2000 by Eberhard Mattes
|
|---|
| 3 |
|
|---|
| 4 | This file is part of emx.
|
|---|
| 5 |
|
|---|
| 6 | emx is free software; you can redistribute it and/or modify it
|
|---|
| 7 | under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | emx is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with emx; see the file COPYING. If not, write to
|
|---|
| 18 | the Free Software Foundation, 59 Temple Place - Suite 330,
|
|---|
| 19 | Boston, MA 02111-1307, USA.
|
|---|
| 20 |
|
|---|
| 21 | As special exception, emx.dll can be distributed without source code
|
|---|
| 22 | unless it has been changed. If you modify emx.dll, this exception
|
|---|
| 23 | no longer applies and you must remove this paragraph from all source
|
|---|
| 24 | files for emx.dll. */
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | #define STR(X) #X
|
|---|
| 28 | #define XSTR(X) STR(X)
|
|---|
| 29 |
|
|---|
| 30 | /* Round up to the next integral multiple of the page size. */
|
|---|
| 31 |
|
|---|
| 32 | #define ROUND_PAGE(x) ((((x) - 1) & ~0xfff) + 0x1000)
|
|---|
| 33 |
|
|---|
| 34 | /* IBM TCP/IP's socket handles are < 2048. See also emxdll.asm. */
|
|---|
| 35 |
|
|---|
| 36 | #define MAX_SOCKETS 2048
|
|---|
| 37 |
|
|---|
| 38 | /* Maximum number of file handles created by sock_init(). As of
|
|---|
| 39 | TCP/IP 2.0, sock_init() creates two handles. */
|
|---|
| 40 |
|
|---|
| 41 | #define MAXFH_SOCK_INIT 2
|
|---|
| 42 |
|
|---|
| 43 | /* Maximum number of heap objects (16 = 512 / 32). */
|
|---|
| 44 |
|
|---|
| 45 | #define MAX_HEAP_OBJS 16
|
|---|
| 46 |
|
|---|
| 47 | /* This is the default heap object size. */
|
|---|
| 48 |
|
|---|
| 49 | #define HEAP_OBJ_SIZE (32 * 1024 * 1024)
|
|---|
| 50 |
|
|---|
| 51 | #define ENTRY_POINT 0x10000
|
|---|
| 52 | #define U_OFFSET 0x0400
|
|---|
| 53 | #define KERNEL_U_ADDR 0x0e0000000
|
|---|
| 54 |
|
|---|
| 55 | /* Bits in `handle_flags[]' and `files[].flags' */
|
|---|
| 56 |
|
|---|
| 57 | #define HF_FILE 0x0001
|
|---|
| 58 | #define HF_DEV 0x0002
|
|---|
| 59 | #define HF_UPIPE 0x0004
|
|---|
| 60 | #define HF_NPIPE 0x0008
|
|---|
| 61 | #define HF_CON 0x0010
|
|---|
| 62 | #define HF_NUL 0x0040
|
|---|
| 63 | #define HF_CLK 0x0080
|
|---|
| 64 | #define HF_ASYNC 0x0100
|
|---|
| 65 | #define HF_SOCKET 0x0200
|
|---|
| 66 | #define HF_XF86SUP 0x0400
|
|---|
| 67 | #define HF_OPEN 0x1000
|
|---|
| 68 | #define HF_APPEND 0x2000
|
|---|
| 69 | #define HF_NDELAY 0x4000
|
|---|
| 70 | #define HF_NOINHERIT 0x80000000 /* Temporarily used while forking */
|
|---|
| 71 |
|
|---|
| 72 | #define L_FLAG_DLL 0x0001
|
|---|
| 73 | #define L_FLAG_LINK386 0x0002
|
|---|
| 74 |
|
|---|
| 75 | #define FORK_REQ_DONE 0
|
|---|
| 76 | #define FORK_REQ_INIT 1
|
|---|
| 77 | #define FORK_REQ_DLL 2
|
|---|
| 78 | #define FORK_REQ_MEM 3
|
|---|
| 79 |
|
|---|
| 80 | #define FORK_OBJ_SIZE 0x20000 /* 128KB */
|
|---|
| 81 |
|
|---|
| 82 | #define DEBUG_STDERR 0x0001 /* Open CON device, don't use handle 2 */
|
|---|
| 83 | #define DEBUG_STACK 0x0002 /* Unused */
|
|---|
| 84 | #define DEBUG_SETMEM 0x0004 /* Show setmem() arguments */
|
|---|
| 85 | #define DEBUG_SYSCALL 0x0008 /* Show syscalls */
|
|---|
| 86 | #define DEBUG_TERMIO 0x0010 /* Unused */
|
|---|
| 87 | #define DEBUG_FIND1 0x0020 /* Fetch only 1 entry with DosFindFirst/Next */
|
|---|
| 88 | #define DEBUG_QPINFO2 0x0040 /* Call DosQueryPathInfo twice */
|
|---|
| 89 | #define DEBUG_NOXF86SUP 0x0080 /* Don't check for xf86sup devices */
|
|---|
| 90 | #define DEBUG_NOINHSIG 0x0100 /* Don't inherit signal actions */
|
|---|
| 91 | #define DEBUG_NOFDZERO 0x0200 /* Don't fix select()'s missing FD_ZERO bug */
|
|---|
| 92 | #define DEBUG_NOFORKDLL 0x0400 /* Don't load DLLs in forked process */
|
|---|
| 93 | #define DEBUG_SOCLOSE 0x0800 /* Don't mind socket closed behind our back */
|
|---|
| 94 |
|
|---|
| 95 | #define NSIG 29
|
|---|
| 96 |
|
|---|
| 97 | #define FIND_COUNT 4
|
|---|
| 98 |
|
|---|
| 99 | #define FLAG_C 0x0001
|
|---|
| 100 | #define FLAG_Z 0x0040
|
|---|
| 101 |
|
|---|
| 102 | /* TRUNC_DRV() is defined for 'A' through 'Z', 'a' through 'z', and 1
|
|---|
| 103 | through 26. */
|
|---|
| 104 |
|
|---|
| 105 | #define TRUNC_UNC (1 << 0)
|
|---|
| 106 | #define TRUNC_DRV(c) (1 << ((c) & 0x1f))
|
|---|
| 107 | #define TRUNC_ALL (~0)
|
|---|
| 108 |
|
|---|
| 109 | typedef void (sigfun)(int signo);
|
|---|
| 110 |
|
|---|
| 111 | struct select_data;
|
|---|
| 112 | struct stat;
|
|---|
| 113 | struct termio;
|
|---|
| 114 | struct termios;
|
|---|
| 115 | struct timeb;
|
|---|
| 116 | struct timeval;
|
|---|
| 117 | struct _find;
|
|---|
| 118 | struct _new_proc;
|
|---|
| 119 | struct _profil;
|
|---|
| 120 | struct _select;
|
|---|
| 121 |
|
|---|
| 122 | struct signal_entry
|
|---|
| 123 | {
|
|---|
| 124 | sigfun *handler; /* Signal handler, SIG_DFL, or SIG_IGN */
|
|---|
| 125 | ULONG sa_mask; /* Signals to be blocked */
|
|---|
| 126 | ULONG sa_flags; /* Flags */
|
|---|
| 127 | };
|
|---|
| 128 |
|
|---|
| 129 | typedef struct
|
|---|
| 130 | {
|
|---|
| 131 | ULONG text_base;
|
|---|
| 132 | ULONG text_end;
|
|---|
| 133 | ULONG data_base;
|
|---|
| 134 | ULONG data_end;
|
|---|
| 135 | ULONG bss_base;
|
|---|
| 136 | ULONG bss_end;
|
|---|
| 137 | ULONG heap_base;
|
|---|
| 138 | ULONG heap_end;
|
|---|
| 139 | ULONG heap_brk;
|
|---|
| 140 | ULONG heap_off;
|
|---|
| 141 | ULONG os2_dll;
|
|---|
| 142 | ULONG stack_base;
|
|---|
| 143 | ULONG stack_end;
|
|---|
| 144 | ULONG flags;
|
|---|
| 145 | ULONG reserved[2];
|
|---|
| 146 | char options[64];
|
|---|
| 147 | } layout_table;
|
|---|
| 148 |
|
|---|
| 149 | typedef struct
|
|---|
| 150 | {
|
|---|
| 151 | ULONG last_sys_errno; /* Error code for last syscall */
|
|---|
| 152 | ULONG prev_sys_errno; /* Previous value of the above */
|
|---|
| 153 | ULONG find_handle;
|
|---|
| 154 | ULONG find_count;
|
|---|
| 155 | ULONG sig_blocked; /* Blocked signals */
|
|---|
| 156 | ULONG sig_pending; /* Pending signals */
|
|---|
| 157 | ULONG sig_prev_blocked; /* Previous signal mask */
|
|---|
| 158 | FILEFINDBUF3 find_buf[FIND_COUNT];
|
|---|
| 159 | const FILEFINDBUF3 *find_next;
|
|---|
| 160 | struct signal_entry sig_table[NSIG];
|
|---|
| 161 | } thread_data;
|
|---|
| 162 |
|
|---|
| 163 | typedef union
|
|---|
| 164 | {
|
|---|
| 165 | struct
|
|---|
| 166 | {
|
|---|
| 167 | ULONG edi;
|
|---|
| 168 | ULONG esi;
|
|---|
| 169 | ULONG ebp;
|
|---|
| 170 | ULONG esp;
|
|---|
| 171 | ULONG ebx;
|
|---|
| 172 | ULONG edx;
|
|---|
| 173 | ULONG ecx;
|
|---|
| 174 | ULONG eax;
|
|---|
| 175 | ULONG eflags;
|
|---|
| 176 | ULONG eip;
|
|---|
| 177 | } e;
|
|---|
| 178 | struct
|
|---|
| 179 | {
|
|---|
| 180 | USHORT di;
|
|---|
| 181 | USHORT edi_hi;
|
|---|
| 182 | USHORT si;
|
|---|
| 183 | USHORT esi_hi;
|
|---|
| 184 | USHORT bp;
|
|---|
| 185 | USHORT ebp_hi;
|
|---|
| 186 | USHORT sp;
|
|---|
| 187 | USHORT esp_hi;
|
|---|
| 188 | USHORT bx;
|
|---|
| 189 | USHORT ebx_hi;
|
|---|
| 190 | USHORT dx;
|
|---|
| 191 | USHORT edx_hi;
|
|---|
| 192 | USHORT cx;
|
|---|
| 193 | USHORT ecx_hi;
|
|---|
| 194 | USHORT ax;
|
|---|
| 195 | USHORT eax_hi;
|
|---|
| 196 | USHORT flags;
|
|---|
| 197 | USHORT eflags_hi;
|
|---|
| 198 | USHORT ip;
|
|---|
| 199 | USHORT eip_hi;
|
|---|
| 200 | } x;
|
|---|
| 201 | struct
|
|---|
| 202 | {
|
|---|
| 203 | ULONG edi;
|
|---|
| 204 | ULONG esi;
|
|---|
| 205 | ULONG ebp;
|
|---|
| 206 | ULONG esp;
|
|---|
| 207 | UCHAR bl;
|
|---|
| 208 | UCHAR bh;
|
|---|
| 209 | USHORT ebx_hi;
|
|---|
| 210 | UCHAR dl;
|
|---|
| 211 | UCHAR dh;
|
|---|
| 212 | USHORT edx_hi;
|
|---|
| 213 | UCHAR cl;
|
|---|
| 214 | UCHAR ch;
|
|---|
| 215 | USHORT ecx_hi;
|
|---|
| 216 | UCHAR al;
|
|---|
| 217 | UCHAR ah;
|
|---|
| 218 | USHORT eax_hi;
|
|---|
| 219 | ULONG eflags;
|
|---|
| 220 | ULONG eip;
|
|---|
| 221 | } b;
|
|---|
| 222 | } syscall_frame;
|
|---|
| 223 |
|
|---|
| 224 | struct fork_data_dll
|
|---|
| 225 | {
|
|---|
| 226 | ULONG req_code; /* Request code */
|
|---|
| 227 | HMODULE hmod; /* Module handle */
|
|---|
| 228 | char path[CCHMAXPATH+1]; /* File name */
|
|---|
| 229 | };
|
|---|
| 230 |
|
|---|
| 231 | struct fork_data_mem
|
|---|
| 232 | {
|
|---|
| 233 | ULONG req_code; /* Request code */
|
|---|
| 234 | ULONG address;
|
|---|
| 235 | ULONG count;
|
|---|
| 236 | HMODULE hmod;
|
|---|
| 237 | void *shared;
|
|---|
| 238 | char buf[1];
|
|---|
| 239 | };
|
|---|
| 240 |
|
|---|
| 241 | struct fork_data_init
|
|---|
| 242 | {
|
|---|
| 243 | ULONG req_code; /* Request code */
|
|---|
| 244 | ULONG msize; /* Size of shared memory object */
|
|---|
| 245 | ULONG brk;
|
|---|
| 246 | ULONG stack_base;
|
|---|
| 247 | ULONG stack_page;
|
|---|
| 248 | ULONG reg_ebp;
|
|---|
| 249 | ULONG umask;
|
|---|
| 250 | ULONG umask1;
|
|---|
| 251 | ULONG uflags; /* User flags */
|
|---|
| 252 | HEV req_sem;
|
|---|
| 253 | HEV ack_sem;
|
|---|
| 254 | };
|
|---|
| 255 |
|
|---|
| 256 | struct fork_sock
|
|---|
| 257 | {
|
|---|
| 258 | int f; /* File handle */
|
|---|
| 259 | int s; /* Socket handle */
|
|---|
| 260 | };
|
|---|
| 261 |
|
|---|
| 262 | struct fork_data_done
|
|---|
| 263 | {
|
|---|
| 264 | ULONG req_code; /* Request code */
|
|---|
| 265 | ULONG size; /* Number of bytes used for this structure */
|
|---|
| 266 | struct signal_entry sig_actions[NSIG];
|
|---|
| 267 | ULONG handle_count; /* Number of file handles */
|
|---|
| 268 | ULONG *fd_flags_array; /* FD_CLOEXEC */
|
|---|
| 269 | ULONG sock_init_count; /* Number of handles created by sock_init() */
|
|---|
| 270 | ULONG sock_init_array[MAXFH_SOCK_INIT];
|
|---|
| 271 | ULONG sock_count; /* Number of sockets */
|
|---|
| 272 | struct fork_sock *sock_array; /* File and socket handles */
|
|---|
| 273 | };
|
|---|
| 274 |
|
|---|
| 275 | typedef union
|
|---|
| 276 | {
|
|---|
| 277 | ULONG req_code;
|
|---|
| 278 | struct fork_data_dll dll;
|
|---|
| 279 | struct fork_data_mem mem;
|
|---|
| 280 | struct fork_data_init init;
|
|---|
| 281 | struct fork_data_done done;
|
|---|
| 282 | } fork_data;
|
|---|
| 283 |
|
|---|
| 284 |
|
|---|
| 285 | struct my_datetime
|
|---|
| 286 | {
|
|---|
| 287 | ULONG seconds;
|
|---|
| 288 | ULONG minutes;
|
|---|
| 289 | ULONG hours;
|
|---|
| 290 | ULONG day;
|
|---|
| 291 | ULONG month;
|
|---|
| 292 | ULONG year;
|
|---|
| 293 | };
|
|---|
| 294 |
|
|---|
| 295 | /* This structure describes one heap object. */
|
|---|
| 296 |
|
|---|
| 297 | struct heap_obj
|
|---|
| 298 | {
|
|---|
| 299 | ULONG base; /* Base address */
|
|---|
| 300 | ULONG end; /* End address */
|
|---|
| 301 | ULONG brk; /* Address of first unused byte */
|
|---|
| 302 | };
|
|---|
| 303 |
|
|---|
| 304 | extern BYTE opt_drive;
|
|---|
| 305 | extern ULONG opt_trunc;
|
|---|
| 306 | extern BYTE opt_expand;
|
|---|
| 307 | extern BYTE opt_quote;
|
|---|
| 308 | extern ULONG debug_flags;
|
|---|
| 309 | extern HMTX common_mutex;
|
|---|
| 310 | extern BYTE debug_same_sess;
|
|---|
| 311 | extern HFILE errout_handle;
|
|---|
| 312 | extern HEV signal_sem;
|
|---|
| 313 | extern HEV kbd_sem_new;
|
|---|
| 314 | extern ULONG stack_base;
|
|---|
| 315 | extern ULONG stack_end;
|
|---|
| 316 | extern BYTE exe_name[];
|
|---|
| 317 | extern HFILE exe_fhandle;
|
|---|
| 318 | extern BYTE exe_heap;
|
|---|
| 319 | extern BYTE nocore_flag;
|
|---|
| 320 | extern BYTE no_popup;
|
|---|
| 321 | extern thread_data *threads[];
|
|---|
| 322 | extern ULONG layout_flags;
|
|---|
| 323 | extern BYTE interface;
|
|---|
| 324 | extern ULONG umask_bits;
|
|---|
| 325 | extern ULONG umask_bits1;
|
|---|
| 326 | extern char *startup_env;
|
|---|
| 327 | extern layout_table *layout;
|
|---|
| 328 | extern char kbd_started;
|
|---|
| 329 | extern ULONG my_pid;
|
|---|
| 330 | extern BYTE fork_flag;
|
|---|
| 331 | extern ULONG fork_exec_pid;
|
|---|
| 332 | extern char const signal_valid[NSIG];
|
|---|
| 333 | extern ULONG uflags;
|
|---|
| 334 | extern int zombie_count;
|
|---|
| 335 | extern char sig_flag;
|
|---|
| 336 | extern BYTE dont_doskillthread;
|
|---|
| 337 | extern ULONG version_major;
|
|---|
| 338 | extern ULONG version_minor;
|
|---|
| 339 | extern ULONG heap_obj_size;
|
|---|
| 340 | extern unsigned heap_obj_count;
|
|---|
| 341 | extern char first_heap_obj_fixed;
|
|---|
| 342 | extern ULONG heap_off;
|
|---|
| 343 | extern struct heap_obj *top_heap_obj;
|
|---|
| 344 | extern struct heap_obj heap_objs[MAX_HEAP_OBJS];
|
|---|
| 345 | extern BYTE ptrace_forking;
|
|---|
| 346 | extern ULONG ptrace_fork_addr;
|
|---|
| 347 |
|
|---|
| 348 | #if defined (INCL_DOSPROCESS)
|
|---|
| 349 | extern PIB *init_pib_ptr;
|
|---|
| 350 | #endif
|
|---|
| 351 |
|
|---|
| 352 | #if defined (INCL_DOSEXCEPTIONS)
|
|---|
| 353 | extern EXCEPTIONREGISTRATIONRECORD *exc_reg_ptr;
|
|---|
| 354 | #endif
|
|---|
| 355 |
|
|---|
| 356 | /* The following variables reside in a shared data object and are
|
|---|
| 357 | defined in emxdll.asm. */
|
|---|
| 358 |
|
|---|
| 359 | /* Counter for creating unique names for named pipes. */
|
|---|
| 360 |
|
|---|
| 361 | extern ULONG pipe_number;
|
|---|
| 362 |
|
|---|
| 363 | /* Counter for creating unique names for queues. */
|
|---|
| 364 |
|
|---|
| 365 | extern ULONG queue_number;
|
|---|
| 366 |
|
|---|
| 367 | /* This array holds reference counts for socket handles:
|
|---|
| 368 | sock_proc_count[S] is the number of processes referencing socket
|
|---|
| 369 | handle S. The per-process reference count is maintained in *files,
|
|---|
| 370 | see files.h. Fortunately, the range of socket handles of IBM
|
|---|
| 371 | TCP/IP is bound: all socket handles are less than 2048; see
|
|---|
| 372 | FD_SETSIZE in IBM's <sys/socket.h>. */
|
|---|
| 373 |
|
|---|
| 374 | extern ULONG sock_proc_count[MAX_SOCKETS];
|
|---|
| 375 |
|
|---|
| 376 |
|
|---|
| 377 | /* Access to shared data should be enclosed in LOCK_COMMON and
|
|---|
| 378 | UNLOCK_COMMON. */
|
|---|
| 379 |
|
|---|
| 380 | #define LOCK_COMMON do_lock_common ()
|
|---|
| 381 | #define UNLOCK_COMMON DosReleaseMutexSem (common_mutex)
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 | /* Prototypes. */
|
|---|
| 385 |
|
|---|
| 386 | void truncate_name (char *dst, const char *src);
|
|---|
| 387 | ULONG set_error (ULONG rc);
|
|---|
| 388 | int xlate_errno (int e);
|
|---|
| 389 | void child_started (void);
|
|---|
| 390 | void start_cwait_thread (void);
|
|---|
| 391 | ULONG kbd_avail (void);
|
|---|
| 392 | int termio_read (ULONG handle, char *dst, unsigned count, int *errnop);
|
|---|
| 393 | void otext (const char *msg);
|
|---|
| 394 | void odword (ULONG x);
|
|---|
| 395 | void core_dump (void);
|
|---|
| 396 | ULONG core_main (ULONG handle);
|
|---|
| 397 | void core_regs_i (syscall_frame *frame);
|
|---|
| 398 | void generate_signal (thread_data *td, int signo);
|
|---|
| 399 | thread_data *get_thread (void);
|
|---|
| 400 | int get_tid (void);
|
|---|
| 401 | int proc_check (int pid);
|
|---|
| 402 | ULONG querysysinfo (ULONG index);
|
|---|
| 403 | unsigned long long get_clock (int init_flag);
|
|---|
| 404 | void init_signal16 (void);
|
|---|
| 405 | void touch (void *base, ULONG count);
|
|---|
| 406 | void conout (UCHAR chr);
|
|---|
| 407 | ULONG load_module (const char *mod_name, HMODULE *phmod);
|
|---|
| 408 | int verify_memory (ULONG start, ULONG size);
|
|---|
| 409 |
|
|---|
| 410 | #if defined (INCL_DOSEXCEPTIONS)
|
|---|
| 411 | void core_regs_e (CONTEXTRECORD *context);
|
|---|
| 412 | int initthread (EXCEPTIONREGISTRATIONRECORD *registration);
|
|---|
| 413 | void unwind (EXCEPTIONREGISTRATIONRECORD *registration,
|
|---|
| 414 | EXCEPTIONREPORTRECORD *report);
|
|---|
| 415 | int deliver_pending_signals (thread_data *td, syscall_frame *frame,
|
|---|
| 416 | CONTEXTRECORD *context_record);
|
|---|
| 417 | #endif
|
|---|
| 418 |
|
|---|
| 419 | void init_fileio (void);
|
|---|
| 420 | void init_process (void);
|
|---|
| 421 | void init_fork (const char *s);
|
|---|
| 422 | void init_exceptions (void);
|
|---|
| 423 | void initialize1 (void);
|
|---|
| 424 | void initialize2 (void);
|
|---|
| 425 | void init2_signal (void);
|
|---|
| 426 | void term_process (void);
|
|---|
| 427 | void term_memory (void);
|
|---|
| 428 | void term_semaphores (void);
|
|---|
| 429 | void term_tcpip (void);
|
|---|
| 430 | void term_signal (void);
|
|---|
| 431 | ULONG setmem (ULONG base, ULONG size, ULONG flags, ULONG error);
|
|---|
| 432 | ULONG setmem_error (ULONG rc);
|
|---|
| 433 | void *checked_private_alloc (ULONG size);
|
|---|
| 434 | ULONG private_alloc (void **mem, ULONG size);
|
|---|
| 435 | ULONG private_free (void *mem);
|
|---|
| 436 | void error (ULONG rc, const char *msg);
|
|---|
| 437 | int conv_hex8 (const char *s, ULONG *dst);
|
|---|
| 438 | void receive_signals (void);
|
|---|
| 439 | ULONG reset_event_sem (HEV sem);
|
|---|
| 440 | sigfun *do_signal (ULONG signo, sigfun *handler, syscall_frame *frame);
|
|---|
| 441 | void do_raise (int signo, syscall_frame *frame);
|
|---|
| 442 | int do_kill (int signo, int pid, syscall_frame *frame, int *errnop);
|
|---|
| 443 | void sig_block_start (void);
|
|---|
| 444 | void sig_block_end (void);
|
|---|
| 445 | ULONG set_alarm (ULONG value);
|
|---|
| 446 | void stop_alarm (void);
|
|---|
| 447 | ULONG do_wait (ULONG *ptermstatus, ULONG *errnop);
|
|---|
| 448 | ULONG do_waitpid (ULONG pid, ULONG opt, ULONG *ptermstatus,
|
|---|
| 449 | ULONG *errnop);
|
|---|
| 450 | void init_heap (void);
|
|---|
| 451 | long do_sbrk (long incr);
|
|---|
| 452 | long do_brk (ULONG brkp);
|
|---|
| 453 | int do_fcntl (ULONG handle, ULONG request, ULONG arg, int *errnop);
|
|---|
| 454 | int do_ioctl1 (ULONG handle, int *errnop);
|
|---|
| 455 | int do_ioctl2 (ULONG handle, ULONG request, ULONG arg, int *errnop);
|
|---|
| 456 | int do_dup (ULONG handle, ULONG target, int *errnop);
|
|---|
| 457 | int do_close (ULONG handle);
|
|---|
| 458 | ULONG do_read (ULONG handle, void *dst, ULONG count, int *errnop);
|
|---|
| 459 | ULONG do_write (ULONG handle, void *src, ULONG count, int *errnop);
|
|---|
| 460 | ULONG do_seek (ULONG handle, ULONG origin, LONG distance, int *errnop);
|
|---|
| 461 | int do_pipe (int *dst, ULONG pipesize);
|
|---|
| 462 | int do_ftruncate (ULONG handle, ULONG fsize);
|
|---|
| 463 | int do_chsize (ULONG handle, ULONG fsize);
|
|---|
| 464 | int do_fsync (ULONG handle, int *errnop);
|
|---|
| 465 | int do_filesys (char *dst, ULONG dst_size, const char *drv_name, int *errnop);
|
|---|
| 466 | int do_mkdir (const char *path);
|
|---|
| 467 | int do_rmdir (const char *path);
|
|---|
| 468 | int do_chdir (const char *path);
|
|---|
| 469 | int do_delete (const char *path);
|
|---|
| 470 | int do_rename (const char *old_path, const char *new_path);
|
|---|
| 471 | UCHAR do_getdrive (void);
|
|---|
| 472 | ULONG do_selectdisk (ULONG drv);
|
|---|
| 473 | int old_creat (const char *path, ULONG attr, int *errnop);
|
|---|
| 474 | int old_open (const char *path, ULONG mode, int *errnop);
|
|---|
| 475 | int sys_open (const char *path, unsigned flags, unsigned long size,
|
|---|
| 476 | int *errnop);
|
|---|
| 477 | int do_stat (const char *path, struct stat *dst, int *errnop);
|
|---|
| 478 | int do_fstat (ULONG handle, struct stat *dst, int *errnop);
|
|---|
| 479 | int do_utimes (const char *path, const struct timeval *tv, int *errnop);
|
|---|
| 480 | int do_ttyname (char *dst, ULONG dst_size, ULONG handle, int *errnop);
|
|---|
| 481 | void do_lock_common (void);
|
|---|
| 482 | ULONG create_event_sem (HEV *psem, ULONG attr);
|
|---|
| 483 | void close_event_sem (HEV sem);
|
|---|
| 484 | ULONG create_mutex_sem (HMTX *psem);
|
|---|
| 485 | void request_mutex (HMTX sem);
|
|---|
| 486 | ULONG create_muxwait_sem (HMUX *psem, ULONG count, SEMRECORD *array,
|
|---|
| 487 | ULONG attr);
|
|---|
| 488 | void close_muxwait_sem (HMUX sem);
|
|---|
| 489 | ULONG get_attr (const char *path, int *errnop);
|
|---|
| 490 | ULONG set_attr (const char *path, ULONG attr);
|
|---|
| 491 | ULONG do_getcwd (char *dst, int drive);
|
|---|
| 492 | ULONG do_find_first (const char *path, ULONG attr, struct _find *dst);
|
|---|
| 493 | ULONG do_find_next (struct _find *dst);
|
|---|
| 494 | ULONG do_get_timestamp (ULONG handle, ULONG *time, ULONG *date);
|
|---|
| 495 | ULONG do_set_timestamp (ULONG handle, ULONG time, ULONG date);
|
|---|
| 496 | ULONG do_imphandle (ULONG handle, int *errnop);
|
|---|
| 497 | int check_npipe (const char *s);
|
|---|
| 498 | int set_ttyname (char *dst, ULONG dst_size, const char *name, int *errnop);
|
|---|
| 499 | void fork_register_mem (ULONG start, ULONG end, HMODULE hmod);
|
|---|
| 500 | void fork_register_dll (HMODULE hmod);
|
|---|
| 501 | int fork_dll_registered (HMODULE hmod);
|
|---|
| 502 | void copy_fork (void);
|
|---|
| 503 | void fileio_fork_parent_init (void);
|
|---|
| 504 | void fileio_fork_parent_fillin (struct fork_data_done *p);
|
|---|
| 505 | void fileio_fork_parent_restore (void);
|
|---|
| 506 | void fileio_fork_child (struct fork_data_done *p);
|
|---|
| 507 | ULONG new_thread (ULONG tid, int *errnop);
|
|---|
| 508 | ULONG end_thread (ULONG tid, int *errnop);
|
|---|
| 509 | void kbd_stop (void);
|
|---|
| 510 | void kbd_init (void);
|
|---|
| 511 | void kbd_restart (void);
|
|---|
| 512 | void quit (ULONG rc) __attribute__ ((noreturn));
|
|---|
| 513 | void do_ftime (struct timeb *dst);
|
|---|
| 514 | int do_settime (const struct timeval *tp, int *errnop);
|
|---|
| 515 | ULONG do_spawn (struct _new_proc *np, ULONG *result);
|
|---|
| 516 | void do_pause (void);
|
|---|
| 517 | int do_ptrace (ULONG request, ULONG pid, ULONG addr, ULONG data,
|
|---|
| 518 | ULONG *errnop);
|
|---|
| 519 | ULONG spawn_debug (ULONG pid, ULONG sid);
|
|---|
| 520 | int do_fork (syscall_frame *frame, ULONG *errnop);
|
|---|
| 521 | int do_select (struct _select *args, int *errnop);
|
|---|
| 522 | int execname (char *buf, ULONG bufsize);
|
|---|
| 523 | void debug_set_wait (ULONG pid, ULONG tid, ULONG wait_ret, ULONG end);
|
|---|
| 524 | ULONG proc_add_attach (ULONG pid);
|
|---|
| 525 | void proc_remove_attach (ULONG pid);
|
|---|
| 526 | void unix2time (struct my_datetime *dst, ULONG src);
|
|---|
| 527 | ULONG packed2unix (FDATE date, FTIME time);
|
|---|
| 528 | int kbd_input (UCHAR *dst, int binary_p, int echo_p, int wait_p,
|
|---|
| 529 | int check_avail_p);
|
|---|
| 530 | void conin_string (UCHAR *buf);
|
|---|
| 531 | int sprintf (char *dst, const char *fmt, ...);
|
|---|
| 532 | void oprintf (const char *fmt, ...);
|
|---|
| 533 | ULONG get_dbcs_lead (void);
|
|---|
| 534 | ULONG query_async (ULONG handle);
|
|---|
| 535 | ULONG translate_async (ULONG handle);
|
|---|
| 536 | void init_termio (ULONG handle);
|
|---|
| 537 | void termio_set (ULONG handle, const struct termio *tio);
|
|---|
| 538 | void termio_get (ULONG handle, struct termio *tio);
|
|---|
| 539 | void termios_set (ULONG handle, const struct termios *tio);
|
|---|
| 540 | void termios_get (ULONG handle, struct termios *tio);
|
|---|
| 541 | void termio_flush (ULONG handle);
|
|---|
| 542 | ULONG termio_avail (ULONG handle);
|
|---|
| 543 | ULONG async_avail (ULONG handle);
|
|---|
| 544 | ULONG async_writable (ULONG handle);
|
|---|
| 545 | int do_profil (const struct _profil *p, int *errnop);
|
|---|
| 546 |
|
|---|
| 547 | void exit_tcpip (void);
|
|---|
| 548 | int tcpip_init_fork (const struct fork_data_done *p);
|
|---|
| 549 | void copy_fork_sock (const struct fork_data_done *p);
|
|---|
| 550 | void tcpip_fork_sock (struct fork_data_done *p);
|
|---|
| 551 | void tcpip_undo_fork_sock (const struct fork_data_done *p);
|
|---|
| 552 |
|
|---|
| 553 | int pm_init (void);
|
|---|
| 554 | void pm_term (void);
|
|---|
| 555 | void pm_message_box (PCSZ text);
|
|---|
| 556 |
|
|---|
| 557 | #if defined (_SIGSET_T)
|
|---|
| 558 | int do_sigaction (int sig, const struct sigaction *iact,
|
|---|
| 559 | struct sigaction *oact);
|
|---|
| 560 | int do_sigpending (sigset_t *set);
|
|---|
| 561 | int do_sigprocmask (int how, const sigset_t *iset, sigset_t *oset,
|
|---|
| 562 | syscall_frame *frame);
|
|---|
| 563 | int do_sigsuspend (const sigset_t *mask);
|
|---|
| 564 | #endif
|
|---|
| 565 |
|
|---|
| 566 | ULONG xf86sup_query (ULONG handle, ULONG *pflags);
|
|---|
| 567 | int xf86sup_avail (ULONG handle, int *errnop);
|
|---|
| 568 | int xf86sup_ioctl (ULONG handle, ULONG request, ULONG arg, int *errnop);
|
|---|
| 569 | int xf86sup_fcntl (ULONG handle, ULONG request, ULONG arg, int *errnop);
|
|---|
| 570 | int xf86sup_select_add_read (struct select_data *d, int fd);
|
|---|
| 571 | int xf86sup_ttyname (char *dst, ULONG dst_size, ULONG handle, int *errnop);
|
|---|
| 572 | ULONG xf86sup_uncond_enadup (ULONG handle, ULONG on);
|
|---|
| 573 | ULONG xf86sup_maybe_enadup (ULONG handle, ULONG on);
|
|---|
| 574 | void xf86sup_all_enadup (ULONG on);
|
|---|