user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/6] use POSIX::PIPE_BUF (instead of _POSIX_PIPE_BUF)
  2021-09-13 20:53  5% [PATCH 0/6] a batch of misc fixes Eric Wong
@ 2021-09-13 20:53  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-09-13 20:53 UTC (permalink / raw)
  To: meta

PIPE_BUF accounts for Linux being 4096 (and presumably other
OSes differing), while _POSIX_PIPE_BUF is the minimum 512
value.
---
 lib/PublicInbox/Git.pm | 4 +---
 t/run.perl             | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 219a1732..5ef1db2f 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -27,9 +27,7 @@ our $PIPE_BUFSIZ = 65536; # Linux default
 our $in_cleanup;
 our $RDTIMEO = 60_000; # milliseconds
 
-use constant MAX_INFLIGHT =>
-	(($^O eq 'linux' ? 4096 : POSIX::_POSIX_PIPE_BUF()) * 3)
-	/
+use constant MAX_INFLIGHT => (POSIX::PIPE_BUF * 3) /
 	65; # SHA-256 hex size + "\n" in preparation for git using non-SHA1
 
 my %GIT_ESC = (
diff --git a/t/run.perl b/t/run.perl
index 5082125b..b0ee611a 100755
--- a/t/run.perl
+++ b/t/run.perl
@@ -18,7 +18,7 @@ use PublicInbox::Spawn;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use Errno qw(EINTR);
 use Fcntl qw(:seek);
-use POSIX qw(_POSIX_PIPE_BUF WNOHANG);
+use POSIX qw(WNOHANG);
 use File::Temp ();
 my $jobs = 1;
 my $repeat = 1;
@@ -199,7 +199,7 @@ for (my $i = $repeat; $i != 0; $i--) {
 	pipe(my ($rd, $wr)) or DIE "pipe: $!";
 
 	# fill the queue before forking so children can start earlier
-	my $n = (_POSIX_PIPE_BUF / UINT_SIZE);
+	my $n = (POSIX::PIPE_BUF / UINT_SIZE);
 	if ($n >= $#todo) {
 		print $wr join('', map { pack('I', $_) } (0..$#todo)) or DIE;
 		undef $wr;

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] a batch of misc fixes
@ 2021-09-13 20:53  5% Eric Wong
  2021-09-13 20:53  7% ` [PATCH 3/6] use POSIX::PIPE_BUF (instead of _POSIX_PIPE_BUF) Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-09-13 20:53 UTC (permalink / raw)
  To: meta

Eric Wong (6):
  tests: add require_cmd, require curl when needed
  lei: stop_pager: restore stdout when done
  use POSIX::PIPE_BUF (instead of _POSIX_PIPE_BUF)
  lei up: localize %ENV in redispatch
  lei_xsearch: sensible errors for missing/broken externals
  lei up: fix --mua with single output

 lib/PublicInbox/Git.pm        |  4 +---
 lib/PublicInbox/LEI.pm        | 12 +++++-------
 lib/PublicInbox/LeiUp.pm      | 26 ++++++++++++++++----------
 lib/PublicInbox/LeiXSearch.pm |  5 ++++-
 lib/PublicInbox/TestCommon.pm | 20 +++++++++++++-------
 t/ds-leak.t                   |  9 +++------
 t/hl_mod.t                    |  9 ++-------
 t/httpd-corner.t              | 11 ++++-------
 t/imapd.t                     |  1 -
 t/lei-daemon.t                |  1 -
 t/lei-externals.t             |  8 ++++----
 t/lei-import-http.t           |  3 +--
 t/lei-mirror.t                |  1 +
 t/lei-q-remote-import.t       |  1 +
 t/lei-up.t                    |  4 ++++
 t/lei.t                       |  4 +---
 t/nntpd.t                     |  7 ++-----
 t/nodatacow.t                 | 10 ++++------
 t/run.perl                    |  4 ++--
 t/solver_git.t                |  4 ++--
 t/v2mirror.t                  |  6 ++----
 t/v2reindex.t                 |  8 ++------
 t/www_altid.t                 |  8 +++-----
 t/www_listing.t               |  8 ++------
 24 files changed, 79 insertions(+), 95 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-09-13 20:53  5% [PATCH 0/6] a batch of misc fixes Eric Wong
2021-09-13 20:53  7% ` [PATCH 3/6] use POSIX::PIPE_BUF (instead of _POSIX_PIPE_BUF) Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).