OSDN Git Service

* winsup.h: Split out dtable definitions into separate header file.
authorcgf <cgf>
Sat, 12 Aug 2000 05:35:42 +0000 (05:35 +0000)
committercgf <cgf>
Sat, 12 Aug 2000 05:35:42 +0000 (05:35 +0000)
* dtable.h: New file.
* sigproc.h: Eliminate pinfo.h usage here.  Use it in source files that need
it.

43 files changed:
winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/debug.cc
winsup/cygwin/dir.cc
winsup/cygwin/dtable.cc
winsup/cygwin/dtable.h [new file with mode: 0644]
winsup/cygwin/environ.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/external.cc
winsup/cygwin/fcntl.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_serial.cc
winsup/cygwin/fhandler_termios.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/fork.cc
winsup/cygwin/grp.cc
winsup/cygwin/heap.cc
winsup/cygwin/ioctl.cc
winsup/cygwin/mmap.cc
winsup/cygwin/net.cc
winsup/cygwin/passwd.cc
winsup/cygwin/path.cc
winsup/cygwin/pinfo.cc
winsup/cygwin/pipe.cc
winsup/cygwin/poll.cc
winsup/cygwin/resource.cc
winsup/cygwin/security.cc
winsup/cygwin/select.cc
winsup/cygwin/shared.cc
winsup/cygwin/signal.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/sigproc.h
winsup/cygwin/spawn.cc
winsup/cygwin/strace.cc
winsup/cygwin/syscalls.cc
winsup/cygwin/sysconf.cc
winsup/cygwin/syslog.cc
winsup/cygwin/termios.cc
winsup/cygwin/thread.cc
winsup/cygwin/times.cc
winsup/cygwin/tty.cc
winsup/cygwin/uinfo.cc
winsup/cygwin/winsup.h

index 722a572..83736c2 100644 (file)
@@ -1,3 +1,10 @@
+Sat Aug 12 01:33:12 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * winsup.h: Split out dtable definitions into separate header file.
+       * dtable.h: New file.
+       * sigproc.h: Eliminate pinfo.h usage here.  Use it in source files that
+       need it.
+
 Sat Aug 12 01:08:11 2000  Christopher Faylor <cgf@cygnus.com>
 
        * Makefile.in: Use dtable.o rather than hinfo.o.
index aa00a3a..e14447a 100644 (file)
@@ -16,6 +16,8 @@ details. */
 #include "dll_init.h"
 #include "autoload.h"
 #include <ctype.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 #define MAX_AT_FILE_LEVEL 10
 
@@ -730,7 +732,7 @@ dll_crt0_1 ()
     }
 
   /* Allocate fdtab */
-  fdtab_init ();
+  dtable_init ();
 
 /* Initialize uid, gid. */
   uinfo_init ();
index 23cd83c..e83b13a 100644 (file)
@@ -10,6 +10,7 @@ details. */
 #include "winsup.h"
 #include "exceptions.h"
 #include "perthread.h"
+#include "pinfo.h"
 
 static muto NO_COPY *threadname_lock = NULL;
 #define lock_threadname() \
index f9cb83b..07d0e34 100644 (file)
@@ -13,6 +13,7 @@ details. */
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include "pinfo.h"
 
 #define _COMPILING_NEWLIB
 #include "dirent.h"
index 45c0680..716770a 100644 (file)
@@ -20,12 +20,14 @@ details. */
 #include <fcntl.h>
 
 #include <winsock.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 dtable fdtab;
 
 /* Set aside space for the table of fds */
 void
