svn commit: r499547 - in head/shells/ksh93: . files
Cy Schubert
cy at FreeBSD.org
Sun Apr 21 17:29:56 UTC 2019
Author: cy
Date: Sun Apr 21 17:29:49 2019
New Revision: 499547
URL: https://svnweb.freebsd.org/changeset/ports/499547
Log:
shells/ksh93: Update to 93v 2014-12-24
PR: 208098 (fixed)
Submitted by: saper at saper.info (maintainer)
Reported by: fuz at fuz.su
Reviewed by: cy@, pkubaj@
Approved by: maintainer (implicit, submitter)
Differential Revision: https://reviews.freebsd.org/D19343
Added:
head/shells/ksh93/files/patch-src_cmd_proto_proto.c (contents, props changed)
head/shells/ksh93/files/patch-src_cmd_std_features_procfs (contents, props changed)
head/shells/ksh93/files/patch-src_cmd_std_pss-kvm.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_comp_setlocale.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_features_mmap (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_features_standards (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_features_vmalloc (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_features_wchar (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_port_astcopy.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfclose.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfhdr.h (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfmode.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfpurge.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfrd.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfseek.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsetbuf.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsetfd.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsize.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsk.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_string_strexpr.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_malloc.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdcshare.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdcsystem.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdebug.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmhdr.h (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmlast.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmmaddress.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmopen.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmpool.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmsegment.c (contents, props changed)
head/shells/ksh93/files/patch-src_lib_libcmd_ls.c (contents, props changed)
Deleted:
head/shells/ksh93/files/patch-src-lib-libast-features-wchar
head/shells/ksh93/files/patch-src-lib-libast-hash-hashalloc.c
head/shells/ksh93/files/patch-src-lib-libast-string-tokscan.c
head/shells/ksh93/files/patch-src_cmd_INIT_iffe.sh
Modified:
head/shells/ksh93/Makefile
head/shells/ksh93/distinfo
Modified: head/shells/ksh93/Makefile
==============================================================================
--- head/shells/ksh93/Makefile Sun Apr 21 16:41:37 2019 (r499546)
+++ head/shells/ksh93/Makefile Sun Apr 21 17:29:49 2019 (r499547)
@@ -12,31 +12,31 @@
PORTNAME= ksh93
PORTVERSION= ${KSHVERSION:S/-//g}
-PORTREVISION= 2
CATEGORIES= shells
-MASTER_SITES= http://www2.research.att.com/~astopen/download/tgz/ \
- LOCAL/sunpoet/${PORTNAME}
-DISTFILES= INIT.${INITVERSION}.tgz ast-ksh.${KSHVERSION}.tgz
DIST_SUBDIR= ${PORTNAME}
MAINTAINER= saper at saper.info
-COMMENT= Official AT&T release of KornShell 93
+COMMENT= KornShell 93
LICENSE= EPL
BROKEN_aarch64= Fails to compile: needs sbrk
+USES= compiler:c11
+
+USE_GITHUB= yes
+GH_ACCOUNT= att
+GH_PROJECT= ast
+GH_TAGNAME= ${PORTNAME}v
+
CONFLICTS= ksh93-devel-*
OPTIONS_DEFINE= EXAMPLES STATIC
-FETCH_ENV= HTTP_AUTH=basic:*:I\ accept\ www.opensource.org/licenses/cpl:.
LDFLAGS+= -lm
-MAKE_ENV= CCFLAGS="${CFLAGS}"
-NO_WRKSUBDIR= yes
+MAKE_ENV= CCFLAGS="-Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses ${CFLAGS}"
-INITVERSION= 2013-05-24
-KSHVERSION= 2012-08-01
+KSHVERSION= 2014-12-24
STATIC_MAKE_ENV= LDFLAGS+=-static
@@ -44,7 +44,7 @@ post-patch:
@${REINPLACE_CMD} -e 's|SF_FLAGS|SFIO_FLAGS|g' ${WRKSRC}/src/lib/libast/include/sfio*.h ${WRKSRC}/src/lib/libast/sfio/*.c
do-build:
- @cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make
+ @cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make ksh93
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/ksh93
Modified: head/shells/ksh93/distinfo
==============================================================================
--- head/shells/ksh93/distinfo Sun Apr 21 16:41:37 2019 (r499546)
+++ head/shells/ksh93/distinfo Sun Apr 21 17:29:49 2019 (r499547)
@@ -1,4 +1,3 @@
-SHA256 (ksh93/INIT.2013-05-24.tgz) = 118b2c8a4d651727fcd680289be69941d3045951bf9e3a4d45dcb42f0658f014
-SIZE (ksh93/INIT.2013-05-24.tgz) = 383979
-SHA256 (ksh93/ast-ksh.2012-08-01.tgz) = e6192cfa52a6a9fd20618cbaf3fa81f0cc9fd83525500757e83017275e962851
-SIZE (ksh93/ast-ksh.2012-08-01.tgz) = 2053532
+TIMESTAMP = 1553675701
+SHA256 (ksh93/att-ast-20141224-ksh93v_GH0.tar.gz) = 89e5aeec66c28692aa392105552c06053ba60b09a62e94dc555dadf967bca643
+SIZE (ksh93/att-ast-20141224-ksh93v_GH0.tar.gz) = 26409086
Added: head/shells/ksh93/files/patch-src_cmd_proto_proto.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_cmd_proto_proto.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,18 @@
+--- src/cmd/proto/proto.c.orig 2017-11-30 22:35:04 UTC
++++ src/cmd/proto/proto.c
+@@ -396,6 +396,15 @@ proto(char* file, char* license, char* o
+
+ #if !PROTO_STANDALONE
+ #undef error
++void
++error( int xit, const char *msg, ... )
++{
++ va_list ap;
++ va_start( ap, msg );
++ vfprintf( stderr, msg, ap );
++ va_end( ap );
++ exit( xit );
++}
+ #endif
+
+ typedef struct Sufcom_s
Added: head/shells/ksh93/files/patch-src_cmd_std_features_procfs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_cmd_std_features_procfs Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,36 @@
+--- src/cmd/std/features/procfs.orig 2017-11-30 22:35:04 UTC
++++ src/cmd/std/features/procfs
+@@ -1,6 +1,6 @@
+ hdr kvm,procinfo,pstat,asm/param
+
+-sys procfs,sysctl
++sys procfs,sysctl,user
+
+ lib getprocs
+ lib kvm_open,kvm_getprocs kvm.h sys/time.h sys/param.h sys/proc.h sys/sysctl.h -lkvm
+@@ -10,7 +10,11 @@ mem extern_proc.p_pid,extern_proc.p_star
+ mem procsinfo64.pi_pri procinfo.h
+ mem prpsinfo.pr_clname,prpsinfo.pr_cstime,prpsinfo.pr_cstime.tv_sec,prpsinfo.pr_ctime,prpsinfo.pr_cutime,prpsinfo.pr_gid,prpsinfo.pr_lttydev,prpsinfo.pr_ntpid,prpsinfo.pr_pgid,prpsinfo.pr_pgrp,prpsinfo.pr_psargs,prpsinfo.pr_refcount,prpsinfo.pr_rssize,prpsinfo.pr_sid,prpsinfo.pr_sonproc,prpsinfo.pr_start,prpsinfo.pr_start.tv_sec,prpsinfo.pr_starttime,prpsinfo.pr_starttime.tv_sec,prpsinfo.pr_state,prpsinfo.pr_stime,prpsinfo.pr_tgrp,prpsinfo.pr_time,prpsinfo.pr_time.tv_sec,prpsinfo.pr_utime,prpsinfo.pr_zomb,prpsinfo.pr_pctcpu,prpsinfo.pr_cpu,prpsinfo.pr_lwp.pr_pctcpu,prpsinfo.pr_lwp.pr_cpu -D_STRUCTURED_PROC -Dprpsinfo=psinfo sys/types.h sys/procfs.h
+
++num PIOCPSINFO
++
+ typ struct.prpsinfo -D_STRUCTURED_PROC -Dprpsinfo=psinfo sys/types.h sys/procfs.h
++typ struct.kinfo_proc sys/types.h sys/procfs.h sys/user.h
++typ struct.kp_proc sys/types.h sys/procfs.h sys/user.h
+
+ tst lib_info note{ info(2) kernel table api }end link{
+ #include <info.h>
+@@ -587,11 +591,11 @@ cat{
+ #define PSS_METHOD PSS_METHOD_getprocs
+ #endif
+
+-#if !PSS_METHOD && defined(_PS_dir)
++#if !PSS_METHOD && defined(_PS_dir) && (_PS_scan_binary || _num_PIOCPSINFO)
+ #define PSS_METHOD PSS_METHOD_procfs
+ #endif
+
+-#if !PSS_METHOD && _hdr_kvm && _sys_sysctl && _lib_kvm_open && _lib_kvm_getprocs
++#if !PSS_METHOD && _hdr_kvm && _sys_sysctl && _lib_kvm_open && _lib_kvm_getprocs && _typ_struct_kinfo_proc && _typ_struct_kp_proc
+ #define PSS_METHOD PSS_METHOD_kvm
+ #endif
+
Added: head/shells/ksh93/files/patch-src_cmd_std_pss-kvm.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_cmd_std_pss-kvm.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,12 @@
+--- src/cmd/std/pss-kvm.c.orig 2017-11-30 22:35:04 UTC
++++ src/cmd/std/pss-kvm.c
+@@ -43,6 +43,9 @@ NoN(pss_kvm)
+ #if _sys_proc
+ #include <sys/proc.h>
+ #endif
++#if _sys_user
++#include <sys/user.h>
++#endif
+ #include <sys/sysctl.h>
+ #include <sys/tty.h>
+
Added: head/shells/ksh93/files/patch-src_lib_libast_comp_setlocale.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_comp_setlocale.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,10 @@
+--- src/lib/libast/comp/setlocale.c.orig 2017-11-30 22:35:04 UTC
++++ src/lib/libast/comp/setlocale.c
+@@ -38,6 +38,7 @@
+ #include <namval.h>
+ #include <iconv.h>
+ #include <codeset.h>
++#include <errno.h>
+
+ #if ( _lib_wcwidth || _lib_wctomb ) && _hdr_wctype
+ #include <wctype.h>
Added: head/shells/ksh93/files/patch-src_lib_libast_features_mmap
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_features_mmap Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,191 @@
+--- src/lib/libast/features/mmap.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/features/mmap
+@@ -16,14 +16,7 @@ tst lib_mmap note{ standard mmap interfa
+
+ #define Failed(file) (remove(file),1)
+
+- int
+- #if _STD_
+- main(int argc, char** argv)
+- #else
+- main(argc,argv)
+- int argc;
+- char** argv;
+- #endif
++ int main(int argc, char** argv)
+ {
+ caddr_t mm;
+ char *file;
+@@ -165,169 +158,18 @@ tst lib_mmap64 -D_LARGEFILE64_SOURCE not
+ }
+ }end
+
+-tst mmap_anon note{ use mmap MAP_ANON to get raw memory }end execute{
+- #if !_lib_mmap
+- (
+- #endif
+- #include <unistd.h>
+- #include <fcntl.h>
+- #include <sys/types.h>
+- #include <sys/mman.h>
+- #if defined(MAP_ANONYMOUS) && !defined(MAP_ANON)
+- #define MAP_ANON MAP_ANONYMOUS
+- #endif
+- int
+- main()
+- { void *addr;
+- addr = mmap(0,1024*1024,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE,-1,0);
+- return (addr && addr != (void*)(-1)) ? 0 : 1;
+- }
+-}end
+-
+-tst mmap_devzero note{ use mmap on /dev/zero to get raw memory }end execute{
+- #if !_lib_mmap
+- (
+- #endif
+- #include <unistd.h>
+- #include <fcntl.h>
+- #include <sys/types.h>
+- #include <sys/mman.h>
+- int
+- main()
+- { int fd;
+- void *addr;
+- if((fd = open("/dev/zero", O_RDWR)) < 0)
+- return 1;
+- addr = mmap(0,1024*1024,PROT_READ|PROT_WRITE,MAP_PRIVATE,fd,0);
+- return (addr && addr != (void*)(-1)) ? 0 : 1;
+- }
+-}end
+-
+-tst -D_LARGEFILE64_SOURCE note{ mmap is worth using }end output{
+- #if !_lib_mmap
+- (
+- #endif
+- #include <unistd.h>
+- #include <fcntl.h>
+- #include <string.h>
+- #include <sys/types.h>
+- #include <sys/mman.h>
+- #include <sys/stat.h>
+- #include <sys/times.h>
+-
+- #if _lib_mmap64
+- #undef mmap
+- #define mmap mmap64
+- #endif
+-
+- #if _lib_munmap64
+- #undef munmap
+- #define munmap munmap64
+- #endif
+-
+- #define MAPSIZE (64*1024)
+- #define BUFSIZE (MAPSIZE/8)
+- #define WRITE (64)
+- #define RUN (64)
+-
+- #define Failed(file) (remove(file),1)
+-
+- int
+- #if _STD_
+- main(int argc, char** argv)
+- #else
+- main(argc,argv)
+- int argc;
+- char** argv;
+- #endif
+- {
+- caddr_t mm;
+- char *file, *t;
+- int i, fd, k, run;
+- char buf[MAPSIZE];
+- struct tms stm, etm;
+- clock_t rdtm, mmtm;
+-
+- file = argv[1];
+- if ((fd = open(file, O_CREAT|O_TRUNC|O_WRONLY, 0666)) < 0)
+- return 1;
+-
+- for (i = 0; i < sizeof(buf); ++i)
+- buf[i] = '0' + (i%10);
+- for (i = 0; i < WRITE; ++i)
+- if (write(fd,buf,sizeof(buf)) != sizeof(buf))
+- return Failed(file);
+- close(fd);
+-
+- /* read time */
+- times(&stm);
+- for(run = 0; run < RUN; ++run)
+- { if((fd = open(file, O_RDWR)) < 0)
+- return Failed(file);
+- for (i = 0; i < WRITE; ++i)
+- { for(k = 0; k < MAPSIZE; k += BUFSIZE)
+- if (read(fd,buf,BUFSIZE) != BUFSIZE)
+- return Failed(file);
+- }
+- close(fd);
+- }
+- times(&etm);
+- rdtm = (etm.tms_utime-stm.tms_utime) + (etm.tms_stime-stm.tms_stime);
+-
+- /* mmap time */
+- times(&stm);
+- for(run = 0; run < RUN; ++run)
+- { if ((fd = open(file, O_RDWR)) < 0)
+- return Failed(file);
+- for(i = 0, mm = (caddr_t)0; i < WRITE; ++i)
+- { if(mm)
+- munmap(mm, MAPSIZE);
+- mm = (caddr_t)mmap((caddr_t)0, MAPSIZE,
+- (PROT_READ|PROT_WRITE),
+- MAP_PRIVATE, fd, i*MAPSIZE );
+- if(mm == (caddr_t)(-1) || mm == (caddr_t)0)
+- return Failed(file);
+-
+- /* the memcpy is < BUFSIZE to simulate the
+- fact that functions like sfreserve/sfgetr do
+- not do buffer copying.
+- */
+- t = (char*)mm;
+- for(k = 0; k < MAPSIZE; k += BUFSIZE, t += BUFSIZE)
+- memcpy(buf,t,(3*BUFSIZE)/4);
+- }
+- close(fd);
+- }
+- times(&etm);
+- mmtm = (etm.tms_utime-stm.tms_utime) + (etm.tms_stime-stm.tms_stime);
+-
+- remove(file);
+-
+- if(4*mmtm <= 3*rdtm)
+- printf("#define _mmap_worthy 2 /* mmap outperforms read on 64Ki buffers -- use it */\n");
+- else if(4*mmtm <= 5*rdtm)
+- printf("#define _mmap_worthy 2 /* mmap is slightly better than read on 64Ki buffers -- use it */\n");
+- else
+- printf("#define _mmap_worthy 2 /* mmap worse than read on 64Ki buffers -- use it anyway */\n");
+-
+- return 0;
+- }
+-}end
+-
+ cat{
++ /* assume MAP_ANON works */
++ #define _mmap_anon 1
+
+ /* some systems get it wrong but escape concise detection */
+- #ifndef _NO_MMAP
+ #if __CYGWIN__
+ #define _NO_MMAP 1
+ #endif
+- #endif
+
+ #if _NO_MMAP
+ #undef _lib_mmap
+ #undef _lib_mmap64
+- #undef _mmap_anon
+- #undef _mmap_devzero
+- #undef _mmap_worthy
++ #undef _mmap_anon
+ #endif
+ }end
Added: head/shells/ksh93/files/patch-src_lib_libast_features_standards
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_features_standards Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,23 @@
+--- src/lib/libast/features/standards.orig 2017-11-30 22:35:04 UTC
++++ src/lib/libast/features/standards
+@@ -1,5 +1,19 @@
+ set stdio
+-if tst note{ _GNU_SOURCE works }end compile{
++# In FreeBSD, definitions like _POSIX_SOURCE and such are used to *limit*
++# functionality to known API; they don't enable anything. The general intent in
++# BSD is to enable everything by default (effectively, providing the
++# _KITCHEN_SINK_SOURCE mentioned below). So we look for that here, but stay
++# careful that we don't get fooled by presence of FreeBSD that underpins some
++# subsystems in Mac OS X; there are other Apple-specific portability hacks
++# elsewhere we should not interfere with.
++if tst note{ FreeBSD }end compile{
++ #include <sys/param.h>
++ #if !defined(__FreeBSD__) || defined(APPLE)
++ #error not a FreeBSD system
++ #endif
++ }end {
++ }
++elif tst note{ _GNU_SOURCE works }end compile{
+ #define _GNU_SOURCE 1
+ #include <sys/types.h>
+ #include <sys/stat.h>
Added: head/shells/ksh93/files/patch-src_lib_libast_features_vmalloc
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_features_vmalloc Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,10 @@
+--- src/lib/libast/features/vmalloc.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/features/vmalloc
+@@ -217,7 +217,4 @@ cat{
+ #if _mmap_anon
+ #define _mem_mmap_anon 1
+ #endif
+- #if _mmap_devzero
+- #define _mem_mmap_zero 1
+- #endif
+ }end
Added: head/shells/ksh93/files/patch-src_lib_libast_features_wchar
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_features_wchar Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,10 @@
+--- src/lib/libast/features/wchar.orig 2017-11-30 22:35:04 UTC
++++ src/lib/libast/features/wchar
+@@ -6,6 +6,7 @@ set include .
+ cat{
+ #ifndef _AST_WCHAR_H
+ #define _AST_WCHAR_H 1
++ #define _STDFILE_DECLARED
+ }end
+
+ lib mbstowcs,wctomb,wcscmp,wcscoll,wcslen,wcstombs,wcsxfrm,wcwidth stdlib.h stdio.h wchar.h
Added: head/shells/ksh93/files/patch-src_lib_libast_port_astcopy.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_port_astcopy.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,17 @@
+--- src/lib/libast/port/astcopy.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/port/astcopy.c
+@@ -30,14 +30,10 @@
+ #include <ast.h>
+ #include <ast_mmap.h>
+
+-#if _mmap_worthy > 1
+-
+ #include <ls.h>
+
+ #define MAPSIZE (1024*256)
+
+-#endif
+-
+ #undef BUFSIZ
+ #define BUFSIZ 4096
+
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfclose.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfclose.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,14 @@
+--- src/lib/libast/sfio/sfclose.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfclose.c
+@@ -104,11 +104,9 @@ Sfio_t* f;
+
+ if(f->data && (!local || (f->flags&SF_STRING) || (f->bits&SF_MMAP) ) )
+ { /* free buffer */
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ SFMUNMAP(f,f->data,f->endb-f->data);
+ else
+-#endif
+ if(f->flags&SF_MALLOC)
+ data = (Void_t*)f->data;
+
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfhdr.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfhdr.h Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,12 @@
+--- src/lib/libast/sfio/sfhdr.h.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfhdr.h
+@@ -209,9 +209,6 @@
+
+ /* see if we can use memory mapping for io */
+ #if _LARGEFILE64_SOURCE && !_lib_mmap64
+-#undef _mmap_worthy
+-#endif
+-#if !_mmap_worthy
+ #undef _hdr_mman
+ #undef _sys_mman
+ #endif
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfmode.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfmode.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,45 @@
+--- src/lib/libast/sfio/sfmode.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfmode.c
+@@ -404,7 +404,6 @@ reg int local; /* a local call */
+
+ if(f->mode&SF_GETR)
+ { f->mode &= ~SF_GETR;
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ {
+ if (!++f->ngetr)
+@@ -415,7 +414,6 @@ reg int local; /* a local call */
+ f->ngetr = f->tiny[0] = 0;
+ }
+ }
+-#endif
+ if(f->getr)
+ { f->next[-1] = f->getr;
+ f->getr = 0;
+@@ -519,12 +517,10 @@ reg int local; /* a local call */
+ if((f->flags&(SF_SHARE|SF_PUBLIC)) == (SF_SHARE|SF_PUBLIC) &&
+ (addr = SFSK(f,0,SEEK_CUR,f->disc)) != f->here)
+ {
+-#if _mmap_worthy
+ if((f->bits&SF_MMAP) && f->data)
+ { SFMUNMAP(f,f->data,f->endb-f->data);
+ f->data = NIL(uchar*);
+ }
+-#endif
+ f->endb = f->endr = f->endw = f->next = f->data;
+ f->here = addr;
+ }
+@@ -567,13 +563,11 @@ reg int local; /* a local call */
+ }
+
+ f->mode = SF_WRITE|SF_LOCK;
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ { if(f->data)
+ SFMUNMAP(f,f->data,f->endb-f->data);
+ (void)SFSETBUF(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);
+ }
+-#endif
+ if(f->data == f->tiny)
+ { f->endb = f->data = f->next = NIL(uchar*);
+ f->size = 0;
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfpurge.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfpurge.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,18 @@
+--- src/lib/libast/sfio/sfpurge.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfpurge.c
+@@ -54,7 +54,6 @@ Sfio_t* f;
+ SFLOCK(f,0);
+
+ /* if memory map must be a read stream, pretend data is gone */
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ { f->here -= f->endb - f->next;
+ if(f->data)
+@@ -64,7 +63,6 @@ Sfio_t* f;
+ SFOPEN(f,0);
+ SFMTXRETURN(f, 0);
+ }
+-#endif
+
+ switch(f->mode&~SF_LOCK)
+ {
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfrd.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfrd.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,31 @@
+--- src/lib/libast/sfio/sfrd.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfrd.c
+@@ -92,12 +92,10 @@ Sfdisc_t* disc;
+ { f->endb = f->next = f->endr = f->data;
+ f->mode &= ~SF_SYNCED;
+ }
+-#if _mmap_worthy
+ if((f->bits&SF_MMAP) && f->data)
+ { SFMUNMAP(f, f->data, f->endb-f->data);
+ f->data = NIL(uchar*);
+ }
+-#endif
+ f->next = f->endb = f->endr = f->endw = f->data;
+ }
+ }
+@@ -132,7 +130,6 @@ Sfdisc_t* disc;
+ }
+ }
+
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ { reg ssize_t a, round;
+ sfstat_t st;
+@@ -230,7 +227,6 @@ Sfdisc_t* disc;
+ }
+ }
+ }
+-#endif
+
+ /* sync unseekable write streams to prevent deadlock */
+ if(!dosync && f->extent < 0)
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfseek.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfseek.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,43 @@
+--- src/lib/libast/sfio/sfseek.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfseek.c
+@@ -34,12 +34,10 @@ Sfio_t* f;
+ Sfoff_t p;
+ #endif
+ {
+-#if _mmap_worthy
+ if((f->bits&SF_MMAP) && f->data)
+ { SFMUNMAP(f, f->data, f->endb-f->data);
+ f->data = NIL(uchar*);
+ }
+-#endif
+ f->next = f->endr = f->endw = f->data;
+ f->endb = (f->mode&SF_WRITE) ? f->data+f->size : f->data;
+ if((f->here = p) < 0)
+@@ -201,23 +199,13 @@ int type; /* 0: from org, 1: from here,
+ if((p += type == SEEK_CUR ? s : 0) < 0)
+ goto done;
+
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ { /* if mmap is not great, stop mmaping if moving around too much */
+-#if _mmap_worthy < 2
+- if((f->next - f->data) < ((f->endb - f->data)/4) )
+- { SFSETBUF(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);
+- hardseek = 1; /* this forces a hard seek below */
+- }
+- else
+-#endif
+- { /* for mmap, f->here can be virtual except for hardseek */
+- newpos(f,p);
+- if(!hardseek)
+- goto done;
+- }
++ /* for mmap, f->here can be virtual except for hardseek */
++ newpos(f,p);
++ if(!hardseek)
++ goto done;
+ }
+-#endif
+
+ if(f->endb > f->next)
+ { /* reduce wastage in future buffer fillings */
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsetbuf.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsetbuf.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,34 @@
+--- src/lib/libast/sfio/sfsetbuf.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfsetbuf.c
+@@ -302,7 +302,6 @@ size_t size; /* buffer size, -1 for defa
+ okmmap = (buf || (f->flags&SF_STRING) || (f->flags&SF_RDWR) == SF_RDWR) ? 0 : 1;
+
+ /* save old buffer info */
+-#if _mmap_worthy
+ if(f->bits&SF_MMAP)
+ { if(f->data)
+ { if(f->getr && (f->mode&SF_GETR) && f->next)
+@@ -311,7 +310,6 @@ size_t size; /* buffer size, -1 for defa
+ f->data = NIL(uchar*);
+ }
+ } else
+-#endif
+ if(f->data == f->tiny)
+ { f->data = NIL(uchar*);
+ f->size = 0;
+@@ -438,7 +436,6 @@ size_t size; /* buffer size, -1 for defa
+ }
+ }
+
+-#if _mmap_worthy
+ if(okmmap && size && (f->mode&SF_READ) && f->extent >= 0 )
+ { /* see if we can try memory mapping */
+ if(!disc)
+@@ -457,7 +454,6 @@ size_t size; /* buffer size, -1 for defa
+ }
+ }
+ }
+-#endif
+
+ /* get buffer space */
+ setbuf:
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsetfd.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsetfd.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,15 @@
+--- src/lib/libast/sfio/sfsetfd.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfsetfd.c
+@@ -108,12 +108,10 @@ int newfd;
+ SFMTXRETURN(f, -1);
+ }
+
+-#if _mmap_worthy
+ if((f->bits&SF_MMAP) && f->data)
+ { SFMUNMAP(f,f->data,f->endb-f->data);
+ f->data = NIL(uchar*);
+ }
+-#endif
+
+ /* make stream appears uninitialized */
+ f->endb = f->endr = f->endw = f->data;
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsize.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsize.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,15 @@
+--- src/lib/libast/sfio/sfsize.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfsize.c
+@@ -80,12 +80,10 @@ Sfio_t* f;
+
+ if(f->here != s && (f->mode&SF_READ) )
+ { /* buffered data is known to be invalid */
+-#if _mmap_worthy
+ if((f->bits&SF_MMAP) && f->data)
+ { SFMUNMAP(f,f->data,f->endb-f->data);
+ f->data = NIL(uchar*);
+ }
+-#endif
+ f->next = f->endb = f->endr = f->endw = f->data;
+ }
+
Added: head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsk.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_sfio_sfsk.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,15 @@
+--- src/lib/libast/sfio/sfsk.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/sfio/sfsk.c
+@@ -49,12 +49,10 @@ Sfdisc_t* disc;
+ SFMTXRETURN(f, (Sfoff_t)(-1));
+ if(SFSYNC(f) < 0)
+ SFMTXRETURN(f, (Sfoff_t)(-1));
+-#if _mmap_worthy
+ if(f->mode == SF_READ && (f->bits&SF_MMAP) && f->data)
+ { SFMUNMAP(f, f->data, f->endb-f->data);
+ f->data = NIL(uchar*);
+ }
+-#endif
+ f->next = f->endb = f->endr = f->endw = f->data;
+ }
+
Added: head/shells/ksh93/files/patch-src_lib_libast_string_strexpr.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_string_strexpr.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,87 @@
+--- src/lib/libast/string/strexpr.c.orig 2017-11-30 22:35:04 UTC
++++ src/lib/libast/string/strexpr.c
+@@ -44,7 +44,7 @@
+ #define peekchr(ex) (*(ex)->nextchr)
+ #define ungetchr(ex) ((ex)->nextchr--)
+
+-#define error(ex,msg) return(seterror(ex,msg))
++#define err(ex,msg) return(seterror(ex,msg))
+
+ typedef struct /* expression handle */
+ {
+@@ -87,7 +87,7 @@ expr(register Expr_t* ex, register int p
+ case 0:
+ ungetchr(ex);
+ if (!precedence) return(0);
+- error(ex, "more tokens expected");
++ err(ex, "more tokens expected");
+ case '-':
+ n = -expr(ex, 13);
+ break;
+@@ -113,17 +113,17 @@ expr(register Expr_t* ex, register int p
+ case 0:
+ goto done;
+ case ')':
+- if (!precedence) error(ex, "too many )'s");
++ if (!precedence) err(ex, "too many )'s");
+ goto done;
+ case '(':
+ n = expr(ex, 1);
+ if (getchr(ex) != ')')
+ {
+ ungetchr(ex);
+- error(ex, "closing ) expected");
++ err(ex, "closing ) expected");
+ }
+ gotoperand:
+- if (operand) error(ex, "operator expected");
++ if (operand) err(ex, "operator expected");
+ operand = 1;
+ continue;
+ case '?':
+@@ -140,7 +140,7 @@ expr(register Expr_t* ex, register int p
+ if (getchr(ex) != ':')
+ {
+ ungetchr(ex);
+- error(ex, ": expected for ? operator");
++ err(ex, ": expected for ? operator");
+ }
+ if (n)
+ {
+@@ -189,7 +189,7 @@ expr(register Expr_t* ex, register int p
+ break;
+ case '=':
+ case '!':
+- if (peekchr(ex) != '=') error(ex, "operator syntax error");
++ if (peekchr(ex) != '=') err(ex, "operator syntax error");
+ if (precedence > 7) goto done;
+ getchr(ex);
+ x = expr(ex, 8);
+@@ -237,7 +237,7 @@ expr(register Expr_t* ex, register int p
+ if (precedence > 11) goto done;
+ x = expr(ex, 12);
+ if (c == '*') n *= x;
+- else if (x == 0) error(ex, "divide by zero");
++ else if (x == 0) err(ex, "divide by zero");
+ else if (c == '/') n /= x;
+ else n %= x;
+ break;
+@@ -246,15 +246,15 @@ expr(register Expr_t* ex, register int p
+ pos = --ex->nextchr;
+ if (isdigit(c)) n = strton(ex->nextchr, &ex->nextchr, NiL, 0);
+ else if (ex->convert) n = (*ex->convert)(ex->nextchr, &ex->nextchr, ex->handle);
+- if (ex->nextchr == pos) error(ex, "syntax error");
++ if (ex->nextchr == pos) err(ex, "syntax error");
+ goto gotoperand;
+ }
+ if (ex->errmsg) return(0);
+- if (!operand) error(ex, "operand expected");
++ if (!operand) err(ex, "operand expected");
+ }
+ done:
+ ungetchr(ex);
+- if (!operand) error(ex, "operand expected");
++ if (!operand) err(ex, "operand expected");
+ return(n);
+ }
+
Added: head/shells/ksh93/files/patch-src_lib_libast_vmalloc_malloc.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_vmalloc_malloc.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,20 @@
+--- src/lib/libast/vmalloc/malloc.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/vmalloc/malloc.c
+@@ -906,7 +906,7 @@ union Alloca_u
+ { char* addr;
+ Alloca_t* next;
+ } head;
+- char array[ALIGN];
++ char array[MEM_ALIGN];
+ };
+ struct Alloca_s
+ { union Alloca_u head;
+@@ -914,7 +914,7 @@ struct Alloca_s
+ };
+
+ extern Void_t* alloca(size_t size)
+-{ char array[ALIGN];
++{ char array[MEM_ALIGN];
+ char* file;
+ int line;
+ Void_t* func;
Added: head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,101 @@
+--- src/lib/libast/vmalloc/vmbest.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/vmalloc/vmbest.c
+@@ -64,19 +64,19 @@ void _STUB_vmbest(){}
+ #define PK_ALLOW 128 /* min #packs allowed to be created */
+
+ /* Small requests are rounded to 0%SM_RNDx */
+-#define SM_RND0 (1*ALIGN) /* round value: 1*ALIGN == 16 */
++#define SM_RND0 (1*MEM_ALIGN) /* round value: 1*MEM_ALIGN == 16 */
+ #define SM_BIT0 4 /* (1<<SM_BIT0) == SM_RND0 */
+ #define SM_CNT0 16 /* # caches as rounded by SM_RND0 */
+ #define SM_IDX0 0 /* starting cache index of this group */
+ #define SM_MAX0 (SM_CNT0*SM_RND0)
+
+-#define SM_RND1 (2*ALIGN) /* round value: 2*ALIGN == 32 */
++#define SM_RND1 (2*MEM_ALIGN) /* round value: 2*MEM_ALIGN == 32 */
+ #define SM_CNT1 8
+ #define SM_BIT1 5
+ #define SM_IDX1 (SM_IDX0+SM_CNT0)
+ #define SM_MAX1 (SM_MAX0 + SM_CNT1*SM_RND1)
+
+-#define SM_RND2 (4*ALIGN) /* round value: 4*ALIGN == 64 */
++#define SM_RND2 (4*MEM_ALIGN) /* round value: 4*MEM_ALIGN == 64 */
+ #define SM_BIT2 6
+ #define SM_CNT2 8
+ #define SM_IDX2 (SM_IDX1+SM_CNT1)
+@@ -167,7 +167,7 @@ static int chktree(Pack_t* pack, Block_t
+ if(_Vmassert & VM_check_reg)
+ { if(!node) /* the empty tree is always good */
+ return 0;
+- /**/DEBUG_ASSERT(BDSZ(node) >= BODYSIZE && (BDSZ(node)%ALIGN) == 0 );
++ /**/DEBUG_ASSERT(BDSZ(node) >= BODYSIZE && (BDSZ(node)%MEM_ALIGN) == 0 );
+
+ if(SIZE(node) & (BUSY|PFREE)) /* should be BITS-free */
+ { /**/DEBUG_MESSAGE("Free block corrupted"); /**/DEBUG_ASSERT(0); return -1; }
+@@ -252,7 +252,7 @@ static int bestfree(Vmalloc_t* vm, Void_
+ if((Vmuchar_t*)data < vm->data->segmin || (Vmuchar_t*)data >= vm->data->segmax)
+ return -1;
+
+- blk = BLOCK(data); /**/DEBUG_ASSERT((SIZE(blk)&BUSY) && (BDSZ(blk)%ALIGN) == 0 );
++ blk = BLOCK(data); /**/DEBUG_ASSERT((SIZE(blk)&BUSY) && (BDSZ(blk)%MEM_ALIGN) == 0 );
+ pack = PACK(blk); /**/DEBUG_ASSERT(pack->best == (Vmbest_t*)vm->data);
+ if((sz = SIZE(blk))&SMALL )
+ listp = &pack->small[SMDECODE(sz)].free;
+@@ -339,7 +339,7 @@ static Block_t* bestpackextend(Vmalloc_t
+
+ /**/DEBUG_ASSERT(!wild || (PACK(wild) == pack && BDSZ(wild) < size && PACKWILD(pack,wild)) );
+ blkz = BDSZ(pack->pblk); /**/DEBUG_ASSERT(blkz >= _Vmpagesize);
+- size += blkz - (wild ? BDSZ(wild) : 0) + EXTRA(pack); /**/DEBUG_ASSERT(size%ALIGN == 0);
++ size += blkz - (wild ? BDSZ(wild) : 0) + EXTRA(pack); /**/DEBUG_ASSERT(size%MEM_ALIGN == 0);
+ if(_Vmassert & VM_debug) debug_printf(2, "%s:%d: PACK(%p) WILD(%p)=%zd BDSZ(%p)=%zd blkz=%zd size=%zu\n", __FILE__, __LINE__, pack, wild, wild ? BDSZ(wild) : 0, pack->pblk, BDSZ(pack->pblk), blkz, size);
+ if(!(pblk = (*_Vmsegalloc)(vm, pack->pblk, size, segtype)) )
+ pblk = pack->pblk;
+@@ -383,7 +383,7 @@ static Block_t* bestpackextract(Pack_t*
+
+ l = r = &link;
+ if((root = pack->root) ) do /* top-down splay tree search */
+- { /**/DEBUG_ASSERT((size%ALIGN) == 0 && !(SIZE(root)&(BUSY|PFREE)) );
++ { /**/DEBUG_ASSERT((size%MEM_ALIGN) == 0 && !(SIZE(root)&(BUSY|PFREE)) );
+ if(size == (sz = BDSZ(root)) )
+ break;
+ if(size < sz)
+@@ -508,7 +508,7 @@ static int bestlistreclaim(Vmalloc_t* vm
+ continue;
+
+ /**/DEBUG_ASSERT((SIZE(fp)&(BUSY|MARK)) == (BUSY|MARK) );
+- /**/DEBUG_ASSERT(BDSZ(fp) >= sizeof(Body_t) && BDSZ(fp)%ALIGN == 0);
++ /**/DEBUG_ASSERT(BDSZ(fp) >= sizeof(Body_t) && BDSZ(fp)%MEM_ALIGN == 0);
+ SIZE(fp) &= ~BITS;
+ t = NEXT(fp);
+ SIZE(t) |= PFREE; /**/DEBUG_ASSERT(SIZE(NEXT(fp))&BUSY);
+@@ -563,7 +563,7 @@ static Block_t* bestpackalloc(Vmalloc_t*
+ ssize_t sz;
+ Block_t *tp, *np, *pblk;
+ Vmbest_t *best = (Vmbest_t*)vm->data;
+- /**/DEBUG_ASSERT(size >= sizeof(Body_t) && size%ALIGN == 0);
++ /**/DEBUG_ASSERT(size >= sizeof(Body_t) && size%MEM_ALIGN == 0);
+
+ if((tp = pack->alloc) ) /* fast allocation from recent memory */
+ { pack->alloc = NIL(Block_t*);
+@@ -719,9 +719,9 @@ static Void_t* bestalloc(Vmalloc_t* vm,
+ asospindecl();
+
+ /**/DEBUG_COUNT(N_alloc);
+- /**/DEBUG_ASSERT((ALIGN%(BITS+1)) == 0 );
+- /**/DEBUG_ASSERT((sizeof(Head_t)%ALIGN) == 0 );
+- /**/DEBUG_ASSERT((sizeof(Body_t)%ALIGN) == 0 );
++ /**/DEBUG_ASSERT((MEM_ALIGN%(BITS+1)) == 0 );
++ /**/DEBUG_ASSERT((sizeof(Head_t)%MEM_ALIGN) == 0 );
++ /**/DEBUG_ASSERT((sizeof(Body_t)%MEM_ALIGN) == 0 );
+ /**/DEBUG_ASSERT(sizeof(Block_t) == (sizeof(Body_t)+sizeof(Head_t)) );
+ /**/DEBUG_ASSERT(chkregion((Vmbest_t*)vm->data, local) >= 0);
+
+@@ -902,7 +902,7 @@ static Void_t* bestalign(Vmalloc_t* vm,
+ return NIL(Void_t*);
+
+ algz = LGROUND(size);
+- algn = (*_Vmlcm)(align,ALIGN);
++ algn = (*_Vmlcm)(align,MEM_ALIGN);
+
+ /* non-Vmbest methods may require extra header space */
+ if(METHOD(best) != VM_MTBEST && vm->meth.eventf)
Added: head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdcshare.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdcshare.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,20 @@
+--- src/lib/libast/vmalloc/vmdcshare.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/vmalloc/vmdcshare.c
+@@ -61,7 +61,7 @@ void _STUB_vmdcshare(){}
+ #define MM_REMOVE 02 /* remove files/segments */
+
+ /* macros to get the data section and size */
+-#define MMHEAD(name) ROUND(sizeof(Mmvm_t)+strlen(name), ALIGN)
++#define MMHEAD(name) ROUND(sizeof(Mmvm_t)+strlen(name), MEM_ALIGN)
+ #define MMDATA(mmvm) ((Vmuchar_t*)(mmvm)->base + MMHEAD(mmvm->name))
+ #define MMSIZE(mmvm) ((mmvm)->size - MMHEAD(mmvm->name))
+
+@@ -178,7 +178,7 @@ static int mminit(Mmdisc_t* mmdc)
+ /* fixed size region so make it reasonably large */
+ if((size = mmdc->size) < MM_MINSIZE )
+ size = MM_MINSIZE;
+- size += MMHEAD(mmdc->name) + ALIGN;
++ size += MMHEAD(mmdc->name) + MEM_ALIGN;
+ size = ROUND(size, _Vmpagesize);
+
+ /* get/create the initial segment of data */
Added: head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdcsystem.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmdcsystem.c Sun Apr 21 17:29:49 2019 (r499547)
@@ -0,0 +1,126 @@
+--- src/lib/libast/vmalloc/vmdcsystem.c.orig 2016-02-28 17:09:23 UTC
++++ src/lib/libast/vmalloc/vmdcsystem.c
+@@ -66,18 +66,16 @@ static Vmemory_f _Vmemoryf = 0;
+
+ #if _std_malloc
+ #undef _mem_mmap_anon
+-#undef _mem_mmap_zero
+ #undef _mem_sbrk
+ #undef _mem_win32
+ #endif
+
+ #if _mem_win32
+ #undef _mem_mmap_anon
+-#undef _mem_mmap_zero
+ #undef _mem_sbrk
+ #endif
+
+-#if _mem_mmap_anon || _mem_mmap_zero /* may get space using mmap */
++#if _mem_mmap_anon /* may get space using mmap */
+ #include <sys/mman.h>
+ #ifndef MAP_ANON
+ #ifdef MAP_ANONYMOUS
+@@ -86,7 +84,7 @@ static Vmemory_f _Vmemoryf = 0;
+ #define MAP_ANON 0
+ #endif /*MAP_ANONYMOUS*/
+ #endif /*MAP_ANON*/
+-#endif /*_mem_mmap_anon || _mem_mmap_zero*/
++#endif /*_mem_mmap_anon*/
+
+ /*
+ * hint at "transparent huge pages" (=largepages) if
+@@ -259,73 +257,6 @@ static Void_t* mmapanonmem(Vmalloc_t* vm
+ }
+ #endif /* _mem_mmap_anon */
+
+-#if _mem_mmap_zero /* get space by mmapping from /dev/zero */
+-#include <fcntl.h>
+-#ifndef OPEN_MAX
+-#define OPEN_MAX 64
+-#endif
+-#define FD_PRIVATE (3*OPEN_MAX/4) /* private file descriptor */
+-#define FD_NONE (-2) /* no mapping with file desc */
+-
+-/* this is called after an initial successful call of mmapzeromeminit() */
+-static Void_t* mmapzeromem(Vmalloc_t* vm, Void_t* caddr, size_t csize, size_t nsize, Vmdisc_t* disc)
+-{
+- Memdisc_t* mmdc = (Memdisc_t*)disc;
+- off_t offset;
+-
+- GETMEMCHK(vm, caddr, csize, nsize, disc);
+- if(csize == 0)
+- { nsize = ROUND(nsize, _Vmpagesize);
+- offset = asoaddoff(&mmdc->offset, nsize);
+- RESTARTMEM(caddr, mmap(NIL(Void_t*), nsize, PROT_READ|PROT_WRITE, MAP_PRIVATE, mmdc->fd, offset));
+- ADVISE(vm, caddr, nsize);
+- RETURN(vm, caddr, nsize);
+- }
+- else if(nsize == 0)
+- { Vmuchar_t *addr = (Vmuchar_t*)sbrk(0);
+- if(addr < (Vmuchar_t*)caddr ) /* in sbrk space */
+- return NIL(Void_t*);
+- (void)munmap(caddr, csize);
+- RETURN(vm, caddr, nsize);
+- }
+- else return NIL(Void_t*);
+-}
+-
+-/* if this call succeeds then mmapzeromem() is the implementation */
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-ports-head
mailing list