Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-08-12 09:35:42 +0400
committerChristopher Faylor <me@cgf.cx>2000-08-12 09:35:42 +0400
commite2ebe11776cc41f91fe14d695ff9902fa9a58cb7 (patch)
tree4f705618b5156799291433cde2b795b005db4044 /winsup/cygwin/dtable.h
parent3ee92b51d6b44784783b09615f103a5ca656b3e3 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/dtable.h')
-rw-r--r--winsup/cygwin/dtable.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/winsup/cygwin/dtable.h b/winsup/cygwin/dtable.h
new file mode 100644
index 000000000..64ffc496f
--- /dev/null
+++ b/winsup/cygwin/dtable.h
@@ -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;