-fdtab_init (void)
+dtable_init (void)
 {
   if (!fdtab.size)
     fdtab.extend(NOFILE_INCR);
diff --git a/winsup/cygwin/dtable.h b/winsup/cygwin/dtable.h
new file mode 100644 (file)
index 0000000..64ffc49
--- /dev/null
@@ -0,0 +1,44 @@
+/* dtable.h: fd table definition.
+
+   Copyright 2000 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+class dtable
+{
+  fhandler_base **fds;
+  fhandler_base **fds_on_hold;
+  int first_fd_for_open;
+public:
+  size_t size;
+  dtable () {first_fd_for_open = 3;}
+  int vfork_child_dup ();
+  void vfork_parent_restore ();
+  fhandler_base *dup_worker (fhandler_base *oldfh);
+  int extend (int howmuch);
+  void fixup_after_fork (HANDLE);
+  fhandler_base *build_fhandler (int fd, DWORD dev, const char *name,
+                                int unit = -1);
+  fhandler_base *build_fhandler (int fd, const char *name, HANDLE h);
+  int not_open (int n);
+  int find_unused_handle (int start);
+  int find_unused_handle () { return find_unused_handle (first_fd_for_open);}
+  void release (int fd);
+  void init_std_file_from_handle (int fd, HANDLE handle, DWORD access, const char *name);
+  int dup2 (int oldfd, int newfd);
+  int linearize_fd_array (unsigned char *buf, int buflen);
+  LPBYTE de_linearize_fd_array (LPBYTE buf);
+  fhandler_base *operator [](int fd) { return fds[fd]; }
+  select_record *select_read (int fd, select_record *s);
+  select_record *select_write (int fd, select_record *s);
+  select_record *select_except (int fd, select_record *s);
+  operator fhandler_base **() {return fds;}
+};
+
+void dtable_init (void);
+void stdio_init (void);
+extern dtable fdtab;
index c081b70..dfb53a8 100644 (file)
@@ -13,6 +13,7 @@ details. */
 #include <stddef.h>
 #include <ctype.h>
 #include <fcntl.h>
+#include "pinfo.h"
 
 extern BOOL allow_glob;
 extern BOOL allow_ntea;
index 7452e94..52e333c 100644 (file)
@@ -15,6 +15,7 @@ details. */
 
 #include "exceptions.h"
 #include <imagehlp.h>
+#include "pinfo.h"
 
 char debugger_command[2 * MAX_PATH + 20];
 
index f31d349..0d08011 100644 (file)
@@ -11,6 +11,7 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
 #include "winsup.h"
+#include "pinfo.h"
 
 static external_pinfo *
 fillout_pinfo (pid_t pid, int winpid)
index 793e432..6f64bd9 100644 (file)
@@ -13,6 +13,7 @@ details. */
 #include <stdarg.h>
 #include <errno.h>
 #include <unistd.h>
+#include "dtable.h"
 
 extern "C"
 int
index 564e4e2..7388dda 100644 (file)
@@ -22,6 +22,7 @@ details. */
 #include <wingdi.h>
 #include <winuser.h>
 #include <ctype.h>
+#include "pinfo.h"
 
 /*
  * Scroll the screen context.
index 6ceb71e..80f0904 100644 (file)
@@ -13,6 +13,7 @@ details. */
 #include <errno.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include "pinfo.h"
 
 /**********************************************************************/
 /* fhandler_serial */
index 410a936..3e3b5b6 100644 (file)
@@ -14,6 +14,7 @@ details. */
 #include <unistd.h>
 #include <errno.h>
 #include <ctype.h>
+#include "pinfo.h"
 
 /* Common functions shared by tty/console */
 
index 6491ed9..2c80701 100644 (file)
@@ -16,6 +16,8 @@ details. */
 #include <errno.h>
 #include <ctype.h>
 #include <limits.h>
+#include "pinfo.h"
+#include "dtable.h"
 
 /* Tty master stuff */
 
index 1f0a007..6181b24 100644 (file)
@@ -16,6 +16,8 @@ details. */
 #include <stdarg.h>
 #include <errno.h>
 #include "dll_init.h"
+#include "dtable.h"
+#include "pinfo.h"
 
 DWORD NO_COPY chunksize = 0;
 /* Timeout to wait for child to start, parent to init child, etc.  */
index f7f86de..8e1171a 100644 (file)
@@ -15,6 +15,7 @@ details. */
 #include <grp.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include "pinfo.h"
 
 /* Read /etc/group only once for better performance.  This is done
    on the first call that needs information from it. */
index b3dc488..53bace4 100644 (file)
@@ -10,6 +10,7 @@ details. */
 
 #include "winsup.h"
 #include <errno.h>
+#include "pinfo.h"
 
 #define brksize ((char *) user_data->heaptop - (char *) user_data->heapbase)
 #define brk (user_data->heapptr)
index 51022ee..e232ae3 100644 (file)
@@ -14,6 +14,7 @@ details. */
 #include "winsup.h"
 #include <sys/ioctl.h>
 #include <errno.h>
+#include "dtable.h"
 
 extern "C"
 int
index 400b575..bef6b4b 100644 (file)
@@ -13,7 +13,8 @@ details. */
 #include <stddef.h>
 #include <sys/mman.h>
 #include <errno.h>
-
+#include "dtable.h"
+#include "pinfo.h"
 
 /*
  * Simple class used to keep a record of all current
index 00d988f..e0b5a08 100644 (file)
@@ -23,6 +23,8 @@ details. */
 #include <fcntl.h>
 #include "autoload.h"
 #include <winsock.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 /* We only want to initialize WinSock in a child process if socket
    handles are inheritted. This global allows us to know whether this
index 6dd0129..d5f8b15 100644 (file)
@@ -13,6 +13,8 @@ details. */
 #include <pwd.h>
 #include <stdio.h>
 #include <errno.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 /* Read /etc/passwd only once for better performance.  This is done
    on the first call that needs information from it. */
index fe1c385..8ab7316 100644 (file)
@@ -81,6 +81,7 @@ details. */
 #include <errno.h>
 #include <ctype.h>
 #include <winioctl.h>
+#include "pinfo.h"
 
 static int normalize_win32_path (const char *cwd, const char *src, char *dst);
 static char *getcwd_inner (char *buf, size_t ulen, int posix_p, int with_chroot);
index 02d3cf6..49ef499 100644 (file)
@@ -13,6 +13,8 @@ details. */
 #include <time.h>
 #include <errno.h>
 #include <limits.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 static char NO_COPY pinfo_dummy[sizeof(pinfo)] = {0};
 
index 951e9f4..c001c55 100644 (file)
@@ -12,6 +12,7 @@ details. */
 #include <unistd.h>
 #include <sys/fcntl.h>
 #include <errno.h>
+#include "dtable.h"
 
 static int
 make_pipe (int fildes[2], unsigned int psize, int mode)
index 6804619..2121d28 100644 (file)
@@ -11,6 +11,7 @@
 #include <sys/poll.h>
 #include <errno.h>
 #include "winsup.h"
+#include "dtable.h"
 
 extern "C"
 int
index a456f24..330e147 100644 (file)
@@ -14,6 +14,7 @@ details. */
 
 #include "winsup.h"
 #include <errno.h>
+#include "pinfo.h"
 
 /* add timeval values */
 static void
index 09c732d..98bf59c 100644 (file)
@@ -22,6 +22,8 @@ details. */
 #include <sys/stat.h>
 #include <sys/acl.h>
 #include <ctype.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 extern BOOL allow_ntea;
 BOOL allow_ntsec = FALSE;
index 3b23b39..8c630ee 100644 (file)
@@ -33,6 +33,7 @@ details. */
 #include <stdio.h>
 #include <winsock.h>
 #include "select.h"
+#include "dtable.h"
 
 /*
  * All these defines below should be in sys/types.h
index ff8dd3d..e44c725 100644 (file)
@@ -14,6 +14,7 @@ details. */
 #include <stdlib.h>
 #include <grp.h>
 #include <pwd.h>
+#include "pinfo.h"
 
 #define SHAREDVER (unsigned)(cygwin_version.api_major << 16 | \
                   cygwin_version.api_minor)
