Commit Graph

21237 Commits

Author SHA1 Message Date
Jon Turney c431f6b7fe
Cygwin: pthread: Take note of schedparam in pthread_create
Take note of schedparam in any pthread_attr_t passed to pthread_create.

postcreate() (racily, after the thread is actually created), sets the
scheduling priority if it's inherited, but precreate() doesn't store any
scheduling priority explicitly set via a non-default attr to
pthread_create, so schedparam.sched_priority has the default value of 0.

(I think this is another long-standing bug exposed by 4b51e4c1.  Now we
don't lie about the actual thread priority, it's apparent it's not
really being set in this case.)

Fixes testcase priority2.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-18 14:18:45 +01:00
Jordi Sanfeliu 661f9f9c5a Change getlogin() to only check stdin being null 2023-07-17 15:05:35 -04:00
Jon Turney fee0c04e30
Cygwin: testsuite: Drop Adminstrator privileges while running tests
Test access05 and symlink03 expect operations to fail which succeed when
we have Adminstrator privileges.

There's perhaps a bit of incoherency here: some XFAILed tests expect to
run as root (so maybe we need the ability to selectively cygdrop?).

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:48 +01:00
Jon Turney 10e50f9617
Cygwin: testsuite: Minor fixes to umask03
Change TCIDs to they match the filename
Fix use of "%0" rather than "%o"
Record failure on mismatched permissions, rather than immediately breaking

See ltp commits fa31d55d, 923b23ff and b846e7bb

fa31d55d34
923b23ff1f
b846e7bb9c

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:47 +01:00
Jon Turney 0e8227bbb7
Cygwin: testsuite: Fix a buffer overflow in symlink01
full_path needs to hold a overlong pathname of length PATH_MAX+1, plus a
terminating null.

See ltp commit 44d51c3f

44d51c3f06

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:46 +01:00
Jon Turney e867f8c3e8
Cygwin: testsuite: Busy-wait in cancel3 and cancel5
These tests async thread cancellation of a thread that doesn't have any
cancellation points.

Unfortunately, since 2b165a45 the async cancellation silently fails when
the thread is inside the kernel function Sleep(), so it just exits
normally after 10 seconds. (See the commentary in pthread::cancel() in
thread.cc, where it checks if the target thread is inside the kernel,
and silently converts the cancellation into a deferred one)

Work around this by busy-waiting rather than Sleep()ing for 10 seconds.

This is still somewhat fragile: the async cancel could still fail, if it
happens to occur while we're inside the kernel function that time()
calls.

v2:
Do nothing more efficiently

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:45 +01:00
Jon Turney 7d50e65a84
Cygwin: testsuite: Fix for limited thread priority values
Since commit 4b51e4c1, we return the actual thread priority, not what we
originally stored in the thread attributes.

Windows only supports 7 thread priority levels, which we map onto the 32
required by POSIX.  So, only a subset of values will be returned exactly
by by pthread_getschedparam() after pthread_setschedparam().

Adjust tests priority1, priority2 and inherit1 so they only check for
round-tripping priority values which can be exactly represented.

For CI, this needs to handle process priority class "below normal
priority" as well.

Also check that the range of priority values is at least 32, as required
by POSIX.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:44 +01:00
Jon Turney 79a9288434
Cygwin: testsuite: Also check direct call in systemcall
Check direct call to system(), as well as one in a subprocess.

(This is a lot easier to debug when it's completely broken by the
environment the test is running in)

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:43 +01:00
Jon Turney 7c0750e962
Cygwin: testsuite: Just log result of second open of /dev/dsp
Do not rate successful second open of /dev/dsp as an error, just log the
result.

Based on this patch by Gerd Spalink:

