Cygwin: pty: Limit API hook to the program linked with the APIs.

- API hook used for pseudo console support causes slow down.
  This patch limits API hook to only program which is linked
  with the corresponding APIs. Normal cygwin program is not
  linked with such APIs (such as WriteFile, etc...) directly,
  therefore, no slow down occurs. However, console access by
  cygwin.dll itself cannot switch the r/w pipe to pseudo console
  side. Therefore, the code to switch it forcely to pseudo
  console side is added to smallprint.cc and strace.cc.
This commit is contained in:
Takashi Yano
2019-09-04 22:46:51 +09:00
committed by Corinna Vinschen
parent 583102e7c9
commit 83b2d576c8
4 changed files with 65 additions and 70 deletions

View File

@@ -216,6 +216,9 @@ void init_console_handler (bool);
extern bool wsock_started;
/* PTY related */
void set_ishybrid_and_switch_to_pcon (HANDLE h);
/* Printf type functions */
extern "C" void vapi_fatal (const char *, va_list ap) __attribute__ ((noreturn));
extern "C" void api_fatal (const char *, ...) __attribute__ ((noreturn));