From 37637ab6b47b3b4e1b39f18ff1a887e75efb9bed Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 9 Jan 2021 00:06:13 +0000 Subject: [PATCH] libast: sfmode: tweak for 64-bit (Solaris 140-MAP_TYPE_64_Bits) This upstreams a Solaris patch: https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/140-MAP_TYPE_64_Bits.patch src/lib/libast/sfio/sfmode.c: _sfmode(): - Do not turn off mmap on 64-bit systems. --- src/lib/libast/sfio/sfmode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/libast/sfio/sfmode.c b/src/lib/libast/sfio/sfmode.c index 31c6a9b9a60c..78fade8ce06e 100644 --- a/src/lib/libast/sfio/sfmode.c +++ b/src/lib/libast/sfio/sfmode.c @@ -404,7 +404,7 @@ reg int local; /* a local call */ if(f->mode&SF_GETR) { f->mode &= ~SF_GETR; -#ifdef MAP_TYPE +#if defined(MAP_TYPE) && (_ptr_bits < 64) if((f->bits&SF_MMAP) && (f->tiny[0] += 1) >= (4*SF_NMAP) ) { /* turn off mmap to avoid page faulting */ sfsetbuf(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);