A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and
Go to file
Viktor Szakats 1c49f2f26d
windows: replace _beginthreadex() with CreateThread()
Replace `_beginthreadex()` C runtime calls with native win32 API
`CreateThread()`. The latter was already used in `src/tool_doswin.c`
and in UWP and Windows CE builds before this patch. After this patch
all Windows flavors use it. To drop PP logic and simplify code.

While working on this it turned out that `src/tool_doswin.c` calls
`TerminateThread()`, which isn't recommended by the documentation,
except for "the most extreme cases". This patch makes no attempt
to change that code.
Ref: 9a2663322c #17572
Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread

Also:
- use `WaitForSingleObjectEx()` on all desktop Windows.
  Ref: 4be80d5109
  Ref: https://sourceforge.net/p/curl/feature-requests/82/
  Ref: https://learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-waitforsingleobjectex
- tests: drop redundant casts.
- lib3207: fix to not rely on thread macros when building without thread
  support.

Assisted-by: Jay Satiro
Assisted-by: Marcel Raad
Assisted-by: Michał Petryka
Follow-up to 38029101e2 #11625

Closes #18451
2025-09-20 01:28:35 +02:00
.circleci CI: sync curl download command-line options 2025-07-07 17:34:47 +02:00
.github build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
CMake tidy-up: drop stray "unused" comments 2025-09-03 16:31:16 +02:00
docs build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
include RELEASE-NOTES: synced 2025-09-19 16:47:01 +02:00
lib windows: replace _beginthreadex() with CreateThread() 2025-09-20 01:28:35 +02:00
LICENSES copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
m4 build: support LibreSSL native crypto lib with ngtcp2 1.15.0+ 2025-08-23 15:45:36 +02:00
packages spacecheck: warn for 3+ empty lines in a row, fix fallouts 2025-09-04 20:37:51 +02:00
plan9 copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
projects build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
scripts managen: render better manpage references/links 2025-09-17 15:49:15 +02:00
src tool_getparam/set_rate: skip the multiplication on overflow 2025-09-19 22:54:57 +02:00
tests windows: replace _beginthreadex() with CreateThread() 2025-09-20 01:28:35 +02:00
.dir-locals.el copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
.editorconfig .editorconfig: add 2025-09-02 08:36:40 +02:00
.git-blame-ignore-revs copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
.gitattributes winbuild: MS-DOS batch tidy-ups 2024-07-02 19:26:15 +02:00
.gitignore build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
.mailmap mailmap: unify on James 2025-09-08 09:26:22 +02:00
acinclude.m4 acinclude: --with-ca-fallback only works with OpenSSL 2025-08-22 23:54:14 +02:00
appveyor.sh build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
appveyor.yml build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
buildconf copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CHANGES.md CHANGES: rename to CHANGES.md, no longer generated 2024-08-01 13:37:12 +02:00
CMakeLists.txt clang-tidy: disable clang-analyzer-security.ArrayBound 2025-08-29 03:07:42 +02:00
configure.ac configure: add "-mt" for pthread support on HP-UX 2025-09-17 23:12:43 +02:00
COPYING COPYING: bump copyright year range to 1996 - 2025 2025-01-01 21:12:12 +01:00
curl-config.in curl-config: remove X prefix use 2025-08-04 10:01:07 +02:00
Dockerfile Dockerfile: update debian:bookworm-slim Docker digest to df52e55 2025-09-09 15:28:00 +02:00
GIT-INFO.md build: drop tool_hugehelp.c.cvs, tidy up macros, drop buildconf.bat 2025-01-26 14:22:49 +01:00
libcurl.pc.in configure: do not echo most inherited LDFLAGS to config files 2024-11-14 09:55:45 +01:00
Makefile.am build: drop the winbuild build system 2025-09-20 01:20:25 +02:00
README docs: minor grammar fixes 2022-09-29 10:44:12 +02:00
README.md spacecheck.pl: drop more exceptions 2025-05-13 16:01:07 +02:00
RELEASE-NOTES RELEASE-NOTES: synced 2025-09-19 16:47:01 +02:00
renovate.json ci: fix ldap install location and add renovate rule for openldap 2025-07-15 14:54:44 +01:00
REUSE.toml checksrc: reduce exceptions, apply again to curlx 2025-06-27 17:33:35 +02:00
SECURITY.md docs: Clarify OpenSSF Best Practices vs Scorecard 2024-08-22 11:50:20 +02:00

curl logo

curl is a command-line tool for transferring data specified with URL syntax. Learn how to use curl by reading the manpage or everything curl.

Find out how to install curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl manpage to learn how.

Open Source

curl is Open Source and is distributed under an MIT-like license.

Contact

Contact us on a suitable mailing list or use GitHub issues/ pull requests/ discussions.

All contributors to the project are listed in the THANKS document.

Commercial support

For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.

Website

Visit the curl website for the latest news and downloads.

Source code

Download the latest source from the Git server:

git clone https://github.com/curl/curl.git

Security problems

Report suspected security problems via our HackerOne page and not in public.

Notice

curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.

Backers

Thank you to all our backers 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.