https://cygwin.com/pipermail/cygwin-patches/2004q3/004848.html
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:42 +01:00
Jon Turney 9776357323
Cygwin: testsuite: Skip devdsp test when no audio devices present
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:41 +01:00
Jon Turney 04326f999b
Cygwin: testsuite: Remove const from writable string in fcntl07b
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:39 +01:00
Jon Turney 328258eba4
Cygwin: testsuite: Add a simple timeout mechanism
Astonishingly, we don't have this already, so tests which hang just stop
the testsuite dead in it's tracks...

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:38 +01:00
Jon Turney e8c1a579cd
Cygwin: testsuite: Setup test prereqs in 'installation' the tests run in
Do some setup in the Cygwin 'installation' at testsuite/testinst/:

* Ensure /tmp exists

* Use BusyBox to provide executables needed by tests which use system()
(sh, sleep, ls)

This enables tests which use system(), or require /tmp to exist to pass.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2023-07-14 14:02:37 +01:00
Alexey Lapshin b7c3a63bb3 newlib: posix: add HAVE_OPENDIR build condition for [n]ftw.c 2023-07-13 19:58:29 +02:00
Mark Geisert c836d26d76 Cygwin: Update release/3.4.8 for latest <sys/cpuset.h> commit 2023-07-13 12:15:37 +02:00
Mark Geisert 3f2790e044 Cygwin: Make gcc-specific code in <sys/cpuset.h> compiler-agnostic
The current version of <sys/cpuset.h> cannot be compiled by Clang due to
the use of builtin versions of malloc, free, and memset.  Their presence
here was a dubious optimization anyway, so their usage has been
converted to standard library functions.

The use of __builtin_popcountl remains because Clang implements it just
like gcc does.  If/when some other compiler (Rust? Go?) runs into this
issue we can deal with specialized handling then.

The "#include <sys/cdefs>" here to define __inline can be removed since
both of the new includes sub-include it.

Addresses: https://cygwin.com/pipermail/cygwin/2023-July/253927.html
Fixes: 9cc910dd33a5 (Cygwin: Make <sys/cpuset.h> safe for c89 compilations)
Signed-off-by: Mark Geisert <mark@maxrnd.com>
2023-07-10 10:42:24 +02:00
Takashi Yano b03601a671 Cygwin: fstat(): Fix st_rdev returned by fstat() for /dev/tty.
While st_rdev returned by fstat() for /dev/tty should be FH_TTY,
the current cygwin1.dll returns FH_PTYS+minor or FH_CONS+minor.
Similarly, fstat() does not return correct value for /dev/console,
/dev/conout, /dev/conin or /dev/ptmx.

This patch fixes the issue by:
1) Introduce dev_referred_via in fhandler_termios.
2) Add new argument, which has dev_t value referred by open(),
  for constructors of fhandler_pty_slave and fhandler_pty_master to
  set the value of dev_referred_via.
3) Set st_rdev using dev_referred_via in fhandler_termios::fstat()
  if it is available.

Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-07-08 08:03:22 +09:00
Takashi Yano 3edb55af82 Cygwin: stat(): Fix "Bad address" error on stat() for /dev/tty.
As reported in
https://cygwin.com/pipermail/cygwin/2023-June/253888.html,
"Bad address" error occurs when stat() is called after the commit
3721a756b0 ("Cygwin: console: Make the console accessible from
other terminals.").

There are two problems in the current code. One is fhandler_console::
fstat() calls get_ttyp()->getsid(). However, fh_alloc() in dtable.cc
omits to initialize the fhandler_console instance when stat() is
called. Due to this, get_ttyp() returns NULL and access violation
occurs. The other problem is fh_alloc() assigns fhandler_console
even if the CTTY is not a console. So the first problem above occurs
even if the CTTY is a pty.

This patch fixes the issue by:
1) Call set_unit() to initialize _tc if the get_ttyp() returns NULL.
2) Assign fhandler_pty_slave for /dev/tty if CTTY is a pty in fh_alloc().

