* Merge in cygwin-64bit-branch.

This commit is contained in:
Corinna Vinschen
2013-04-23 09:44:36 +00:00
parent 1875ee55d3
commit 61522196c7
253 changed files with 10632 additions and 5055 deletions

View File

@@ -69,9 +69,9 @@ public:
int ioctl_retval;
int write_error;
void setntty (_major_t t, int n) {ntty = (fh_devices) FHDEV (t, n);}
int getntty () const {return ntty;}
int get_unit () const {return device::minor (ntty);}
void setntty (_major_t t, _minor_t n) {ntty = (fh_devices) FHDEV (t, n);}
dev_t getntty () const {return ntty;}
_minor_t get_minor () const {return device::minor (ntty);}
pid_t getpgid () const {return pgid;}
void setpgid (int pid) {pgid = pid;}
int getsid () const {return sid;}
@@ -90,7 +90,30 @@ class tty: public tty_min
public:
pid_t master_pid; /* PID of tty master process */
HANDLE from_master, to_master;
private:
/* Since tty is shared, the HANDLEs must be 32 and 64 bit clean. The below
code makes sure of that by setting the upper 4 byte of the union to 0
when writing the handle value from a 32 bit process. Fortunately the
actual values are 32 bit on both platforms, so the HANDLES can be
used on both platforms. */
union {
HANDLE _from_master;
LARGE_INTEGER _fm_dummy;
};
union {
HANDLE _to_master;
LARGE_INTEGER _tm_dummy;
};
public:
HANDLE from_master() const { return _from_master; }
HANDLE to_master() const { return _to_master; }
#ifdef __x86_64__
void set_from_master (HANDLE h) { _from_master = h; }
void set_to_master (HANDLE h) { _to_master = h; }
#else
void set_from_master (HANDLE h) { _fm_dummy.HighPart = 0; _from_master = h; }
void set_to_master (HANDLE h) { _tm_dummy.HighPart = 0; _to_master = h; }
#endif
int read_retval;
bool was_opened; /* True if opened at least once. */