aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/local_includes/shared_info.h
AgeCommit message (Collapse)AuthorFilesLines
2024-07-09Cygwin: console: Fix race issue on allocating console simultaneously.Takashi Yano1-1/+2
Previously, if two or more processes request to allocate a console at the same time, the same device number could be accidentally allocated. This patch fixes the issue by creating a named mutex (input_mutex) and checking if GetLastError() is ERROR_ALREADY_EXIST or not to ensure the unit number will be allocated in an atomic way. Thanks to this, EnumWindow() is not necessary anymore to scan console units. This also makes minor device numbers unique and console devices visible across sessions. This disallows duplicated device number for different sessions, so the MAX_CONS_DEV has been increased from 64 to 128. Additionally, the console allocation and scanning will be faster as a side effect of eliminating EnumWindows(). Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-01-17Cygwin: open_shared: don't reuse shared_locations parameter as outputCorinna Vinschen1-4/+4
For ages, open_shared uses the shared_locations parameter as output to indicate if the mapping for a shared region has been created or just opened. Split this into two parameters. Use the shared_locations parameter as input only, return the creation state of the mapping in a bool reference parameter. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-05Cygwin: Reorganize cygwin source dirCorinna Vinschen1-0/+97
Create subdirs and move files accordingly: - DevDocs: doc files - fhandler: fhandler sources, split fhandler.cc into base.cc and null.cc - local_includes: local include files - scripts: scripts called during build - sec: security sources Signed-off-by: Corinna Vinschen <corinna@vinschen.de>