Fixes: 3721a756b0 ("Cygwin: console: Make the console accessible
  from other terminals.").
Fixes: 23771fa1f7 ("dtable.cc (fh_alloc): Make different decisions
  when generating fhandler for not-opened devices. Add kludge to deal
  with opening /dev/tty.")
Reported-by: Bruce Jerrick <bmj001@gmail.com>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-07-08 08:03:16 +09:00
Corinna Vinschen e38f91d5a9 Cygwin: Fix latest release message being in the wrong release file.
Fixes: 6422e76637 ("Cygwin: Make <sys/cpuset.h> safe for c89 compilations")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-07-04 16:50:37 +02:00
Mark Geisert 6422e76637 Cygwin: Make <sys/cpuset.h> safe for c89 compilations
Four modifications to include/sys/cpuset.h:
* Change C++-style comments to C-style also supported by C++
* Change "inline" to "__inline" on code lines
* Add "#include <sys/cdefs.h>" to make sure __inline is defined
* Don't declare loop variables on for-loop init clauses

Tested by first reproducing the reported issue with home-grown test
programs by compiling with gcc option "-std=c89", then compiling again
using the modified <sys/cpuset.h>. Other "-std=" options tested too.

Addresses: https://cygwin.com/pipermail/cygwin-patches/2023q3/012308.html
Fixes: 315e5fbd99ec ("Cygwin: Fix type mismatch on sys/cpuset.h")
Signed-off-by: Mark Geisert <mark@maxrnd.com>
2023-07-04 15:39:12 +02:00
Takashi Yano bfb16b0ede Cygwin: thread: Reset _my_tls.tid if it's pthread_null in init_mainthread().
Currently, _my_tls.tid is set to pthread_null if pthread::self()
is called before pthread::init_mainthread(). As a result, pthread::
init_mainthread() does not set _my_tls.tid appropriately. Due to
this, pthread_join() fails in LDAP environment if the program is
the first program which loads cygwin1.dll.

https://cygwin.com/pipermail/cygwin/2023-June/253792.html

With this patch, _my_tls.tid is re-initialized in pthread::
init_mainthread() if it is pthread_null.

Reported-by: Mümin A. <muminaydin06@gmail.com>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-06-27 22:10:43 +09:00
Thomas Schwinge 4c7d0dfec5 For GCC, newlib combined tree, newlib build-tree testing, use standard search paths
For example, for GCC/GCN target (AMD GPUs), target libraries are built
individually per supported hardware ISA ('-march=[...]').  Testing such a
toolchain via, for example:

    $ make RUNTESTFLAGS='--target_board=[...]/-march=gfx90a' check[...]

... does work fine for all 'check-gcc-[...]' as well as GCC-provided target
libraries, 'check-target-[...]'.  Just for 'check-target-newlib', for the
example above, not the '-march=gfx90a' newlib libraries are linked in, but
instead always the default ones, which results in link FAILure.  This is cured
simply by skipping use of 'newlib/testsuite/lib/flags.exp', so that the
standard search paths as determined by GCC, DejaGnu are used for newlib, too.
2023-06-22 21:41:30 +02:00
Mingye Wang 6b2ae32ecd Make SIG2STR_MAX usable in #if
The text accepted for POSIX issue 8 requires that SIG2STR_MAX be usable
in #if, which we currently break with sizeof. Use static values instead.
2023-06-21 15:15:03 +02:00
Brian Inglis 6604db8b80 fhandler/proc.cc: use wincap.has_user_shstk
In test for AMD/Intel Control flow Enforcement Technology user mode
shadow stack support replace Windows version tests with test of wincap
member addition has_user_shstk with Windows version dependent value

Fixes: 41fdb869f9 ("fhandler/proc.cc(format_proc_cpuinfo): Add Linux 6.3 cpuinfo")
Signed-off-by: Brian Inglis <Brian.Inglis@Shaw.ca>
2023-06-20 10:06:56 +02:00
Brian Inglis 1c4a00962f wincap.cc: set wincap member has_user_shstk true for 2004+
Signed-off-by: Brian Inglis <Brian.Inglis@Shaw.ca>
2023-06-20 10:06:56 +02:00
Brian Inglis 293785382c wincap.h: add wincap member has_user_shstk
Indicate support of user mode hardware-enforced shadow stack

Signed-off-by: Brian Inglis <Brian.Inglis@Shaw.ca>
2023-06-20 10:06:56 +02:00
Philippe Cerfon 0480315010 Cygwin: use new XATTR_{NAME,SIZE}_MAX instead of MAX_EA_{NAME,VALUE}_LEN
Signed-off-by: Philippe Cerfon <philcerf@gmail.com>
2023-06-16 21:44:41 +02:00
Philippe Cerfon 538b29a8da Cygwin: export XATTR_{NAME,SIZE,LIST}_MAX
These are used for example by CPython.

Signed-off-by: Philippe Cerfon <philcerf@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-06-16 21:44:41 +02:00
Johannes Schindelin 80ff7bc26c Do not rely on `getenv ("HOME")`'s path conversion
In the very early code path where `dll_crt0_1 ()` calls
`user_shared->initialize ()`, the Cygwin runtime calls `internal_pwsid ()`
to initialize the user name in preparation for reading the `fstab` file.

In case `db_home: env` is defined in `/etc/nsswitch.conf`, we need to
look at the environment variable `HOME` and use it, if set.

When all of this happens, though, the `pinfo_init ()` function has had no
chance to run yet (and therefore, `environ_init ()`). At this stage,
therefore, `getenv ()`'s `findenv_func ()` call still finds `getearly ()`
and we get the _verbatim_ value of `HOME`. That is, the Windows form.
But we need the "POSIX" form.

To add insult to injury, later calls to `getpwuid (getuid ())` will
receive a cached version of the home directory via
`cygheap->pg.pwd_cache.win.find_user ()` thanks to the first
`internal_pwsid ()` call caching the result via
`add_user_from_cygserver ()`, read: we will never receive the converted
`HOME` but always the Windows variant.

So, contrary to the assumptions made in 27376c60a9 (Allow deriving the
current user's home directory via the HOME variable, 2023-03-28), we
cannot assume that `getenv ("HOME")` returned a "POSIX" path.

This is a real problem. Even setting aside that common callers of
`getpwuid ()` (such as OpenSSH) are unable to handle Windows paths in the
`pw_dir` attribute, the Windows path never makes it back to the caller
unscathed. The value returned from `fetch_home_env ()` is not actually
used as-is. Instead, the `fetch_account_from_windows ()` method uses it
to write a pseudo `/etc/passwd`-formatted line that is _then_ parsed via
the `pwdgrp::parse_passwd ()` method which sees no problem with
misinterpreting the colon after the drive letter as a field separator of
that `/etc/passwd`-formatted line, and instead of a Windows path, we now
have a mere drive letter.

Let's detect when the `HOME` value is still in Windows format in
`fetch_home_env ()`, and convert it in that case.

For good measure, interpret this "Windows format" not only to include
absolute paths with drive prefixes, but also UNC paths.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-06 15:18:53 +02:00
Johannes Schindelin e9dd5d8f25 uinfo: special-case IIS APPPOOL accounts
The account under which Azure Web Apps run is an IIS APPOOL account that
is generated on the fly.

These are special because the virtual machines on which thes Apps run
are not domain-joined, yet the accounts are domain accounts.

To support the use case where such a Web App needs to call `ssh` (e.g.
to deploy from a Git repository that is accessible only via SSH), we do
need OpenSSH's `getpwuid (getuid ())` invocation to work.

But currently it does not. Concretely, `getuid ()` returns -1 for these
accounts, and OpenSSH fails to find the correct home directory
(_especially_ when that home directory was overridden via a `db_home:
env` line in `/etc/nsswitch.conf`).

This can be verified e.g. in a Kudu console (for details about Kudu
consoles, see https://github.com/projectkudu/kudu/wiki/Kudu-console):
the domain is `IIS APPPOOL`, the account name is the name of the Azure
Web App, the SID starts with 'S-1-5-82-`, and
`pwdgrp::fetch_account_from_windows()` runs into the code path where
"[...] the domain returned by LookupAccountSid is not our machine name,
and if our machine is no domain member, we lose.  We have nobody to ask
for the POSIX offset."

Since these IIS APPPOOL accounts are relatively similar to AzureAD
accounts in this scenario, let's imitate the latter to support also the
former.

Reported-by: David Ebbo <david.ebbo@gmail.com>
Helped-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-06-06 15:18:53 +02:00
Takashi Yano a903878948 Cygwin: pty: Additional fix for transferring input at exit.
The commit 9fc746d17d does not fix transferring input at exit
appropriately. If the more than one non-cygwin apps are executed
simultaneously and one of them is terminated, the pty master failed
to send input to the other non-cygwin apps. This patch fixes that.

Fixes: 9fc746d17d ("Cygwin: pty: Fix transferring type-ahead input between input pipes.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-06-02 10:19:18 +09:00
Takashi Yano 9fc746d17d Cygwin: pty: Fix transferring type-ahead input between input pipes.
After the commit e5fcc5837c, transferring type-ahead input between
the pipe for cygwin app and the pipe for non-cygwin app will not be
done appropriately when the stdin of the non-cygwin app is not pty.
Due to this issue, sometimes the keyboard input might be lost which
should be sent to cygwin app. This patch fixes the issue.

Fixes: e5fcc5837c ("Cygwin: pty: Fix reading CONIN$ when stdin is not a pty.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2023-06-01 20:00:45 +09:00
Chris Packham 28489b0702 config/mt-d30v: Append flags
Append to CFLAGS_FOR_TARGET/CXXFLAGS_FOR_TARGET rather than replacing
them.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-05-30 13:55:09 -04:00
Remy Bohmer e79304d7b4 m68k: disallow unaligned access for m68010 and m68020
Disable at least  m68010 and m68020. These processors certainly do not
like unaligned accesses.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Signed-off-by: Austin Morton <austinpmorton@gmail.com>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-05-30 13:54:32 -04:00
Johannes Schindelin 4840a56325
Cygwin: Adjust CWD magic to accommodate for the latest Windows previews
Reportedly Windows 11 build 25*** from Insider changed the current
working directory logic a bit, and Cygwin's "magic" (or:
"technologically sufficiently advanced") code needs to be adjusted
accordingly.

This fixes https://github.com/git-for-windows/git/issues/4429

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-05-24 20:44:52 +01:00
Alexey Lapshin e7858c0a58 fix __time_load_locale return code
- add explicit __HAVE_LOCALE_INFO__ check
2023-05-17 17:47:54 -04:00
Jennifer Averett 9ae9eef21d Regenerated source for adding non LDBL_EQ_DBL 2023-05-16 09:05:36 -05:00
Jennifer Averett 048ebea981 newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64
Rename s_nearbyint.c, s_fdim.c and s_scalbln.c to remove conflicts
    Remove functions that are not needed from above files
    Modify include paths
    Add includes missing in cygwin build
    Add missing types
    Create Makefiles
    Create header files to resolve dependencies between directories
    Modify some instances of unsigned long to uint64_t for 32 bit platforms
    Add HAVE_FPMATH_H
2023-05-16 09:05:36 -05:00
Jennifer Averett c630a6a837 newlib: Add FreeBSD files for non LDBL_EQ_DBL support
FreeBSD files to add long double support for i386,
aarch64 and x86_64.
2023-05-16 09:05:36 -05:00
Brian Inglis 41fdb869f9
fhandler/proc.cc(format_proc_cpuinfo): Add Linux 6.3 cpuinfo
cpuid    0x00000007:0 ecx:7 shstk Shadow Stack support & Windows [20]20H1/[20]2004+
		    => user_shstk User mode program Shadow Stack support
AMD SVM  0x8000000a:0 edx:25 vnmi virtual Non-Maskable Interrrupts
Sync AMD 0x80000008:0 ebx flags across two output locations
2023-05-12 16:12:11 +01:00
Jennifer Averett 8144619bad Regenerated source for moving signgam.c 2023-05-05 14:50:15 -04:00
Jennifer Averett 742b8db95d Move signgm.c from libc/reent to libm/math 2023-05-05 14:49:48 -04:00
Biswapriyo Nath 3bee68248f
Cygwin: Fix compiling with w32api-headers v11.0.0
This solves redefinition of FILE_CS_FLAG_CASE_SENSITIVE_DIR in winnt.h
and fixes the following compiler errors

ntdll.h:523:3: error: expected identifier before numeric constant
  523 |   FILE_CS_FLAG_CASE_SENSITIVE_DIR                       = 0x01
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ntdll.h:522:1: note: to match this ‘{’
  522 | {
      | ^
2023-05-01 11:40:52 +01:00
Jon Turney d160bcd4aa
Cygwin: doc: Upate a link from gitweb to cgit
Also, reword 'considerable patch' to be more idomatic.
2023-05-01 11:29:15 +01:00
Sebastian Huber e301a74a6f Fix _REENT_EMERGENCY() if TLS is enabled
If the thread-local storage (TLS) support was enabled, the _REENT_EMERGENCY()
object had the wrong size.  It must be a buffer of length _REENT_EMERGENCY_SIZE
and not just a single character.
2023-04-26 08:23:04 +02:00
Corinna Vinschen c3798a2f7d Cygwin: locales: drop unused has_modifier macro
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-24 22:41:41 +02:00
Corinna Vinschen 48ae24fd81 Cygwin: locales: ignore @cjkwide and @cjksingle just like @cjknarrow
When the @cjkwide and @cjksingle modifiers have been added, the
patches missed to add checks for the new modifiers in the Cygwin
locale code.  Along the same lines, commit c3e7f7609e forgot to
add a test for @cjksingle.

Merge check for cjk* modifiers into a macro set andf use that
throughout. Fix comments.

Fixes: f92f048528 ("Locale modifier @cjkwide to adjust ambiguous-width in non-CJK locales")
Fixes: c8204b1069 ("Locale modifier "@cjksingle" to enforce single-width CJK width.")
Fixes: c3e7f7609e ("Cygwin: locales: fix behaviour for @cjk* and @euro locales")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-24 22:41:41 +02:00
Sebastian Huber fd26d4b4b6 RTEMS: Add __m68k_read_tp() to crt0.c
This is required to build libgomp.
2023-04-24 10:21:42 +02:00
Corinna Vinschen da40bd6eaf Cygwin: posix_spawnp: don't fallback to sh
Per the discussion starting with
https://cygwin.com/pipermail/cygwin/2023-April/253495.html
stop falling back to sh if the file given to posix_spawnp
is no executable.

This is not necessarily the last word on it, given
https://www.austingroupbugs.net/view.php?id=1674, but for now,
opt for following the proposal in the Austin Group bug entry,
as well as PASSing the GNULIB test-posix_spawnp-script test.

Fixes: c7c1a1ca1b ("Add support for new posix_spawn function.")
Fixes: 3fbfcd11fb ("Cygwin: posix_spawn: add Cygwin-specific code fixing process synchronisation")
Reported-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-19 21:08:48 +02:00
Corinna Vinschen 3124d8b436 posix_spawn_file_actions_addfchdir_np: return EBADF on negative fd
FreeBSD and Musl implement posix_spawn_file_actions_addfchdir_np
so that it checks the incoming descriptor for being negative, and,
if so, return with EBADF.  The POSIX proposal defining
posix_spawn_file_actions_addfchdir follows this behaviour, see
https://www.austingroupbugs.net/view.php?id=1208

Fixes: 7e03fc35f5 ("Add posix_spawn_file_actions_add{f}chdir_np")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-04-19 20:48:14 +02:00