index 332034f..5695b4d 100644 (file)
@@ -13,6 +13,7 @@ details. */
 
 #include "winsup.h"
 #include <errno.h>
+#include "pinfo.h"
 
 extern "C"
 _sig_func_ptr
index aba39d6..1bd9bcd 100644 (file)
@@ -16,6 +16,7 @@ details. */
 #include <sys/wait.h>
 #include <errno.h>
 #include <stdlib.h>
+#include "pinfo.h"
 
 extern BOOL allow_ntsec;
 
index f7b36a8..683e1d9 100644 (file)
@@ -94,8 +94,7 @@ int __stdcall handle_sigsuspend (sigset_t);
 
 int __stdcall proc_subproc (DWORD, DWORD);
 
-#include "pinfo.h"
-
+class _pinfo;
 void __stdcall proc_terminate ();
 void __stdcall sigproc_init ();
 void __stdcall subproc_init ();
index af5ac6c..6ac71e1 100644 (file)
@@ -19,7 +19,9 @@ details. */
 #include <wingdi.h>
 #include <winuser.h>
 #include <ctype.h>
-#include "paths.h"
+#include <paths.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 extern BOOL allow_ntsec;
 
index 0470897..457cd22 100644 (file)
@@ -14,6 +14,7 @@ details. */
 #include <wingdi.h>
 #include <winuser.h>
 #include <ctype.h>
+#include "pinfo.h"
 
 #define PROTECT(x) x[sizeof(x)-1] = 0
 #define CHECK(x) if (x[sizeof(x)-1] != 0) { small_printf("array bound exceeded %d\n", __LINE__); ExitProcess(1); }
index 2fa0643..4acec27 100644 (file)
@@ -24,6 +24,8 @@ details. */
 #include <unistd.h>
 #include <winnls.h>
 #include <lmcons.h> /* for UNLEN */
