From: Olamide Caleb Bello <belkid98@gmail.com>
To: git@vger.kernel.org
Cc: phillip.wood123@gmail.com, gitster@pobox.com,
christian.couder@gmail.com, usmanakinyemi202@gmail.com,
kaartic.sivaraam@gmail.com, me@ttaylorr.com
Subject: [PATCH v3 1/8] Revert "compat/posix: introduce writev(3p) wrapper"
Date: Thu, 23 Apr 2026 17:08:25 +0100 [thread overview]
Message-ID: <20260423160832.114816-2-belkid98@gmail.com> (raw)
In-Reply-To: <20260423160832.114816-1-belkid98@gmail.com>
From: Junio C Hamano <gitster@pobox.com>
This reverts commit 3b9b2c2a29a1d529ca9884fa0a6529f6e2496abe; let's
not use writev() for now.
---
Makefile | 4 ----
compat/posix.h | 14 --------------
compat/writev.c | 44 --------------------------------------------
config.mak.uname | 2 --
meson.build | 1 -
5 files changed, 65 deletions(-)
delete mode 100644 compat/writev.c
diff --git a/Makefile b/Makefile
index 5d22394c2e..cedc234173 100644
--- a/Makefile
+++ b/Makefile
@@ -2029,10 +2029,6 @@ ifdef NO_PREAD
COMPAT_CFLAGS += -DNO_PREAD
COMPAT_OBJS += compat/pread.o
endif
-ifdef NO_WRITEV
- COMPAT_CFLAGS += -DNO_WRITEV
- COMPAT_OBJS += compat/writev.o
-endif
ifdef NO_FAST_WORKING_DIRECTORY
BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
endif
diff --git a/compat/posix.h b/compat/posix.h
index 94699a03fa..faaae1b655 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -137,9 +137,6 @@
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/statvfs.h>
-#ifndef NO_WRITEV
-#include <sys/uio.h>
-#endif
#include <termios.h>
#ifndef NO_SYS_SELECT_H
#include <sys/select.h>
@@ -326,17 +323,6 @@ int git_lstat(const char *, struct stat *);
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
#endif
-#ifdef NO_WRITEV
-#define writev git_writev
-#define iovec git_iovec
-struct git_iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-ssize_t git_writev(int fd, const struct iovec *iov, int iovcnt);
-#endif
-
#ifdef NO_SETENV
#define setenv gitsetenv
int gitsetenv(const char *, const char *, int);
diff --git a/compat/writev.c b/compat/writev.c
deleted file mode 100644
index 3a94870a2f..0000000000
--- a/compat/writev.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "../git-compat-util.h"
-#include "../wrapper.h"
-
-ssize_t git_writev(int fd, const struct iovec *iov, int iovcnt)
-{
- size_t total_written = 0;
- size_t sum = 0;
-
- /*
- * According to writev(3p), the syscall shall error with EINVAL in case
- * the sum of `iov_len` overflows `ssize_t`.
- */
- for (int i = 0; i < iovcnt; i++) {
- if (iov[i].iov_len > maximum_signed_value_of_type(ssize_t) ||
- iov[i].iov_len + sum > maximum_signed_value_of_type(ssize_t)) {
- errno = EINVAL;
- return -1;
- }
-
- sum += iov[i].iov_len;
- }
-
- for (int i = 0; i < iovcnt; i++) {
- const char *bytes = iov[i].iov_base;
- size_t iovec_written = 0;
-
- while (iovec_written < iov[i].iov_len) {
- ssize_t bytes_written = xwrite(fd, bytes + iovec_written,
- iov[i].iov_len - iovec_written);
- if (bytes_written < 0) {
- if (total_written)
- goto out;
- return bytes_written;
- }
- if (!bytes_written)
- goto out;
- iovec_written += bytes_written;
- total_written += bytes_written;
- }
- }
-
-out:
- return (ssize_t) total_written;
-}
diff --git a/config.mak.uname b/config.mak.uname
index ccb3f71881..5feb582558 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -459,7 +459,6 @@ ifeq ($(uname_S),Windows)
SANE_TOOL_PATH ?= $(msvc_bin_dir_msys)
HAVE_ALLOCA_H = YesPlease
NO_PREAD = YesPlease
- NO_WRITEV = YesPlease
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
NO_POLL = YesPlease
@@ -675,7 +674,6 @@ ifeq ($(uname_S),MINGW)
pathsep = ;
HAVE_ALLOCA_H = YesPlease
NO_PREAD = YesPlease
- NO_WRITEV = YesPlease
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
NO_POLL = YesPlease
diff --git a/meson.build b/meson.build
index 8309942d18..11488623bf 100644
--- a/meson.build
+++ b/meson.build
@@ -1429,7 +1429,6 @@ checkfuncs = {
'initgroups' : [],
'strtoumax' : ['strtoumax.c', 'strtoimax.c'],
'pread' : ['pread.c'],
- 'writev' : ['writev.c'],
}
if host_machine.system() == 'windows'
--
2.53.0.155.g9f36b15afa
next prev parent reply other threads:[~2026-04-23 16:09 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 12:37 [PATCH v2 0/8] repo_config_values: migrate more globals Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 1/8] environment: move "trust_ctime" into `struct repo_config_values` Olamide Caleb Bello
2026-04-14 8:52 ` Karthik Nayak
2026-04-14 9:35 ` Phillip Wood
2026-04-14 17:15 ` Junio C Hamano
2026-04-15 11:16 ` Karthik Nayak
2026-04-15 15:49 ` Junio C Hamano
2026-04-15 19:09 ` Karthik Nayak
2026-03-24 12:37 ` [PATCH v2 2/8] environment: move "check_stat" " Olamide Caleb Bello
2026-04-14 8:55 ` Karthik Nayak
2026-03-24 12:37 ` [PATCH v2 3/8] environment: move `zlib_compression_level` into repo_config_values Olamide Caleb Bello
2026-04-14 8:58 ` Karthik Nayak
2026-04-14 14:32 ` Bello Olamide
2026-03-24 12:37 ` [PATCH v2 4/8] environment: move "pack_compression_level" into `struct repo_config_values` Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 5/8] environment: move "precomposed_unicode" " Olamide Caleb Bello
2026-04-14 9:07 ` Karthik Nayak
2026-03-24 12:37 ` [PATCH v2 6/8] env: move "core_sparse_checkout_cone" " Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 7/8] env: put "sparse_expect_files_outside_of_patterns" in `repo_config_values` Olamide Caleb Bello
2026-03-24 12:37 ` [PATCH v2 8/8] env: move "warn_on_object_refname_ambiguity" into `repo_config_values` Olamide Caleb Bello
2026-04-14 9:10 ` [PATCH v2 0/8] repo_config_values: migrate more globals Karthik Nayak
2026-04-14 14:26 ` Bello Olamide
2026-04-23 16:08 ` [PATCH v3 " Olamide Caleb Bello
2026-04-23 16:08 ` Olamide Caleb Bello [this message]
2026-04-23 16:08 ` [PATCH v3 2/8] rust: we are way beyond 2.53 Olamide Caleb Bello
2026-04-23 16:08 ` [PATCH v3 3/8] doc: am: revert Message-ID trailer claim Olamide Caleb Bello
2026-04-23 16:08 ` [PATCH v3 4/8] doc: am: correct to full --no-message-id Olamide Caleb Bello
2026-04-23 16:08 ` [PATCH v3 5/8] CI: bump actions/checkout from 4 to 5 for rust-analysis job Olamide Caleb Bello
2026-04-23 16:08 ` [PATCH v3 6/8] gitglossary: fix indentation of sub-lists Olamide Caleb Bello
2026-04-23 16:08 ` [PATCH v3 7/8] Hopefully the final tweak before -rc2 Olamide Caleb Bello
2026-04-23 16:08 ` [PATCH v3 8/8] Git 2.54-rc2 Olamide Caleb Bello
2026-04-23 16:37 ` [PATCH v3 0/8] repo_config_values: migrate more globals Bello Olamide
2026-04-23 16:54 ` [PATCH v3 0/8] environment: move core config globals into repo_config_values Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 1/8] environment: move "trust_ctime" into `struct repo_config_values` Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 2/8] environment: move "check_stat" " Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 3/8] environment: move `zlib_compression_level` " Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 4/8] environment: move "pack_compression_level" " Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 5/8] environment: move "precomposed_unicode" " Olamide Caleb Bello
2026-05-15 17:15 ` Tian Yuchen
2026-04-23 16:54 ` [PATCH v3 6/8] env: move "core_sparse_checkout_cone" " Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 7/8] env: move "sparse_expect_files_outside_of_patterns" into `repo_config_values` Olamide Caleb Bello
2026-04-23 16:54 ` [PATCH v3 8/8] env: move "warn_on_object_refname_ambiguity" into `struct repo_config_values` Olamide Caleb Bello
2026-04-26 0:01 ` [PATCH v3 0/8] environment: move core config globals into repo_config_values Junio C Hamano
2026-04-26 0:31 ` Bello Olamide
2026-05-11 2:56 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260423160832.114816-2-belkid98@gmail.com \
--to=belkid98@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kaartic.sivaraam@gmail.com \
--cc=me@ttaylorr.com \
--cc=phillip.wood123@gmail.com \
--cc=usmanakinyemi202@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox