Files
RedBear-OS/recipes/shells/bash/source/builtins/psize.sh
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

46 lines
1.0 KiB
Bash

#! /bin/sh
#
# psize.sh -- determine this system's pipe size, and write a define to
# pipesize.h so ulimit.c can use it.
: ${TMPDIR:=/tmp}
# try to use mktemp(1) if the system supports it
{ TMPFILE="`mktemp $TMPDIR/pipsize.XXXXXX 2>/dev/null`"; } 2>/dev/null
used_mktemp=true
if [ -z "$TMPFILE" ]; then
TMPNAME=pipsize.$$
TMPFILE=$TMPDIR/$TMPNAME
used_mktemp=false
fi
trap 'rm -f "$TMPFILE" ; exit 1' 1 2 3 6 15
trap 'rm -f "$TMPFILE"' 0
echo "/*"
echo " * pipesize.h"
echo " *"
echo " * This file is automatically generated by psize.sh"
echo " * Do not edit!"
echo " */"
echo ""
#
# Try to avoid tempfile races. We can't really check for the file's
# existence before we run psize.aux, because `test -e' is not portable,
# `test -h' (test for symlinks) is not portable, and `test -f' only
# checks for regular files. If we used mktemp(1), we're ahead of the
# game.
#
$used_mktemp || rm -f "$TMPFILE"
./psize.aux 2>"$TMPFILE" | sleep 3
if [ -s "$TMPFILE" ]; then
echo "#define PIPESIZE `cat "$TMPFILE"`"
else
echo "#define PIPESIZE 512"
fi
exit 0