return close_on_exec () ? &sec_none_nih : &sec_none;
}
+ virtual int fixup_before_fork_exec (DWORD) { return 0; }
virtual void fixup_after_fork (HANDLE);
virtual void fixup_after_exec ();
void create_read_state (LONG n)
/* fixup fd possibly non-inherited handles after fork */
bool fork_fixup (HANDLE, HANDLE &, const char *);
+ virtual bool need_fixup_before () const {return false;}
virtual int open (int, mode_t = 0);
int open_fs (int, mode_t = 0);
virtual int tcsetpgrp (const pid_t pid);
virtual int tcgetpgrp ();
virtual bool is_tty () const { return false; }
- virtual bool isdevice () { return true; }
- virtual bool isfifo () { return false; }
+ virtual bool ispipe () const { return false; }
+ virtual pid_t get_popen_pid () const {return 0;}
+ virtual bool isdevice () const { return true; }
+ virtual bool isfifo () const { return false; }
virtual char *ptsname () { return NULL;}
virtual class fhandler_socket *is_socket () { return NULL; }
virtual class fhandler_console *is_console () { return 0; }
bool is_fs_special () {return pc.is_fs_special ();}
bool issymlink () {return pc.issymlink ();}
bool device_access_denied (int) __attribute__ ((regparm (2)));
- int fhaccess (int flags) __attribute__ ((regparm (2)));
+ int fhaccess (int flags, bool) __attribute__ ((regparm (3)));
};
class fhandler_mailslot : public fhandler_base
{
+ POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &, PUNICODE_STRING);
public:
fhandler_mailslot ();
int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
void wmem (int nwmem) { _wmem = nwmem; }
private:
+ struct _WSAPROTOCOL_INFOW *prot_info_ptr;
+ public:
+ void init_fixup_before ();
+ bool need_fixup_before () const {return prot_info_ptr != NULL;}
+
+ private:
char *sun_path;
+ char *peer_sun_path;
struct status_flags
{
unsigned async_io : 1; /* async I/O */
int dup (fhandler_base *child);
void set_close_on_exec (bool val);
+ int fixup_before_fork_exec (DWORD);
void fixup_after_fork (HANDLE);
+ void fixup_after_exec ();
char *get_proc_fd_name (char *buf);
select_record *select_read (select_stuff *);
int get_socket_type () {return type;}
void set_sun_path (const char *path);
char *get_sun_path () {return sun_path;}
+ void set_peer_sun_path (const char *path);
+ char *get_peer_sun_path () {return peer_sun_path;}
int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstatvfs (struct statvfs *buf) __attribute__ ((regparm (2)));
OVERLAPPED *get_overlapped_buffer () {return &io_status;}
void set_overlapped (OVERLAPPED *ov) {overlapped = ov;}
+ bool ispipe() const { return true; }
+
void set_popen_pid (pid_t pid) {popen_pid = pid;}
pid_t get_popen_pid () const {return popen_pid;}
_off64_t lseek (_off64_t offset, int whence);
int open (int, mode_t);
int close ();
int dup (fhandler_base *child);
- bool isfifo () { return true; }
+ bool isfifo () const { return true; }
void set_close_on_exec (bool val);
int __stdcall fstatvfs (struct statvfs *buf) __attribute__ ((regparm (2)));
OVERLAPPED *get_overlapped () {return &io_status;}
int open (int flags, mode_t mode);
int lock (int, struct __flock64 *);
- bool isdevice () { return false; }
+ bool isdevice () const { return false; }
int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fchmod (mode_t mode) __attribute__ ((regparm (1)));
int __stdcall fchown (__uid32_t uid, __gid32_t gid) __attribute__ ((regparm (2)));
};
int ndrives;
const char *pdrive;
- char pdrive_buf[2 * 26 * DRVSZ];
+ char pdrive_buf[1 + (2 * 26 * DRVSZ)];
void set_drives ();
public:
fhandler_cygdrive ();
inline UINT get_console_cp ();
DWORD con_to_str (char *d, int dlen, WCHAR w);
- DWORD str_to_con (mbtowc_p, char *, PWCHAR d, const char *s, DWORD sz);
+ DWORD str_to_con (mbtowc_p, const char *, PWCHAR d, const char *s, DWORD sz);
void set_color (HANDLE);
bool fillin_info (HANDLE);
void set_default_attr ();
int dup (fhandler_base *);
void fixup_after_fork (HANDLE parent);
void fixup_after_exec ();
+ int tcgetpgrp ();
};
class fhandler_tty_master: public fhandler_pty_master