+#include "dtable.h"
+#include "pinfo.h"
 
 extern BOOL allow_ntsec;
 
index 75bf69f..05131d9 100644 (file)
@@ -13,6 +13,7 @@ details. */
 #include <errno.h>
 #include <time.h>
 #include <limits.h>
+#include "dtable.h"
 
 /* sysconf: POSIX 4.8.1.1 */
 /* Allows a portable app to determine quantities of resources or
index 50ef80b..b0c4789 100644 (file)
@@ -14,6 +14,7 @@ details. */
 #include <syslog.h>
 #include <stdarg.h>
 #include <unistd.h>
+#include "dtable.h"
 
 /* FIXME: These should probably be in the registry. */
 /* FIXME: The Win95 path should be whatever slash is */
index 4b8a996..6a5736b 100644 (file)
@@ -13,6 +13,7 @@ details. */
 
 #include "winsup.h"
 #include <errno.h>
+#include "dtable.h"
 
 /* tcsendbreak: POSIX 7.2.2.1 */
 extern "C"
index 2335d60..6f40a68 100644 (file)
@@ -18,9 +18,9 @@ details. */
 #include "winsup.h"
 #include <errno.h>
 #include <assert.h>
-
 #include <stdlib.h>
 #include <syslog.h>
+#include "pinfo.h"
 
 extern int threadsafe;
 
index 28763e1..fa8cdb5 100644 (file)
@@ -16,7 +16,7 @@ details. */
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
-
+#include "pinfo.h"
 
 #define FACTOR (0x19db1ded53ea710LL)
 #define NSPERSEC 10000000LL
index fa55b26..1aa182c 100644 (file)
@@ -14,6 +14,8 @@ details. */
 #include <utmp.h>
 #include <wingdi.h>
 #include <winuser.h>
+#include "dtable.h"
+#include "pinfo.h"
 
 extern fhandler_tty_master *tty_master;
 
index d752d69..a9cb227 100644 (file)
@@ -18,6 +18,7 @@ details. */
 #include <stdlib.h>
 #include <wchar.h>
 #include <lm.h>
+#include "pinfo.h"
 
 char *
 internal_getlogin (_pinfo *pi)
index f3794f5..3c9e519 100644 (file)
@@ -113,7 +113,6 @@ extern int dynamically_loaded;
 extern HANDLE hMainThread;
 extern HANDLE hMainProc;
 
-/* Now that pinfo has been defined, include... */
 #include "debug.h"
 #include "sync.h"
 #include "sigproc.h"
@@ -131,36 +130,6 @@ extern "C" per_process __cygwin_user_data; /* Pointer into application's static
    Do not change this value. */
 #define SIZEOF_PER_PROCESS (42 * 4)
 
-class dtable
-{
-  fhandler_base **fds;
-  fhandler_base **fds_on_hold;
-  int first_fd_for_open;
-public:
-  size_t size;
-  dtable () {first_fd_for_open = 3;}
-  int vfork_child_dup ();
-  void vfork_parent_restore ();
-  fhandler_base *dup_worker (fhandler_base *oldfh);
-  int extend (int howmuch);
-  void fixup_after_fork (HANDLE parent);
-  fhandler_base *build_fhandler (int fd, DWORD dev, const char *name,
-                                int unit = -1);
-  fhandler_base *build_fhandler (int fd, const char *name, HANDLE h);
-  int not_open (int n);
-  int find_unused_handle (int start);
-  int find_unused_handle () { return find_unused_handle (first_fd_for_open);}
-  void release (int fd);
-  void init_std_file_from_handle (int fd, HANDLE handle, DWORD access, const char *name);
-  int dup2 (int oldfd, int newfd);
-  int linearize_fd_array (unsigned char *buf, int buflen);
-  LPBYTE de_linearize_fd_array (LPBYTE buf);
-  fhandler_base *operator [](int fd) { return fds[fd]; }
-  select_record *select_read (int fd, select_record *s);
-  select_record *select_write (int fd, select_record *s);
-  select_record *select_except (int fd, select_record *s);
-};
-
 /******************* Host-dependent constants **********************/
 /* Portions of the cygwin DLL require special constants whose values
    are dependent on the host system.  Rather than dynamically
@@ -320,11 +289,6 @@ void environ_init (int);
 void heap_init (void);
 void malloc_init (void);
 
-/* fd table */
-void fdtab_init (void);
-void stdio_init (void);
-extern dtable fdtab;
-
 /* UID/GID */
 void uinfo_init (void);