CVS commit: src/lib/libc/gen
Module Name:src Committed By: kamil Date: Sat Sep 9 18:00:40 UTC 2017 Modified Files: src/lib/libc/gen: devname.3 Log Message: Document devname_r(3) in devname(3). Improve clarity of devname(3) mentioning that it returns a pointer to the buffer pointer. This approach is not thread-safe and not reentrant. Not that devname(3) does not set errno on failure and document it as a bug. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libc/gen/devname.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/devname.3 diff -u src/lib/libc/gen/devname.3:1.12 src/lib/libc/gen/devname.3:1.13 --- src/lib/libc/gen/devname.3:1.12 Sun Jun 3 21:42:46 2012 +++ src/lib/libc/gen/devname.3 Sat Sep 9 18:00:39 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: devname.3,v 1.12 2012/06/03 21:42:46 joerg Exp $ +.\" $NetBSD: devname.3,v 1.13 2017/09/09 18:00:39 kamil Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,11 +29,12 @@ .\" .\" @(#)devname.3 8.2 (Berkeley) 4/29/95 .\" -.Dd June 3, 2012 +.Dd September 9, 2017 .Dt DEVNAME 3 .Os .Sh NAME -.Nm devname +.Nm devname , +.Nm devname_r .Nd get device name .Sh LIBRARY .Lb libc @@ -42,10 +43,12 @@ .In sys/stat.h .Ft char * .Fn devname "dev_t dev" "mode_t type" +.Ft int +.Fn devname_r "dev_t dev" "mode_t type" "char *path" "size_t len" .Sh DESCRIPTION The .Fn devname -function returns a pointer to the name of the block or character +function returns a pointer to the static buffer with the name of the block or character device in .Dq Pa /dev with a device number of @@ -58,9 +61,49 @@ available, .Dv NULL is returned. .Pp +The +.Fn devname_r +function is a reentrand and thread-safe version of +.Fn devname . +This function returns the device name by copying it into the +.Fa path +argument with up to +.Fa len +characters. +The +.Fa path +argument is always nul-terminated. +.Pp The traditional display for applications when no device is found is the string .Dq ?? . +.Sh RETURN VALUES +If successful, +.Fn devname +returns a pointer to a nul-terminated string containing the name of the device. +If an error occurs +.Fa devname +will return +.Dv NULL . +.Pp +If successful, +.Fn devname_r +places a nul-terminated string containing the name of the device and returns 0. +If error occurs +.Fn devname_r +will return error number indicating what went wrong. +.Sh ERRORS +The +.Fn devname +and +.Fn devname_r +functions my fail if: +.Bl -tag -width Er +.It Bq Er ENOENT +the corresponding device does not exist +.It Bq Er ERANGE +the passed buffer length is too short +.El .Sh FILES .Bl -tag -width /var/run/dev.cdb -compact .It Pa /var/run/dev.cdb @@ -74,3 +117,12 @@ The .Nm devname function call appeared in .Bx 4.4 . +.Pp +The +.Fn devname_r +function first appeared in +.Nx 6.0 . +.Sh BUGS +The +.Fn devname +function does not set errno on failure.
CVS commit: src/lib/libc/stdlib
Module Name:src Committed By: kamil Date: Sat Sep 9 12:28:19 UTC 2017 Modified Files: src/lib/libc/stdlib: ptsname.3 Log Message: Correct the documentatin of ptsname_r(3) This function returns "int" not "char *": errno on failure, 0 on success. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/stdlib/ptsname.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdlib/ptsname.3 diff -u src/lib/libc/stdlib/ptsname.3:1.10 src/lib/libc/stdlib/ptsname.3:1.11 --- src/lib/libc/stdlib/ptsname.3:1.10 Mon Jul 3 21:32:50 2017 +++ src/lib/libc/stdlib/ptsname.3 Sat Sep 9 12:28:19 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: ptsname.3,v 1.10 2017/07/03 21:32:50 wiz Exp $ +.\" $NetBSD: ptsname.3,v 1.11 2017/09/09 12:28:19 kamil Exp $ .\" .\" Copyright (c) 2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 7, 2014 +.Dd September 9, 2017 .Dt PTSNAME 3 .Os .Sh NAME @@ -40,7 +40,7 @@ .In stdlib.h .Ft char * .Fn ptsname "int masterfd" -.Ft char * +.Ft int .Fn ptsname_r "int masterfd" "char *buf" "size_t buflen" .Sh DESCRIPTION The
CVS commit: src/sys/sys
Module Name:src Committed By: kamil Date: Mon Aug 28 01:27:34 UTC 2017 Modified Files: src/sys/sys: param.h Log Message: Welcome to 8.99.2! mount_procfs(8): removal of /proc/#/ctl and filesystem tracing feature To generate a diff of this commit: cvs rdiff -u -r1.544 -r1.545 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.544 src/sys/sys/param.h:1.545 --- src/sys/sys/param.h:1.544 Tue Jul 11 15:39:31 2017 +++ src/sys/sys/param.h Mon Aug 28 01:27:34 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.544 2017/07/11 15:39:31 dholland Exp $ */ +/* $NetBSD: param.h,v 1.545 2017/08/28 01:27:34 kamil Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 899000100 /* NetBSD 8.99.1 */ +#define __NetBSD_Version__ 899000200 /* NetBSD 8.99.2 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src
Module Name:src Committed By: kamil Date: Mon Aug 28 00:46:07 UTC 2017 Modified Files: src/bin/ps: ps.1 src/doc: TODO.ptrace src/sbin/mount_procfs: mount_procfs.8 src/share/man/man9: kauth.9 src/sys/compat/linux/arch/arm: linux_ptrace.c src/sys/compat/linux/arch/i386: linux_ptrace.c src/sys/compat/linux/arch/powerpc: linux_ptrace.c src/sys/kern: kern_exit.c kern_proc.c kern_sig.c sys_ptrace_common.c src/sys/miscfs/procfs: files.procfs procfs.h procfs_subr.c procfs_vfsops.c procfs_vnops.c src/sys/modules/procfs: Makefile src/sys/sys: kauth.h proc.h sysctl.h Removed Files: src/sys/miscfs/procfs: procfs_ctl.c Log Message: Remove the filesystem tracing feature This is a legacy interface from 4.4BSD, and it was introduced to overcome shortcomings of ptrace(2) at that time, which are no longer relevant (performance). Today /proc/#/ctl offers a narrow subset of ptrace(2) commands and is not applicable for modern applications use beyond simplistic tracing scenarios. This removal will simplify kernel internals. Users will still be able to use all the other /proc files. This change won't affect other procfs files neither Linux compat features within mount_procfs(8). /proc/#/ctl isn't available on Linux. Remove: - /proc/#/ctl from mount_procfs(8) - P_FSTRACE note from the documentation of ps(1) - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8) - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9) - source code file miscfs/procfs/procfs_ctl.c - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h - PSL_FSTRACE (0x0001) from sys/sys/proc.h - P_FSTRACE (0x0001) from sys/sys/sysctl.h Reduce code complexity after removal of this functionality. Update TODO.ptrace accordingly: remove two entries about /proc tracing. Do not keep legacy notes as comments in the headers about removed PSL_FSTRACE / P_FSTRACE, as this interface had little number of users (close or equal to zero). Proposed on tech-kern@. All filesystem tracing utility users are encouraged to switch to ptrace(2). Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/bin/ps/ps.1 cvs rdiff -u -r1.28 -r1.29 src/doc/TODO.ptrace cvs rdiff -u -r1.35 -r1.36 src/sbin/mount_procfs/mount_procfs.8 cvs rdiff -u -r1.108 -r1.109 src/share/man/man9/kauth.9 cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux/arch/arm/linux_ptrace.c cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/arch/i386/linux_ptrace.c cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/arch/powerpc/linux_ptrace.c cvs rdiff -u -r1.268 -r1.269 src/sys/kern/kern_exit.c cvs rdiff -u -r1.206 -r1.207 src/sys/kern/kern_proc.c cvs rdiff -u -r1.336 -r1.337 src/sys/kern/kern_sig.c cvs rdiff -u -r1.22 -r1.23 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.11 -r1.12 src/sys/miscfs/procfs/files.procfs cvs rdiff -u -r1.71 -r1.72 src/sys/miscfs/procfs/procfs.h cvs rdiff -u -r1.48 -r0 src/sys/miscfs/procfs/procfs_ctl.c cvs rdiff -u -r1.108 -r1.109 src/sys/miscfs/procfs/procfs_subr.c cvs rdiff -u -r1.97 -r1.98 src/sys/miscfs/procfs/procfs_vfsops.c cvs rdiff -u -r1.197 -r1.198 src/sys/miscfs/procfs/procfs_vnops.c cvs rdiff -u -r1.3 -r1.4 src/sys/modules/procfs/Makefile cvs rdiff -u -r1.74 -r1.75 src/sys/sys/kauth.h cvs rdiff -u -r1.341 -r1.342 src/sys/sys/proc.h cvs rdiff -u -r1.223 -r1.224 src/sys/sys/sysctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ps/ps.1 diff -u src/bin/ps/ps.1:1.107 src/bin/ps/ps.1:1.108 --- src/bin/ps/ps.1:1.107 Mon Jul 3 21:33:23 2017 +++ src/bin/ps/ps.1 Mon Aug 28 00:46:06 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: ps.1,v 1.107 2017/07/03 21:33:23 wiz Exp $ +.\" $NetBSD: ps.1,v 1.108 2017/08/28 00:46:06 kamil Exp $ .\" .\" Copyright (c) 1980, 1990, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -308,7 +308,6 @@ the include file .It Dv "P_EXEC" Ta No "0x4000 process called" Xr execve 2 .It Dv "P_OWEUPC" Ta No "0x8000 owe process an addupc() call at next ast" .\" the routine addupc is not documented in the man pages -.It Dv "P_FSTRACE" Ta No "0x0001 tracing via file system" .It Dv "P_NOCLDWAIT" Ta No "0x0002 no zombies when children die" .It Dv "P_32" Ta No "0x0004 32-bit process (used on 64-bit kernels)" .It Dv "P_BIGLOCK" Ta No "0x0008 process needs kernel ``big lock'' to run" Index: src/doc/TODO.ptrace diff -u src/doc/TODO.ptrace:1.28 src/doc/TODO.ptrace:1.29 --- src/doc/TODO.ptrace:1.28 Sat Apr 8 01:08:36 2017 +++ src/doc/TODO.ptrace Mon Aug 28 00:46:07 2017 @@ -1,4 +1,4 @@ -$NetBSD: TODO.ptrace,v 1.28 2017/04/08 01:08:36 kamil Exp $ +$NetBSD: TODO.ptrace,v 1.29 2017/08/28 00:46:07 kamil Exp $ Items we (currently) plan to finish in the ptrace(2) field: @@ -8,11 +8,6
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 05:18:36 UTC 2017 Modified Files: src/bin/ksh: edit.c Log Message: ksh: Eliminate dead function x_complete_word() To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/edit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/edit.c diff -u src/bin/ksh/edit.c:1.32 src/bin/ksh/edit.c:1.33 --- src/bin/ksh/edit.c:1.32 Fri Jun 30 04:41:19 2017 +++ src/bin/ksh/edit.c Fri Jun 30 05:18:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: edit.c,v 1.32 2017/06/30 04:41:19 kamil Exp $ */ +/* $NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $ */ /* * Command line editing - common code @@ -7,7 +7,7 @@ #include #ifndef lint -__RCSID("$NetBSD: edit.c,v 1.32 2017/06/30 04:41:19 kamil Exp $"); +__RCSID("$NetBSD: edit.c,v 1.33 2017/06/30 05:18:36 kamil Exp $"); #endif #include @@ -451,35 +451,6 @@ static char *add_glob ARGS((const char * static void glob_table ARGS((const char *, XPtrV *, struct table *)); static void glob_path ARGS((int, const char *, XPtrV *, const char *)); -#if 0 /* not used... */ -int x_complete_word ARGS((const char *, int, int, int *, char **)); -int -x_complete_word(str, slen, is_command, nwordsp, ret) - const char *str; - int slen; - int is_command; - int *nwordsp; - char **ret; -{ - int nwords; - int prefix_len; - char **words; - - nwords = (is_command ? x_command_glob : x_file_glob)(XCF_FULLPATH, -str, slen, ); - *nwordsp = nwords; - if (nwords == 0) { - *ret = (char *) 0; - return -1; - } - - prefix_len = x_longest_prefix(nwords, words); - *ret = str_nsave(words[0], prefix_len, ATEMP); - x_free_words(nwords, words); - return prefix_len; -} -#endif /* 0 */ - void x_print_expansions(nwords, words, is_command) int nwords;
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 05:14:12 UTC 2017 Modified Files: src/bin/ksh: expand.h Log Message: ksh: Eliminate dead code from expand.h To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/expand.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/expand.h diff -u src/bin/ksh/expand.h:1.5 src/bin/ksh/expand.h:1.6 --- src/bin/ksh/expand.h:1.5 Fri Oct 18 19:53:34 2013 +++ src/bin/ksh/expand.h Fri Jun 30 05:14:12 2017 @@ -1,30 +1,12 @@ -/* $NetBSD: expand.h,v 1.5 2013/10/18 19:53:34 christos Exp $ */ +/* $NetBSD: expand.h,v 1.6 2017/06/30 05:14:12 kamil Exp $ */ /* * Expanding strings */ -/* $Id: expand.h,v 1.5 2013/10/18 19:53:34 christos Exp $ */ +/* $Id: expand.h,v 1.6 2017/06/30 05:14:12 kamil Exp $ */ #define X_EXTRA 8 /* this many extra bytes in X string */ -#if 0/* Usage */ - XString xs; - char *xp; - - Xinit(xs, xp, 128, ATEMP); /* allocate initial string */ - while ((c = generate()) { - Xcheck(xs, xp); /* expand string if necessary */ - Xput(xs, xp, c); /* add character */ - } - return Xclose(xs, xp); /* resize string */ -/* - * NOTE: - * The Xcheck and Xinit macros have a magic + X_EXTRA in the lengths. - * This is so that you can put up to X_EXTRA characters in a XString - * before calling Xcheck. (See yylex in lex.c) - */ -#endif /* 0 */ - typedef struct XString { char *end, *beg; /* end, begin of string */ size_t len; /* length */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 04:44:46 UTC 2017 Modified Files: src/bin/ksh: sh.h Log Message: ksh: Drop old hack for FreeBSD 1.1.5 and CLK_TCK To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.34 src/bin/ksh/sh.h:1.35 --- src/bin/ksh/sh.h:1.34 Fri Jun 30 04:41:19 2017 +++ src/bin/ksh/sh.h Fri Jun 30 04:44:46 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.34 2017/06/30 04:41:19 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.35 2017/06/30 04:44:46 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.34 2017/06/30 04:41:19 kamil Exp $ */ +/* $Id: sh.h,v 1.35 2017/06/30 04:44:46 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -47,9 +47,6 @@ # endif /* L_SET */ #endif /* !SEEK_SET */ -/* Some machines (eg, FreeBSD 1.1.5) define CLK_TCK in limits.h - * (ksh_limval.h assumes limits has been included, if available) - */ #include #include
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 04:41:19 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c c_sh.c c_test.c edit.c edit.h emacs.c eval.c exec.c expr.c history.c io.c jobs.c lex.c mail.c main.c misc.c proto.h sh.h syn.c trap.c tty.c var.c vi.c Log Message: ksh: Upgrade to C99 This shell already used C99 functions. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/c_sh.c src/bin/ksh/exec.c \ src/bin/ksh/misc.c cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/c_test.c src/bin/ksh/proto.h \ src/bin/ksh/tty.c cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/edit.c cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/edit.h cvs rdiff -u -r1.36 -r1.37 src/bin/ksh/emacs.c cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/eval.c src/bin/ksh/main.c cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/expr.c src/bin/ksh/syn.c cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/history.c src/bin/ksh/io.c cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/jobs.c cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/lex.c cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/mail.c cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/sh.h cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/trap.c cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/var.c cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.25 src/bin/ksh/c_ksh.c:1.26 --- src/bin/ksh/c_ksh.c:1.25 Fri Jun 30 03:56:12 2017 +++ src/bin/ksh/c_ksh.c Fri Jun 30 04:41:19 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.26 2017/06/30 04:41:19 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.26 2017/06/30 04:41:19 kamil Exp $"); #endif #include @@ -717,7 +717,7 @@ c_typeset(wp) for (i = builtin_opt.optind; wp[i]; i++) { if (func) { f = findfunc(wp[i], hash(wp[i]), - (fset_AL) ? TRUE : FALSE); + (fset_AL) ? true : false); if (!f) { /* at ksh does ++rval: bogus */ rval = 1; @@ -1173,7 +1173,7 @@ c_kill(wp) /* assume old style options if -digits or -UPPERCASE */ if ((p = wp[1]) && *p == '-' && (digit(p[1]) || isupper((unsigned char)p[1]))) { - if (!(t = gettrap(p + 1, TRUE))) { + if (!(t = gettrap(p + 1, true))) { bi_errorf("bad signal `%s'", p + 1); return 1; } @@ -1187,7 +1187,7 @@ c_kill(wp) lflag = 1; break; case 's': -if (!(t = gettrap(builtin_opt.optarg, TRUE))) { +if (!(t = gettrap(builtin_opt.optarg, true))) { bi_errorf("bad signal `%s'", builtin_opt.optarg); return 1; @@ -1311,7 +1311,7 @@ c_getopts(wp) bi_errorf("missing name argument"); return 1; } - if (!*var || *skip_varname(var, TRUE)) { + if (!*var || *skip_varname(var, true)) { bi_errorf("%s: is not an identifier", var); return 1; } Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.22 src/bin/ksh/c_sh.c:1.23 --- src/bin/ksh/c_sh.c:1.22 Fri Jun 30 03:56:12 2017 +++ src/bin/ksh/c_sh.c Fri Jun 30 04:41:19 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $ */ +/* $NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $ */ /* * built-in Bourne commands @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $"); #endif #include @@ -464,7 +464,7 @@ c_eval(wp) exstat = subst_exstat; } - rv = shell(s, FALSE); + rv = shell(s, false); afree(s, ATEMP); return rv; } @@ -515,13 +515,13 @@ c_trap(wp) * command 'exit' isn't confused with the pseudo-signal * 'EXIT'. */ - s = (gettrap(*wp, FALSE) == NULL) ? *wp++ : NULL; /* get command */ + s = (gettrap(*wp, false) == NULL) ? *wp++ : NULL; /* get command */ if (s != NULL && s[0] == '-' && s[1] == '\0') s = NULL; /* set/clear traps */ while (*wp != NULL) { - p = gettrap(*wp++, TRUE); + p = gettrap(*wp++, true); if (p == NULL) { bi_errorf("bad signal %s", wp[-1]); return 1; @@ -546,7 +546,7 @@ c_exitreturn(wp) if (arg) { if (!getn(arg, )) { exstat = 1; - warningf(TRUE, "%s: bad number", arg); + warningf(true, "%s: bad number", arg); } else exstat = n; } @@ -612,7 +612,7 @@ c_brkcont(wp) * scripts, but don't generate an error (ie, keep going). */ if (n == quit) { - warningf(TRUE, "%s: cannot %s", wp[0], wp[0]); + warningf(true, "%s: cannot %s", wp[0], wp[0]); return 0; } /* POSIX says if n is too big, the last enclosing loop @@ -621,7 +621,7 @@ c_brkcont(wp) */ if (last_ep) last_ep->flags &= ~EF_BRKCONT_PASS; - warningf(TRUE, "%s: can only %s %d level(s)", + warningf(true, "%s: can only %s %d
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 04:30:26 UTC 2017 Modified Files: src/bin/ksh: main.c sh.h Log Message: ksh: Eliminate dead MEM_DEBUG sections, there is missing code for it MEM_DEBUG used to contain malloc(3) debugging facilities. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/main.c cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/main.c diff -u src/bin/ksh/main.c:1.20 src/bin/ksh/main.c:1.21 --- src/bin/ksh/main.c:1.20 Fri Jun 30 03:56:12 2017 +++ src/bin/ksh/main.c Fri Jun 30 04:30:26 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.20 2017/06/30 03:56:12 kamil Exp $ */ +/* $NetBSD: main.c,v 1.21 2017/06/30 04:30:26 kamil Exp $ */ /* * startup, main loop, environments and error handling @@ -10,7 +10,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.20 2017/06/30 03:56:12 kamil Exp $"); +__RCSID("$NetBSD: main.c,v 1.21 2017/06/30 04:30:26 kamil Exp $"); #endif @@ -102,11 +102,6 @@ main(int argc, char *argv[]) struct env env; pid_t ppid; -#ifdef MEM_DEBUG - chmem_set_defaults("ct", 1); - /* chmem_push("+c", 1); */ -#endif /* MEM_DEBUG */ - /* make sure argv[] is sane */ if (!*argv) { static const char *empty_argv[] = { @@ -711,9 +706,6 @@ quitenv() kill(0, sig); } } -#ifdef MEM_DEBUG - chmem_allfree(); -#endif /* MEM_DEBUG */ } exit(exstat); } Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.32 src/bin/ksh/sh.h:1.33 --- src/bin/ksh/sh.h:1.32 Fri Jun 30 04:22:22 2017 +++ src/bin/ksh/sh.h Fri Jun 30 04:30:26 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.33 2017/06/30 04:30:26 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $ */ +/* $Id: sh.h,v 1.33 2017/06/30 04:30:26 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -205,10 +205,6 @@ EXTERN Area aperm; /* permanent object #define APERM #define ATEMP >area -#ifdef MEM_DEBUG -# include "chmem.h" /* a debugging front end for malloc et. al. */ -#endif /* MEM_DEBUG */ - #ifdef KSH_DEBUG # define kshdebug_init() kshdebug_init_() # define kshdebug_printf(a) kshdebug_printf_ a
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 04:22:22 UTC 2017 Modified Files: src/bin/ksh: Makefile config.h sh.h Removed Files: src/bin/ksh: sigact.c sigact.h Log Message: ksh: Drop support for OSes without POSIX sigaction(2) To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/Makefile cvs rdiff -u -r1.52 -r1.53 src/bin/ksh/config.h cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/sh.h cvs rdiff -u -r1.7 -r0 src/bin/ksh/sigact.c cvs rdiff -u -r1.3 -r0 src/bin/ksh/sigact.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/Makefile diff -u src/bin/ksh/Makefile:1.33 src/bin/ksh/Makefile:1.34 --- src/bin/ksh/Makefile:1.33 Wed Mar 16 23:02:23 2016 +++ src/bin/ksh/Makefile Fri Jun 30 04:22:22 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.33 2016/03/16 23:02:23 christos Exp $ +# $NetBSD: Makefile,v 1.34 2017/06/30 04:22:22 kamil Exp $ WARNS=3 CWARNFLAGS.clang+= -Wno-error=cast-qual @@ -10,8 +10,8 @@ CPPFLAGS+= -I. PROG= ksh SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c \ eval.c exec.c expr.c history.c io.c jobs.c lex.c mail.c \ - main.c misc.c path.c shf.c sigact.c syn.c table.c trap.c \ - tree.c tty.c var.c version.c vi.c + main.c misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c \ + var.c version.c vi.c DPSRCS= emacs.out siglist.out .if (${MKMAN} != "no") DPSRCS+=ksh.1 Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.52 src/bin/ksh/config.h:1.53 --- src/bin/ksh/config.h:1.52 Fri Jun 30 04:11:57 2017 +++ src/bin/ksh/config.h Fri Jun 30 04:22:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.52 2017/06/30 04:11:57 kamil Exp $ */ +/* $NetBSD: config.h,v 1.53 2017/06/30 04:22:22 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -30,9 +30,6 @@ /* Define as the return value of signal handlers (0 or ). */ #define RETSIGVAL -/* Define to use the fake posix signal routines (sigact.[ch]) */ -/* #undef USE_FAKE_SIGACT */ - /* Define if you have bsd versions of the setpgrp() and getpgrp() routines */ /* #undef BSD_PGRP */ Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.31 src/bin/ksh/sh.h:1.32 --- src/bin/ksh/sh.h:1.31 Fri Jun 30 02:51:14 2017 +++ src/bin/ksh/sh.h Fri Jun 30 04:22:22 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */ +/* $Id: sh.h,v 1.32 2017/06/30 04:22:22 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -80,10 +80,6 @@ typedef RETSIGTYPE (*handler_t) ARGS((int)); /* signal handler */ -#ifdef USE_FAKE_SIGACT -# include "sigact.h" /* use sjg's fake sigaction() */ -#endif - #ifdef HAVE_PATHS_H # include #endif /* HAVE_PATHS_H */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 04:11:57 UTC 2017 Modified Files: src/bin/ksh: c_test.c config.h Log Message: ksh: Drop support for OSes that don't map /dev/fd To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/c_test.c cvs rdiff -u -r1.51 -r1.52 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_test.c diff -u src/bin/ksh/c_test.c:1.7 src/bin/ksh/c_test.c:1.8 --- src/bin/ksh/c_test.c:1.7 Fri Jun 30 03:56:12 2017 +++ src/bin/ksh/c_test.c Fri Jun 30 04:11:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $ */ +/* $NetBSD: c_test.c,v 1.8 2017/06/30 04:11:57 kamil Exp $ */ /* * test(1); version 7-like -- author Erik Baalbergen @@ -11,7 +11,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $"); +__RCSID("$NetBSD: c_test.c,v 1.8 2017/06/30 04:11:57 kamil Exp $"); #endif #include @@ -422,19 +422,11 @@ test_eval(te, op, opnd1, opnd2, do_eval) return 1; } -/* Nasty kludge to handle Korn's bizarre /dev/fd hack */ static int test_stat(pathx, statb) const char *pathx; struct stat *statb; { -#if !defined(HAVE_DEV_FD) - int fd; - - if (strncmp(pathx, "/dev/fd/", 8) == 0 && getn(pathx + 8, )) - return fstat(fd, statb); -#endif /* !HAVE_DEV_FD */ - return stat(pathx, statb); } @@ -448,22 +440,6 @@ test_eaccess(pathx, mode) { int res; -#if !defined(HAVE_DEV_FD) - int fd; - - /* Note: doesn't handle //dev/fd, etc.. (this is ok) */ - if (strncmp(pathx, "/dev/fd/", 8) == 0 && getn(pathx + 8, )) { - int flags; - - if ((flags = fcntl(fd, F_GETFL, 0)) < 0 - || (mode & X_OK) - || ((mode & W_OK) && (flags & O_ACCMODE) == O_RDONLY) - || ((mode & R_OK) && (flags & O_ACCMODE) == O_WRONLY)) - return -1; - return 0; - } -#endif /* !HAVE_DEV_FD */ - res = eaccess(pathx, mode); /* * On most (all?) unixes, access() says everything is executable for Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.51 src/bin/ksh/config.h:1.52 --- src/bin/ksh/config.h:1.51 Fri Jun 30 03:56:12 2017 +++ src/bin/ksh/config.h Fri Jun 30 04:11:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.51 2017/06/30 03:56:12 kamil Exp $ */ +/* $NetBSD: config.h,v 1.52 2017/06/30 04:11:57 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -69,9 +69,6 @@ /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */ /* #undef NEED_PGRP_SYNC */ -/* Define if your OS maps references to /dev/fd/n to file descriptor n */ -#define HAVE_DEV_FD 1 - /* Default PATH */ #ifdef RESCUEDIR #define DEFAULT_PATH RESCUEDIR ":/bin:/usr/bin:/sbin:/usr/sbin"
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 04:01:48 UTC 2017 Modified Files: src/bin/ksh: proto.h Log Message: ksh: Drop old hack fo SunOS 4.1.x (1990-1994) To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/proto.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/proto.h diff -u src/bin/ksh/proto.h:1.7 src/bin/ksh/proto.h:1.8 --- src/bin/ksh/proto.h:1.7 Sun Jun 26 19:09:00 2005 +++ src/bin/ksh/proto.h Fri Jun 30 04:01:48 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: proto.h,v 1.7 2005/06/26 19:09:00 christos Exp $ */ +/* $NetBSD: proto.h,v 1.8 2017/06/30 04:01:48 kamil Exp $ */ /* * prototypes for PD-KSH * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang " - * $Id: proto.h,v 1.7 2005/06/26 19:09:00 christos Exp $ + * $Id: proto.h,v 1.8 2017/06/30 04:01:48 kamil Exp $ */ /* alloc.c */ @@ -273,26 +273,3 @@ char * arrayname ARGS((const char *)); voidset_array ARGS((const char *, int, char **)); /* version.c */ /* vi.c: see edit.h */ - - -/* Hack to avoid billions of compile warnings on SunOS 4.1.x */ -#if defined(MUN) && defined(sun) && !defined(__svr4__) -extern void bcopy ARGS((const void *, void *, size_t)); -extern intclose ARGS((FILE *)); -extern intprintf ARGS((FILE *, const char *, ...)); -extern intread ARGS((void *, int, int, FILE *)); -extern int ioctl ARGS((int, int, void *)); -extern int killpg ARGS((int, int)); -extern int nice ARGS((int)); -extern int readlink ARGS((const char *, char *, int)); -extern int setpgrp ARGS((int, int)); -extern int strcasecmp ARGS((const char *, const char *)); -extern int tolower ARGS((int)); -extern int toupper ARGS((int)); -/* Include files aren't included yet */ -extern int getrlimit ARGS(( /* int, struct rlimit * */ )); -extern int getrusage ARGS(( /* int, struct rusage * */ )); -extern int gettimeofday ARGS(( /* struct timeval *, struct timezone * */ )); -extern int setrlimit ARGS(( /* int, struct rlimit * */ )); -extern int lstat ARGS(( /* const char *, struct stat * */ )); -#endif
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 03:56:12 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c c_sh.c c_test.c config.h edit.c emacs.c eval.c exec.c history.c io.c jobs.c mail.c main.c path.c shf.c tty.c var.c vi.c Removed Files: src/bin/ksh: ksh_stat.h Log Message: ksh: Drop support for systems without In future the order of includes will be normalized with KNF. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/c_sh.c src/bin/ksh/exec.c cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/c_test.c src/bin/ksh/mail.c cvs rdiff -u -r1.50 -r1.51 src/bin/ksh/config.h cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/edit.c cvs rdiff -u -r1.35 -r1.36 src/bin/ksh/emacs.c cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/eval.c cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/history.c src/bin/ksh/io.c cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/jobs.c cvs rdiff -u -r1.3 -r0 src/bin/ksh/ksh_stat.h cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/main.c cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/path.c src/bin/ksh/shf.c cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/tty.c cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/var.c cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.24 src/bin/ksh/c_ksh.c:1.25 --- src/bin/ksh/c_ksh.c:1.24 Thu Jun 22 19:41:07 2017 +++ src/bin/ksh/c_ksh.c Fri Jun 30 03:56:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.24 2017/06/22 19:41:07 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,13 +6,14 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.24 2017/06/22 19:41:07 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.25 2017/06/30 03:56:12 kamil Exp $"); #endif -#include "sh.h" -#include "ksh_stat.h" +#include #include +#include "sh.h" + int c_cd(wp) char **wp; Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.21 src/bin/ksh/c_sh.c:1.22 --- src/bin/ksh/c_sh.c:1.21 Fri Jun 30 03:43:57 2017 +++ src/bin/ksh/c_sh.c Fri Jun 30 03:56:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $ */ +/* $NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $ */ /* * built-in Bourne commands @@ -6,16 +6,15 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.22 2017/06/30 03:56:12 kamil Exp $"); #endif +#include #include #include #include #include "sh.h" -#include "ksh_stat.h" /* umask() */ - static char *clocktos ARGS((clock_t t)); Index: src/bin/ksh/exec.c diff -u src/bin/ksh/exec.c:1.21 src/bin/ksh/exec.c:1.22 --- src/bin/ksh/exec.c:1.21 Fri Jun 30 02:38:10 2017 +++ src/bin/ksh/exec.c Fri Jun 30 03:56:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $ */ +/* $NetBSD: exec.c,v 1.22 2017/06/30 03:56:12 kamil Exp $ */ /* * execute command tree @@ -6,14 +6,14 @@ #include #ifndef lint -__RCSID("$NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $"); +__RCSID("$NetBSD: exec.c,v 1.22 2017/06/30 03:56:12 kamil Exp $"); #endif +#include +#include #include "sh.h" #include "c_test.h" -#include -#include "ksh_stat.h" /* Does ps4 get parameter substitutions done? */ #ifdef KSH Index: src/bin/ksh/c_test.c diff -u src/bin/ksh/c_test.c:1.6 src/bin/ksh/c_test.c:1.7 --- src/bin/ksh/c_test.c:1.6 Sun Jun 26 19:09:00 2005 +++ src/bin/ksh/c_test.c Fri Jun 30 03:56:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_test.c,v 1.6 2005/06/26 19:09:00 christos Exp $ */ +/* $NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $ */ /* * test(1); version 7-like -- author Erik Baalbergen @@ -11,12 +11,12 @@ #include #ifndef lint -__RCSID("$NetBSD: c_test.c,v 1.6 2005/06/26 19:09:00 christos Exp $"); +__RCSID("$NetBSD: c_test.c,v 1.7 2017/06/30 03:56:12 kamil Exp $"); #endif +#include #include "sh.h" -#include "ksh_stat.h" #include "c_test.h" /* test(1) accepts the following grammar: Index: src/bin/ksh/mail.c diff -u src/bin/ksh/mail.c:1.6 src/bin/ksh/mail.c:1.7 --- src/bin/ksh/mail.c:1.6 Fri Jun 30 03:43:57 2017 +++ src/bin/ksh/mail.c Fri Jun 30 03:56:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $ */ +/* $NetBSD: mail.c,v 1.7 2017/06/30 03:56:12 kamil Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -7,17 +7,17 @@ #include #ifndef lint -__RCSID("$NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $"); +__RCSID("$NetBSD: mail.c,v 1.7 2017/06/30 03:56:12 kamil Exp $"); #endif #include "config.h" #ifdef KSH +#include #include #include #include "sh.h" -#include "ksh_stat.h" #define MBMESSAGE "You have mail in $_" Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.50
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 03:43:57 UTC 2017 Modified Files: src/bin/ksh: c_sh.c c_ulimit.c config.h mail.c main.c var.c Removed Files: src/bin/ksh: ksh_time.h Log Message: ksh: Drop support for systems with broken / To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/c_sh.c cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/c_ulimit.c cvs rdiff -u -r1.49 -r1.50 src/bin/ksh/config.h cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_time.h cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/mail.c cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/main.c cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.20 src/bin/ksh/c_sh.c:1.21 --- src/bin/ksh/c_sh.c:1.20 Fri Jun 30 03:23:18 2017 +++ src/bin/ksh/c_sh.c Fri Jun 30 03:43:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $ */ +/* $NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $ */ /* * built-in Bourne commands @@ -6,14 +6,15 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.21 2017/06/30 03:43:57 kamil Exp $"); #endif +#include #include +#include #include "sh.h" #include "ksh_stat.h" /* umask() */ -#include "ksh_time.h" static char *clocktos ARGS((clock_t t)); Index: src/bin/ksh/c_ulimit.c diff -u src/bin/ksh/c_ulimit.c:1.15 src/bin/ksh/c_ulimit.c:1.16 --- src/bin/ksh/c_ulimit.c:1.15 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/c_ulimit.c Fri Jun 30 03:43:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ulimit.c,v 1.15 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: c_ulimit.c,v 1.16 2017/06/30 03:43:57 kamil Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -20,12 +20,13 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ulimit.c,v 1.15 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: c_ulimit.c,v 1.16 2017/06/30 03:43:57 kamil Exp $"); #endif +#include +#include #include "sh.h" -#include "ksh_time.h" #ifdef HAVE_SYS_RESOURCE_H # include #endif /* HAVE_SYS_RESOURCE_H */ Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.49 src/bin/ksh/config.h:1.50 --- src/bin/ksh/config.h:1.49 Fri Jun 30 03:35:16 2017 +++ src/bin/ksh/config.h Fri Jun 30 03:43:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.49 2017/06/30 03:35:16 kamil Exp $ */ +/* $NetBSD: config.h,v 1.50 2017/06/30 03:43:57 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -33,9 +33,6 @@ /* Define if `sys_siglist' is declared by . */ #define SYS_SIGLIST_DECLARED 1 -/* Define if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - /* Define as the return value of signal handlers (0 or ). */ #define RETSIGVAL @@ -57,9 +54,6 @@ /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */ #define HAVE_GCC_FUNC_ATTR 1 -/* Define if time() is declared in */ -#define TIME_DECLARED 1 - /* Define if sys_errlist[] and sys_nerr are in the C library */ #define HAVE_SYS_ERRLIST 1 @@ -196,9 +190,6 @@ /* Define if you have the header file. */ #define HAVE_SYS_RESOURCE_H 1 -/* Define if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - /* Define if you have the header file. */ #define HAVE_ULIMIT_H Index: src/bin/ksh/mail.c diff -u src/bin/ksh/mail.c:1.5 src/bin/ksh/mail.c:1.6 --- src/bin/ksh/mail.c:1.5 Sun Jan 15 18:16:30 2006 +++ src/bin/ksh/mail.c Fri Jun 30 03:43:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: mail.c,v 1.5 2006/01/15 18:16:30 jschauma Exp $ */ +/* $NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -7,16 +7,17 @@ #include #ifndef lint -__RCSID("$NetBSD: mail.c,v 1.5 2006/01/15 18:16:30 jschauma Exp $"); +__RCSID("$NetBSD: mail.c,v 1.6 2017/06/30 03:43:57 kamil Exp $"); #endif - #include "config.h" #ifdef KSH +#include +#include + #include "sh.h" #include "ksh_stat.h" -#include "ksh_time.h" #define MBMESSAGE "You have mail in $_" Index: src/bin/ksh/main.c diff -u src/bin/ksh/main.c:1.18 src/bin/ksh/main.c:1.19 --- src/bin/ksh/main.c:1.18 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/main.c Fri Jun 30 03:43:57 2017 @@ -1,13 +1,15 @@ -/* $NetBSD: main.c,v 1.18 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: main.c,v 1.19 2017/06/30 03:43:57 kamil Exp $ */ /* * startup, main loop, environments and error handling */ #include +#include #include +#include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.18 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: main.c,v 1.19 2017/06/30 03:43:57 kamil Exp $"); #endif @@ -15,7 +17,6 @@ __RCSID("$NetBSD: main.c,v 1.18 2017/06/ #include "sh.h" #include "ksh_stat.h" -#include "ksh_time.h" extern char
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 03:35:16 UTC 2017 Modified Files: src/bin/ksh: config.h ksh_stat.h Log Message: ksh: Drop support for systems without POSIX lstat(2) To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/bin/ksh/config.h cvs rdiff -u -r1.2 -r1.3 src/bin/ksh/ksh_stat.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.48 src/bin/ksh/config.h:1.49 --- src/bin/ksh/config.h:1.48 Fri Jun 30 03:32:28 2017 +++ src/bin/ksh/config.h Fri Jun 30 03:35:16 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.48 2017/06/30 03:32:28 kamil Exp $ */ +/* $NetBSD: config.h,v 1.49 2017/06/30 03:35:16 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -72,9 +72,6 @@ /* Define if you have a sane header file */ #define HAVE_TERMIOS_H 1 -/* Define if you have a lstat() function in your C library */ -#define HAVE_LSTAT 1 - /* Define if you have a sane header file */ /* #undef HAVE_TERMIO_H */ Index: src/bin/ksh/ksh_stat.h diff -u src/bin/ksh/ksh_stat.h:1.2 src/bin/ksh/ksh_stat.h:1.3 --- src/bin/ksh/ksh_stat.h:1.2 Sun Jan 12 19:12:00 1997 +++ src/bin/ksh/ksh_stat.h Fri Jun 30 03:35:16 2017 @@ -1,15 +1,11 @@ -/* $NetBSD: ksh_stat.h,v 1.2 1997/01/12 19:12:00 tls Exp $ */ +/* $NetBSD: ksh_stat.h,v 1.3 2017/06/30 03:35:16 kamil Exp $ */ /* Wrapper around the ugly sys/stat includes/ifdefs */ -/* $NetBSD: ksh_stat.h,v 1.2 1997/01/12 19:12:00 tls Exp $ */ +/* $NetBSD: ksh_stat.h,v 1.3 2017/06/30 03:35:16 kamil Exp $ */ /* assumes already included */ #include -#ifndef HAVE_LSTAT -# define lstat(path, buf) stat(path, buf) -#endif /* HAVE_LSTAT */ - #ifdef STAT_MACROS_BROKEN # undef S_ISREG # undef S_ISDIR
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 03:32:28 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Drop support for systems without POSIX To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.47 src/bin/ksh/config.h:1.48 --- src/bin/ksh/config.h:1.47 Fri Jun 30 03:23:18 2017 +++ src/bin/ksh/config.h Fri Jun 30 03:32:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.47 2017/06/30 03:23:18 kamil Exp $ */ +/* $NetBSD: config.h,v 1.48 2017/06/30 03:32:28 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -84,9 +84,6 @@ /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */ /* #undef NEED_PGRP_SYNC */ -/* Define if you have a POSIX.1 compatible */ -#define POSIX_SYS_WAIT 1 - /* Define if your OS maps references to /dev/fd/n to file descriptor n */ #define HAVE_DEV_FD 1
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 03:23:18 UTC 2017 Modified Files: src/bin/ksh: c_sh.c config.h jobs.c Removed Files: src/bin/ksh: ksh_times.h Log Message: ksh: Drop support for systems with broken times(3) This fallback code wouldn't work anyway. times(3) is an obsolete interface by getrusage(2) and gettimeofday(2). In future it will be swiched to more modern interfaces. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/c_sh.c cvs rdiff -u -r1.46 -r1.47 src/bin/ksh/config.h cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/jobs.c cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_times.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.19 src/bin/ksh/c_sh.c:1.20 --- src/bin/ksh/c_sh.c:1.19 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/c_sh.c Fri Jun 30 03:23:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $ */ /* * built-in Bourne commands @@ -6,14 +6,15 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.20 2017/06/30 03:23:18 kamil Exp $"); #endif +#include #include "sh.h" #include "ksh_stat.h" /* umask() */ #include "ksh_time.h" -#include "ksh_times.h" + static char *clocktos ARGS((clock_t t)); @@ -706,7 +707,7 @@ c_times(wp) { struct tms all; - (void) ksh_times(); + times(); shprintf("Shell: %8ss user ", clocktos(all.tms_utime)); shprintf("%8ss system\n", clocktos(all.tms_stime)); shprintf("Kids: %8ss user ", clocktos(all.tms_cutime)); @@ -733,7 +734,7 @@ timex(t, f) extern clock_t j_usrtime, j_systime; /* computed by j_wait */ char opts[1]; - t0t = ksh_times(); + t0t = times(); if (t->left) { /* * Two ways of getting cpu usage of a command: just use t0 @@ -749,7 +750,7 @@ timex(t, f) opts[0] = 0; rv = execute(t->left, f | XTIME); tf |= opts[0]; - t1t = ksh_times(); + t1t = times(); } else tf = TF_NOARGS; Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.46 src/bin/ksh/config.h:1.47 --- src/bin/ksh/config.h:1.46 Fri Jun 30 02:51:14 2017 +++ src/bin/ksh/config.h Fri Jun 30 03:23:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.46 2017/06/30 02:51:14 kamil Exp $ */ +/* $NetBSD: config.h,v 1.47 2017/06/30 03:23:18 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -78,9 +78,6 @@ /* Define if you have a sane header file */ /* #undef HAVE_TERMIO_H */ -/* Define if you don't have times() or if it always returns 0 */ -/* #undef TIMES_BROKEN */ - /* Define if opendir() will open non-directory files */ /* #undef OPENDIR_DOES_NONDIR */ Index: src/bin/ksh/jobs.c diff -u src/bin/ksh/jobs.c:1.16 src/bin/ksh/jobs.c:1.17 --- src/bin/ksh/jobs.c:1.16 Fri Jun 30 02:38:10 2017 +++ src/bin/ksh/jobs.c Fri Jun 30 03:23:18 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $ */ +/* $NetBSD: jobs.c,v 1.17 2017/06/30 03:23:18 kamil Exp $ */ /* * Process and job control @@ -21,14 +21,14 @@ #include #ifndef lint -__RCSID("$NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.17 2017/06/30 03:23:18 kamil Exp $"); #endif +#include #include #include "sh.h" #include "ksh_stat.h" -#include "ksh_times.h" #include "tty.h" /* Start of system configuration stuff */ @@ -1263,14 +1263,14 @@ j_sigchld(sig) return RETSIGVAL; } - ksh_times(); + times(); do { pid = waitpid(-1, , (WNOHANG|WUNTRACED)); if (pid <= 0) /* return if would block (0) ... */ break; /* ... or no children or interrupted (-1) */ - ksh_times(); + times(); /* find job and process structures for this pid */ for (j = job_list; j != (Job *) 0; j = j->next)
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 02:51:14 UTC 2017 Modified Files: src/bin/ksh: config.h io.c lex.c sh.h shf.c tree.c Log Message: ksh: Assume ANSI C prototypes To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/bin/ksh/config.h cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/io.c cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/lex.c cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/sh.h cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/shf.c cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.45 src/bin/ksh/config.h:1.46 --- src/bin/ksh/config.h:1.45 Fri Jun 30 02:38:09 2017 +++ src/bin/ksh/config.h Fri Jun 30 02:51:14 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.45 2017/06/30 02:38:09 kamil Exp $ */ +/* $NetBSD: config.h,v 1.46 2017/06/30 02:51:14 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -54,9 +54,6 @@ /* Define if you don't have setpgrp(), setpgid() or getpgrp() routines */ /* #undef NO_PGRP */ -/* Define if C compiler groks function prototypes */ -#define HAVE_PROTOTYPES 1 - /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */ #define HAVE_GCC_FUNC_ATTR 1 Index: src/bin/ksh/io.c diff -u src/bin/ksh/io.c:1.14 src/bin/ksh/io.c:1.15 --- src/bin/ksh/io.c:1.14 Fri Jun 23 00:18:01 2017 +++ src/bin/ksh/io.c Fri Jun 30 02:51:14 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $ */ +/* $NetBSD: io.c,v 1.15 2017/06/30 02:51:14 kamil Exp $ */ /* * shell buffered IO and formatted output @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $"); +__RCSID("$NetBSD: io.c,v 1.15 2017/06/30 02:51:14 kamil Exp $"); #endif @@ -23,13 +23,7 @@ static int initio_done; /* A shell error occurred (eg, syntax error, etc.) */ void -#ifdef HAVE_PROTOTYPES errorf(const char *fmt, ...) -#else -errorf(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list va; @@ -48,14 +42,7 @@ errorf(fmt, va_alist) /* like errorf(), but no unwind is done */ void -#ifdef HAVE_PROTOTYPES warningf(int fileline, const char *fmt, ...) -#else -warningf(fileline, fmt, va_alist) - int fileline; - const char *fmt; - va_dcl -#endif { va_list va; @@ -71,13 +58,7 @@ warningf(fileline, fmt, va_alist) * (also unwinds environments for special builtins). */ void -#ifdef HAVE_PROTOTYPES bi_errorf(const char *fmt, ...) -#else -bi_errorf(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list va; @@ -108,14 +89,7 @@ bi_errorf(fmt, va_alist) /* Called when something that shouldn't happen does */ void -#ifdef HAVE_PROTOTYPES internal_errorf(int jump, const char *fmt, ...) -#else -internal_errorf(jump, fmt, va_alist) - int jump; - const char *fmt; - va_dcl -#endif { va_list va; @@ -148,13 +122,7 @@ error_prefix(fileline) /* printf to shl_out (stderr) with flush */ void -#ifdef HAVE_PROTOTYPES shellf(const char *fmt, ...) -#else -shellf(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list va; @@ -168,13 +136,7 @@ shellf(fmt, va_alist) /* printf to shl_stdout (stdout) */ void -#ifdef HAVE_PROTOTYPES shprintf(const char *fmt, ...) -#else -shprintf(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list va; @@ -204,13 +166,7 @@ kshdebug_init_() /* print to debugging log */ void -# ifdef HAVE_PROTOTYPES kshdebug_printf_(const char *fmt, ...) -# else -kshdebug_printf_(fmt, va_alist) - const char *fmt; - va_dcl -# endif { va_list va; Index: src/bin/ksh/lex.c diff -u src/bin/ksh/lex.c:1.19 src/bin/ksh/lex.c:1.20 --- src/bin/ksh/lex.c:1.19 Fri Jun 23 00:18:01 2017 +++ src/bin/ksh/lex.c Fri Jun 30 02:51:14 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $ */ +/* $NetBSD: lex.c,v 1.20 2017/06/30 02:51:14 kamil Exp $ */ /* * lexical analysis and source input @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $"); +__RCSID("$NetBSD: lex.c,v 1.20 2017/06/30 02:51:14 kamil Exp $"); #endif @@ -836,13 +836,7 @@ readhere(iop) } void -#ifdef HAVE_PROTOTYPES yyerror(const char *fmt, ...) -#else -yyerror(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list va; Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.30 src/bin/ksh/sh.h:1.31 --- src/bin/ksh/sh.h:1.30 Fri Jun 30 02:38:10 2017 +++ src/bin/ksh/sh.h Fri Jun 30 02:51:14 2017 @@ -1,18 +1,14 @@ -/* $NetBSD: sh.h,v 1.30 2017/06/30 02:38:10 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.30 2017/06/30 02:38:10 kamil Exp $ */ +/* $Id: sh.h,v 1.31 2017/06/30 02:51:14 kamil Exp $ */ #include "config.h" /*
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 02:38:10 UTC 2017 Modified Files: src/bin/ksh: conf-end.h config.h exec.c jobs.c sh.h Log Message: ksh: Drop support for systems without functional waitpid(2) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/conf-end.h cvs rdiff -u -r1.44 -r1.45 src/bin/ksh/config.h cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/exec.c cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/jobs.c cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/conf-end.h diff -u src/bin/ksh/conf-end.h:1.6 src/bin/ksh/conf-end.h:1.7 --- src/bin/ksh/conf-end.h:1.6 Fri Jun 30 02:20:47 2017 +++ src/bin/ksh/conf-end.h Fri Jun 30 02:38:09 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $ */ +/* $NetBSD: conf-end.h,v 1.7 2017/06/30 02:38:09 kamil Exp $ */ /* * End of configuration stuff for PD ksh. * - * RCSid: $NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $ + * RCSid: $NetBSD: conf-end.h,v 1.7 2017/06/30 02:38:09 kamil Exp $ */ #if defined(EMACS) || defined(VI) @@ -22,15 +22,6 @@ # define EASY_HISTORY /* sjg's trivial history file */ #endif -/* Can we safely catch sigchld and wait for processes? */ -#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) -# define JOB_SIGS -#endif - -#if !defined(JOB_SIGS) || !(defined(POSIX_PGRP) || defined(BSD_PGRP)) -# undef JOBS /* if no JOB_SIGS, no job control support */ -#endif - #ifdef HAVE_GCC_FUNC_ATTR # define GCC_FUNC_ATTR(x) __attribute__((x)) # define GCC_FUNC_ATTR2(x,y) __attribute__((x,y)) Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.44 src/bin/ksh/config.h:1.45 --- src/bin/ksh/config.h:1.44 Fri Jun 30 02:20:47 2017 +++ src/bin/ksh/config.h Fri Jun 30 02:38:09 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.44 2017/06/30 02:20:47 kamil Exp $ */ +/* $NetBSD: config.h,v 1.45 2017/06/30 02:38:09 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -187,12 +187,6 @@ /* Define if you have the valloc function. */ #define HAVE_VALLOC 1 -/* Define if you have the wait3 function. */ -#define HAVE_WAIT3 1 - -/* Define if you have the waitpid function. */ -#define HAVE_WAITPID 1 - /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 Index: src/bin/ksh/exec.c diff -u src/bin/ksh/exec.c:1.20 src/bin/ksh/exec.c:1.21 --- src/bin/ksh/exec.c:1.20 Fri Jun 30 02:06:59 2017 +++ src/bin/ksh/exec.c Fri Jun 30 02:38:10 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $ */ +/* $NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $ */ /* * execute command tree @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $"); +__RCSID("$NetBSD: exec.c,v 1.21 2017/06/30 02:38:10 kamil Exp $"); #endif @@ -201,11 +201,8 @@ execute(t, flags) #ifdef KSH case TCOPROC: { -# ifdef JOB_SIGS sigset_t omask; -# endif /* JOB_SIGS */ -# ifdef JOB_SIGS /* Block sigchild as we are using things changed in the * signal handler */ @@ -218,7 +215,7 @@ execute(t, flags) unwind(i); /*NOTREACHED*/ } -# endif /* JOB_SIGS */ + /* Already have a (live) co-process? */ if (coproc.job && coproc.write >= 0) errorf("coprocess already exists"); @@ -249,10 +246,9 @@ execute(t, flags) /* create new coprocess id */ ++coproc.id; } -# ifdef JOB_SIGS + sigprocmask(SIG_SETMASK, , (sigset_t *) 0); e->type = E_EXEC; /* no more need for error handler */ -# endif /* JOB_SIGS */ /* exchild() closes coproc.* in child after fork, * will also increment coproc.njobs when the Index: src/bin/ksh/jobs.c diff -u src/bin/ksh/jobs.c:1.15 src/bin/ksh/jobs.c:1.16 --- src/bin/ksh/jobs.c:1.15 Fri Jun 30 01:52:34 2017 +++ src/bin/ksh/jobs.c Fri Jun 30 02:38:10 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $ */ +/* $NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $ */ /* * Process and job control @@ -14,11 +14,6 @@ * work :) * * Notes regarding the copious ifdefs: - * - JOB_SIGS is independent of JOBS - it is defined if there are modern - * signal and wait routines available. This is preferred, even when - * JOBS is not defined, since the shell will not otherwise notice when - * background jobs die until the shell waits for a foreground process - * to die. * - TTY_PGRP defined iff JOBS is defined - defined if there are tty * process groups * - NEED_PGRP_SYNC defined iff JOBS is defined - see comment below @@ -26,7 +21,7 @@ #include #ifndef lint -__RCSID("$NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.16 2017/06/30 02:38:10 kamil Exp $"); #endif #include @@ -187,10 +182,8 @@ static int_least32_t
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 02:20:47 UTC 2017 Modified Files: src/bin/ksh: conf-end.h config.h Log Message: ksh: Drop support for systems without POSIX signal routines To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/conf-end.h cvs rdiff -u -r1.43 -r1.44 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/conf-end.h diff -u src/bin/ksh/conf-end.h:1.5 src/bin/ksh/conf-end.h:1.6 --- src/bin/ksh/conf-end.h:1.5 Fri Jun 30 02:13:29 2017 +++ src/bin/ksh/conf-end.h Fri Jun 30 02:20:47 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $ */ +/* $NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $ */ /* * End of configuration stuff for PD ksh. * - * RCSid: $NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $ + * RCSid: $NetBSD: conf-end.h,v 1.6 2017/06/30 02:20:47 kamil Exp $ */ #if defined(EMACS) || defined(VI) @@ -23,8 +23,7 @@ #endif /* Can we safely catch sigchld and wait for processes? */ -#if (defined(HAVE_WAITPID) || defined(HAVE_WAIT3)) \ -&& (defined(POSIX_SIGNALS)) +#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3) # define JOB_SIGS #endif Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.43 src/bin/ksh/config.h:1.44 --- src/bin/ksh/config.h:1.43 Fri Jun 30 02:13:29 2017 +++ src/bin/ksh/config.h Fri Jun 30 02:20:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.43 2017/06/30 02:13:29 kamil Exp $ */ +/* $NetBSD: config.h,v 1.44 2017/06/30 02:20:47 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -39,9 +39,6 @@ /* Define as the return value of signal handlers (0 or ). */ #define RETSIGVAL -/* Define if you have posix signal routines (sigaction(), et. al.) */ -#define POSIX_SIGNALS 1 - /* Define to use the fake posix signal routines (sigact.[ch]) */ /* #undef USE_FAKE_SIGACT */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 02:13:29 UTC 2017 Modified Files: src/bin/ksh: conf-end.h config.h Log Message: ksh: Drop support for systems without implementation of EINTR These systems weren't handled anyway. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/conf-end.h cvs rdiff -u -r1.42 -r1.43 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/conf-end.h diff -u src/bin/ksh/conf-end.h:1.4 src/bin/ksh/conf-end.h:1.5 --- src/bin/ksh/conf-end.h:1.4 Thu Jun 22 23:59:28 2017 +++ src/bin/ksh/conf-end.h Fri Jun 30 02:13:29 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $ */ +/* $NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $ */ /* * End of configuration stuff for PD ksh. * - * RCSid: $NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $ + * RCSid: $NetBSD: conf-end.h,v 1.5 2017/06/30 02:13:29 kamil Exp $ */ #if defined(EMACS) || defined(VI) @@ -32,18 +32,6 @@ # undef JOBS /* if no JOB_SIGS, no job control support */ #endif -/* pdksh assumes system calls return EINTR if a signal happened (this so - * the signal handler doesn't have to longjmp()). I don't know if this - * happens (or can be made to happen) with sigset() et. al. (the bsd41 signal - * routines), so, the autoconf stuff checks what they do and defines - * SIGNALS_DONT_INTERRUPT if signals don't interrupt read(). - * If SIGNALS_DONT_INTERRUPT isn't defined and your compiler chokes on this, - * delete the hash in front of the error (and file a bug report). - */ -#ifdef SIGNALS_DONT_INTERRUPT - # error pdksh needs interruptable system calls. -#endif /* SIGNALS_DONT_INTERRUPT */ - #ifdef HAVE_GCC_FUNC_ATTR # define GCC_FUNC_ATTR(x) __attribute__((x)) # define GCC_FUNC_ATTR2(x,y) __attribute__((x,y)) Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.42 src/bin/ksh/config.h:1.43 --- src/bin/ksh/config.h:1.42 Fri Jun 30 02:06:59 2017 +++ src/bin/ksh/config.h Fri Jun 30 02:13:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.42 2017/06/30 02:06:59 kamil Exp $ */ +/* $NetBSD: config.h,v 1.43 2017/06/30 02:13:29 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -45,9 +45,6 @@ /* Define to use the fake posix signal routines (sigact.[ch]) */ /* #undef USE_FAKE_SIGACT */ -/* Define if signals don't interrupt read() */ -/* #undef SIGNALS_DONT_INTERRUPT */ - /* Define if you have bsd versions of the setpgrp() and getpgrp() routines */ /* #undef BSD_PGRP */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 02:06:59 UTC 2017 Modified Files: src/bin/ksh: config.h eval.c exec.c Log Message: ksh: Drop support for systems without handling shebang To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/bin/ksh/config.h cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/eval.c src/bin/ksh/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.41 src/bin/ksh/config.h:1.42 --- src/bin/ksh/config.h:1.41 Fri Jun 30 02:02:41 2017 +++ src/bin/ksh/config.h Fri Jun 30 02:06:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.41 2017/06/30 02:02:41 kamil Exp $ */ +/* $NetBSD: config.h,v 1.42 2017/06/30 02:06:59 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -36,9 +36,6 @@ /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 -/* Define if your kernel doesn't handle scripts starting with #! */ -/* #undef SHARPBANG */ - /* Define as the return value of signal handlers (0 or ). */ #define RETSIGVAL Index: src/bin/ksh/eval.c diff -u src/bin/ksh/eval.c:1.19 src/bin/ksh/eval.c:1.20 --- src/bin/ksh/eval.c:1.19 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/eval.c Fri Jun 30 02:06:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.19 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: eval.c,v 1.20 2017/06/30 02:06:59 kamil Exp $ */ /* * Expansion - quoting, separation, substitution, globbing @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: eval.c,v 1.19 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: eval.c,v 1.20 2017/06/30 02:06:59 kamil Exp $"); #endif #include @@ -95,17 +95,10 @@ eval(ap, f) return ap; XPinit(w, 32); XPput(w, NULL); /* space for shell name */ -#ifdef SHARPBANG - XPput(w, NULL); /* and space for one arg */ -#endif while (*ap != NULL) expand(*ap++, , f); XPput(w, NULL); -#ifdef SHARPBANG - return (char **) XPclose(w) + 2; -#else return (char **) XPclose(w) + 1; -#endif } /* Index: src/bin/ksh/exec.c diff -u src/bin/ksh/exec.c:1.19 src/bin/ksh/exec.c:1.20 --- src/bin/ksh/exec.c:1.19 Thu Jun 22 23:47:29 2017 +++ src/bin/ksh/exec.c Fri Jun 30 02:06:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.19 2017/06/22 23:47:29 kamil Exp $ */ +/* $NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $ */ /* * execute command tree @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: exec.c,v 1.19 2017/06/22 23:47:29 kamil Exp $"); +__RCSID("$NetBSD: exec.c,v 1.20 2017/06/30 02:06:59 kamil Exp $"); #endif @@ -764,53 +764,6 @@ scriptexec(tp, ap) shellv = __UNCONST(EXECSHELL); *tp->args-- = tp->str; -#ifdef SHARPBANG - { - char buf[LINE]; - register char *cp; - register int fd, n; - - buf[0] = '\0'; - if ((fd = open(tp->str, O_RDONLY)) >= 0) { - if ((n = read(fd, buf, LINE - 1)) > 0) -buf[n] = '\0'; - (void) close(fd); - } - if ((buf[0] == '#' && buf[1] == '!' && (cp = [2])) - ) - { - while (*cp && (*cp == ' ' || *cp == '\t')) -cp++; - if (*cp && *cp != '\n') { -char *a0 = cp, *a1 = (char *) 0; - -while (*cp && *cp != '\n' && *cp != ' ' - && *cp != '\t') -{ - cp++; -} -if (*cp && *cp != '\n') { - *cp++ = '\0'; - while (*cp - && (*cp == ' ' || *cp == '\t')) - cp++; - if (*cp && *cp != '\n') { - a1 = cp; - /* all one argument */ - while (*cp && *cp != '\n') - cp++; - } -} -if (*cp == '\n') { - *cp = '\0'; - if (a1) - *tp->args-- = a1; - shellv = a0; -} - } - } - } -#endif /* SHARPBANG */ *tp->args = shellv; execve(tp->args[0], tp->args, ap);
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 02:02:41 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Drop support for OSes without POSIX types Assume available: mode_t, off_t, pid_t, uid_t, rlim_t, sigset_t. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.40 src/bin/ksh/config.h:1.41 --- src/bin/ksh/config.h:1.40 Fri Jun 30 01:56:34 2017 +++ src/bin/ksh/config.h Fri Jun 30 02:02:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.40 2017/06/30 01:56:34 kamil Exp $ */ +/* $NetBSD: config.h,v 1.41 2017/06/30 02:02:41 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -17,15 +17,6 @@ /* Define if on MINIX. */ /* #undef _MINIX */ -/* Define to `int' if doesn't define. */ -/* #undef mode_t */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define to `int' if doesn't define. */ -/* #undef pid_t */ - /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ @@ -45,9 +36,6 @@ /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 -/* Define to `int' if doesn't define. */ -/* #undef uid_t */ - /* Define if your kernel doesn't handle scripts starting with #! */ /* #undef SHARPBANG */ @@ -81,15 +69,9 @@ /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */ #define HAVE_GCC_FUNC_ATTR 1 -/* Define to the type of struct rlimit fields if the rlim_t type is missing */ -/* #undef rlim_t */ - /* Define if time() is declared in */ #define TIME_DECLARED 1 -/* Define to `unsigned' if doesn't define */ -/* #undef sigset_t */ - /* Define if sys_errlist[] and sys_nerr are in the C library */ #define HAVE_SYS_ERRLIST 1
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 01:56:34 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Drop support for systems without To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.39 src/bin/ksh/config.h:1.40 --- src/bin/ksh/config.h:1.39 Fri Jun 30 01:36:30 2017 +++ src/bin/ksh/config.h Fri Jun 30 01:56:34 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.39 2017/06/30 01:36:30 kamil Exp $ */ +/* $NetBSD: config.h,v 1.40 2017/06/30 01:56:34 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -14,9 +14,6 @@ /* Define if your struct stat has st_rdev. */ #define HAVE_ST_RDEV 1 -/* Define if you have that is POSIX.1 compatible. */ -#define HAVE_SYS_WAIT_H 1 - /* Define if on MINIX. */ /* #undef _MINIX */ @@ -247,9 +244,6 @@ /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 -/* Define if you have the header file. */ -#define HAVE_SYS_WAIT_H 1 - /* Define if you have the header file. */ #define HAVE_ULIMIT_H
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 01:52:34 UTC 2017 Modified Files: src/bin/ksh: jobs.c Removed Files: src/bin/ksh: ksh_wait.h Log Message: ksh: Drop ksh_wait.h that reinvents (POSIX header) Switch jobs.c to . No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/jobs.c cvs rdiff -u -r1.2 -r0 src/bin/ksh/ksh_wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/jobs.c diff -u src/bin/ksh/jobs.c:1.14 src/bin/ksh/jobs.c:1.15 --- src/bin/ksh/jobs.c:1.14 Fri Jun 23 00:29:42 2017 +++ src/bin/ksh/jobs.c Fri Jun 30 01:52:34 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $ */ +/* $NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $ */ /* * Process and job control @@ -26,13 +26,13 @@ #include #ifndef lint -__RCSID("$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.15 2017/06/30 01:52:34 kamil Exp $"); #endif +#include #include "sh.h" #include "ksh_stat.h" -#include "ksh_wait.h" #include "ksh_times.h" #include "tty.h" @@ -103,7 +103,7 @@ typedef struct proc Proc; struct proc { Proc *next; /* next process in pipeline (if any) */ int state; - WAIT_T status; /* wait status */ + int status; /* wait status */ pid_t pid; /* process id */ char command[48]; /* process command string */ }; @@ -469,7 +469,7 @@ exchild(t, flags, close_fd) p = new_proc(); p->next = (Proc *) 0; p->state = PRUNNING; - WSTATUS(p->status) = 0; + p->status = 0; p->pid = 0; /* link process into jobs list */ @@ -891,7 +891,7 @@ j_resume(cp, bg) for (p = j->proc_list; p != (Proc *) 0; p = p->next) { if (p->state == PSTOPPED) { p->state = PRUNNING; - WSTATUS(p->status) = 0; + p->status = 0; running = 1; } shprintf("%s%s", p->command, p->next ? "| " : null); @@ -1212,7 +1212,7 @@ j_waitj(j, flags, where) j->flags &= ~(JF_WAITING|JF_W_ASYNCNOTIFY); if (j->flags & JF_FG) { - WAIT_T status; + int status; j->flags &= ~JF_FG; #ifdef TTY_PGRP @@ -1317,7 +1317,7 @@ j_sigchld(sig) Job *j; Proc UNINITIALIZED(*p); int pid; - WAIT_T status; + int status; struct tms t0, t1; #ifdef JOB_SIGS @@ -1336,7 +1336,7 @@ j_sigchld(sig) ksh_times(); do { #ifdef JOB_SIGS - pid = ksh_waitpid(-1, , (WNOHANG|WUNTRACED)); + pid = waitpid(-1, , (WNOHANG|WUNTRACED)); #else /* JOB_SIGS */ pid = wait(); #endif /* JOB_SIGS */ @@ -1513,7 +1513,7 @@ j_print(j, how, shf) { Proc *p; int state; - WAIT_T status; + int status; int coredumped; char jobchar = ' '; char buf[64]; @@ -1556,7 +1556,7 @@ j_print(j, how, shf) WEXITSTATUS(p->status)); break; case PSIGNALLED: - if (WIFCORED(p->status)) + if (WCOREDUMP(p->status)) coredumped = 1; /* kludge for not reporting `normal termination signals' * (ie, SIGINT, SIGPIPE) @@ -1597,8 +1597,7 @@ j_print(j, how, shf) state = p->state; status = p->status; p = p->next; - while (p && p->state == state - && WSTATUS(p->status) == WSTATUS(status)) + while (p && p->state == state && p->status == status) { if (how == JP_LONG) shf_fprintf(shf, "%s%5d %-20s %s%s", filler, p->pid,
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 30 01:36:30 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Drop support for systems without gid_t To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.38 src/bin/ksh/config.h:1.39 --- src/bin/ksh/config.h:1.38 Fri Jun 23 00:35:20 2017 +++ src/bin/ksh/config.h Fri Jun 30 01:36:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.38 2017/06/23 00:35:20 kamil Exp $ */ +/* $NetBSD: config.h,v 1.39 2017/06/30 01:36:30 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -11,9 +11,6 @@ #ifndef CONFIG_H #define CONFIG_H -/* Define to `int' if doesn't define. */ -/* #undef gid_t */ - /* Define if your struct stat has st_rdev. */ #define HAVE_ST_RDEV 1
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:35:20 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Drop support for systems without clock_t type To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.37 src/bin/ksh/config.h:1.38 --- src/bin/ksh/config.h:1.37 Fri Jun 23 00:29:42 2017 +++ src/bin/ksh/config.h Fri Jun 23 00:35:20 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.37 2017/06/23 00:29:42 kamil Exp $ */ +/* $NetBSD: config.h,v 1.38 2017/06/23 00:35:20 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -87,9 +87,6 @@ /* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */ #define HAVE_GCC_FUNC_ATTR 1 -/* Define to 32-bit signed integer type if doesn't define */ -/* #undef clock_t */ - /* Define to the type of struct rlimit fields if the rlim_t type is missing */ /* #undef rlim_t */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:29:42 UTC 2017 Modified Files: src/bin/ksh: config.h jobs.c sh.h Log Message: ksh: Replace homegrown int_least32_t with the C99 version To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/bin/ksh/config.h cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/jobs.c cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.36 src/bin/ksh/config.h:1.37 --- src/bin/ksh/config.h:1.36 Fri Jun 23 00:20:22 2017 +++ src/bin/ksh/config.h Fri Jun 23 00:29:42 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.36 2017/06/23 00:20:22 kamil Exp $ */ +/* $NetBSD: config.h,v 1.37 2017/06/23 00:29:42 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -172,12 +172,6 @@ /* Include game-of-life? */ /* #undef SILLY */ -/* The number of bytes in a int. */ -#define SIZEOF_INT 4 - -/* The number of bytes in a long. */ -#define SIZEOF_LONG 4 - /* Define if you have the _setjmp function. */ #define HAVE__SETJMP Index: src/bin/ksh/jobs.c diff -u src/bin/ksh/jobs.c:1.13 src/bin/ksh/jobs.c:1.14 --- src/bin/ksh/jobs.c:1.13 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/jobs.c Fri Jun 23 00:29:42 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: jobs.c,v 1.13 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $ */ /* * Process and job control @@ -26,7 +26,7 @@ #include #ifndef lint -__RCSID("$NetBSD: jobs.c,v 1.13 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $"); #endif @@ -142,7 +142,7 @@ struct job { int status; /* exit status of last process */ pid_t pgrp; /* process group of job */ pid_t ppid; /* pid of process that forked job */ - INT32 age; /* number of jobs started */ + int_least32_t age; /* number of jobs started */ clock_t systime; /* system time used by job */ clock_t usrtime; /* user time used by job */ Proc *proc_list; /* process list */ @@ -183,7 +183,7 @@ static Job *async_job; static pid_t async_pid; static int nzombie; /* # of zombies owned by this process */ -static INT32 njobs; /* # of jobs started */ +static int_least32_t njobs; /* # of jobs started */ static int child_max; /* CHILD_MAX */ Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.28 src/bin/ksh/sh.h:1.29 --- src/bin/ksh/sh.h:1.28 Fri Jun 23 00:18:01 2017 +++ src/bin/ksh/sh.h Fri Jun 23 00:29:42 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.29 2017/06/23 00:29:42 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */ +/* $Id: sh.h,v 1.29 2017/06/23 00:29:42 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -26,6 +26,7 @@ #include #include #include +#include #ifndef O_ACCMODE # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) @@ -118,20 +119,6 @@ typedef RETSIGTYPE (*handler_t) ARGS((in # define ksh_jmp_buf jmp_buf #endif /* HAVE_SIGSETJMP */ -/* Find a integer type that is at least 32 bits (or die) - SIZEOF_* defined - * by autoconf (assumes an 8 bit byte, but I'm not concerned). - * NOTE: INT32 may end up being more than 32 bits. - */ -#if SIZEOF_INT >= 4 -# define INT32 int -#else /* SIZEOF_INT */ -# if SIZEOF_LONG >= 4 -# define INT32 long -# else /* SIZEOF_LONG */ - #error cannot find 32 bit type... -# endif /* SIZEOF_LONG */ -#endif /* SIZEOF_INT */ - /* end of common headers */ /* Stop gcc and lint from complaining about possibly uninitialized variables */ @@ -187,7 +174,7 @@ typedef int bool_t; #define BIT(i) (1<<(i)) /* define bit in flag */ /* Table flag type - needs > 16 and < 32 bits */ -typedef INT32 Tflag; +typedef int_least32_t Tflag; #define NUFILE 32 /* Number of user-accessible files */ #define FDBASE 10 /* First file usable by Shell */ @@ -495,7 +482,7 @@ EXTERN Getopt user_opt; /* parsing stat #ifdef KSH /* This for co-processes */ -typedef INT32 Coproc_id; /* something that won't (realisticly) wrap */ +typedef int_least32_t Coproc_id; /* something that won't (realisticly) wrap */ struct coproc { int read; /* pipe from co-process's stdout */ int readw; /* other side of read (saved temporarily) */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:20:23 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Drop support for systems that return void for closedir(2) To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.35 src/bin/ksh/config.h:1.36 --- src/bin/ksh/config.h:1.35 Fri Jun 23 00:00:58 2017 +++ src/bin/ksh/config.h Fri Jun 23 00:20:22 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.35 2017/06/23 00:00:58 kamil Exp $ */ +/* $NetBSD: config.h,v 1.36 2017/06/23 00:20:22 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -54,9 +54,6 @@ /* Define to `int' if doesn't define. */ /* #undef uid_t */ -/* Define if the closedir function returns void instead of int. */ -/* #undef VOID_CLOSEDIR */ - /* Define if your kernel doesn't handle scripts starting with #! */ /* #undef SHARPBANG */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:18:01 UTC 2017 Modified Files: src/bin/ksh: io.c lex.c sh.h shf.c tree.c Log Message: ksh: Use ANSI C varargs, drop support for older version To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/io.c cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/lex.c cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/sh.h cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/shf.c cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/io.c diff -u src/bin/ksh/io.c:1.13 src/bin/ksh/io.c:1.14 --- src/bin/ksh/io.c:1.13 Thu Jun 22 19:41:07 2017 +++ src/bin/ksh/io.c Fri Jun 23 00:18:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $ */ +/* $NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $ */ /* * shell buffered IO and formatted output @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $"); +__RCSID("$NetBSD: io.c,v 1.14 2017/06/23 00:18:01 kamil Exp $"); #endif @@ -37,7 +37,7 @@ errorf(fmt, va_alist) exstat = 1; if (*fmt) { error_prefix(TRUE); - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); va_end(va); shf_putchar('\n', shl_out); @@ -60,7 +60,7 @@ warningf(fileline, fmt, va_alist) va_list va; error_prefix(fileline); - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); va_end(va); shf_putchar('\n', shl_out); @@ -88,7 +88,7 @@ bi_errorf(fmt, va_alist) /* not set when main() calls parse_args() */ if (builtin_argv0) shf_fprintf(shl_out, "%s: ", builtin_argv0); - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); va_end(va); shf_putchar('\n', shl_out); @@ -121,7 +121,7 @@ internal_errorf(jump, fmt, va_alist) error_prefix(TRUE); shf_fprintf(shl_out, "internal error: "); - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); va_end(va); shf_putchar('\n', shl_out); @@ -160,7 +160,7 @@ shellf(fmt, va_alist) if (!initio_done) /* shl_out may not be set up yet... */ return; - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); va_end(va); shf_flush(shl_out); @@ -180,7 +180,7 @@ shprintf(fmt, va_alist) if (!shl_stdout_ok) internal_errorf(1, "shl_stdout not valid"); - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_stdout, fmt, va); va_end(va); } @@ -216,7 +216,7 @@ kshdebug_printf_(fmt, va_alist) if (!kshdebug_shf) return; - SH_VA_START(va, fmt); + va_start(va, fmt); shf_fprintf(kshdebug_shf, "[%d] ", getpid()); shf_vfprintf(kshdebug_shf, fmt, va); va_end(va); Index: src/bin/ksh/lex.c diff -u src/bin/ksh/lex.c:1.18 src/bin/ksh/lex.c:1.19 --- src/bin/ksh/lex.c:1.18 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/lex.c Fri Jun 23 00:18:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.18 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $ */ /* * lexical analysis and source input @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: lex.c,v 1.18 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: lex.c,v 1.19 2017/06/23 00:18:01 kamil Exp $"); #endif @@ -852,7 +852,7 @@ yyerror(fmt, va_alist) source->str = null; /* zap pending input */ error_prefix(TRUE); - SH_VA_START(va, fmt); + va_start(va, fmt); shf_vfprintf(shl_out, fmt, va); va_end(va); errorf("%s", null); Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.27 src/bin/ksh/sh.h:1.28 --- src/bin/ksh/sh.h:1.27 Fri Jun 23 00:09:36 2017 +++ src/bin/ksh/sh.h Fri Jun 23 00:18:01 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */ +/* $Id: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -23,15 +23,7 @@ #include #include #include - -#ifdef HAVE_PROTOTYPES -# include -# define SH_VA_START(va, argn) va_start(va, argn) -#else -# include -# define SH_VA_START(va, argn) va_start(va) -#endif /* HAVE_PROTOTYPES */ - +#include #include #include Index: src/bin/ksh/shf.c diff -u src/bin/ksh/shf.c:1.10 src/bin/ksh/shf.c:1.11 --- src/bin/ksh/shf.c:1.10 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/shf.c Fri Jun 23 00:18:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: shf.c,v 1.10 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $ */ /* * Shell file I/O routines @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: shf.c,v 1.10 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: shf.c,v 1.11 2017/06/23 00:18:01 kamil Exp $"); #endif @@ -770,7 +770,7 @@ shf_fprintf(shf, fmt, va_alist)
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:11:01 UTC 2017 Modified Files: src/bin/ksh: tty.c Log Message: ksh: Remove remnant hack for SCO UNIX in tty code To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/tty.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/tty.c diff -u src/bin/ksh/tty.c:1.6 src/bin/ksh/tty.c:1.7 --- src/bin/ksh/tty.c:1.6 Fri Jun 23 00:09:36 2017 +++ src/bin/ksh/tty.c Fri Jun 23 00:11:01 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $ */ +/* $NetBSD: tty.c,v 1.7 2017/06/23 00:11:01 kamil Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $"); +__RCSID("$NetBSD: tty.c,v 1.7 2017/06/23 00:11:01 kamil Exp $"); #endif @@ -109,8 +109,6 @@ tty_init(init_ttystate) } tty_devtty = 1; - /* SCO can't job control on /dev/tty, so don't try... */ -#if !defined(__SCO__) if ((tfd = open(devtty, O_RDWR, 0)) < 0) { if (tfd < 0) { tty_devtty = 0; @@ -119,9 +117,6 @@ tty_init(init_ttystate) devtty, strerror(errno)); } } -#else /* !__SCO__ */ - tfd = -1; -#endif /* __SCO__ */ if (tfd < 0) { do_close = 0;
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:09:36 UTC 2017 Modified Files: src/bin/ksh: sh.h tty.c Log Message: ksh: Remove support for NeXT Operating System To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/sh.h cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/tty.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.26 src/bin/ksh/sh.h:1.27 --- src/bin/ksh/sh.h:1.26 Thu Jun 22 23:50:24 2017 +++ src/bin/ksh/sh.h Fri Jun 23 00:09:36 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.26 2017/06/22 23:50:24 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.26 2017/06/22 23:50:24 kamil Exp $ */ +/* $Id: sh.h,v 1.27 2017/06/23 00:09:36 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -553,11 +553,7 @@ EXTERN int x_cols I__(80); /* tty column /* Determine the location of the system (common) profile */ #ifndef KSH_SYSTEM_PROFILE -# ifdef __NeXT -# define KSH_SYSTEM_PROFILE "/etc/profile.std" -# else /* __NeXT */ -# define KSH_SYSTEM_PROFILE "/etc/profile" -# endif /* __NeXT */ +# define KSH_SYSTEM_PROFILE "/etc/profile" #endif /* KSH_SYSTEM_PROFILE */ /* Used by v_evaluate() and setstr() to control action when error occurs */ Index: src/bin/ksh/tty.c diff -u src/bin/ksh/tty.c:1.5 src/bin/ksh/tty.c:1.6 --- src/bin/ksh/tty.c:1.5 Fri Jun 23 00:04:20 2017 +++ src/bin/ksh/tty.c Fri Jun 23 00:09:36 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $ */ +/* $NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $"); +__RCSID("$NetBSD: tty.c,v 1.6 2017/06/23 00:09:36 kamil Exp $"); #endif @@ -112,22 +112,6 @@ tty_init(init_ttystate) /* SCO can't job control on /dev/tty, so don't try... */ #if !defined(__SCO__) if ((tfd = open(devtty, O_RDWR, 0)) < 0) { -#ifdef __NeXT - /* rlogin on NeXT boxes does not set up the controlling tty, - * so force it to be done here... - */ - { - extern char *ttyname ARGS((int)); - char *s = ttyname(isatty(2) ? 2 : 0); - int fd; - - if (s && (fd = open(s, O_RDWR, 0)) >= 0) { -close(fd); -tfd = open(devtty, O_RDWR, 0); - } - } -#endif /* __NeXT */ - if (tfd < 0) { tty_devtty = 0; warningf(FALSE,
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:07:15 UTC 2017 Modified Files: src/bin/ksh: sigact.c Log Message: ksh: Drop the latest ifdef for BSD4.1 and eliminate dead code around it To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/sigact.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/sigact.c diff -u src/bin/ksh/sigact.c:1.6 src/bin/ksh/sigact.c:1.7 --- src/bin/ksh/sigact.c:1.6 Thu Jun 22 23:59:28 2017 +++ src/bin/ksh/sigact.c Fri Jun 23 00:07:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $ */ +/* $NetBSD: sigact.c,v 1.7 2017/06/23 00:07:15 kamil Exp $ */ /* NAME: * sigact.c - fake sigaction(2) @@ -141,7 +141,7 @@ #include #ifndef lint -__RCSID("$NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $"); +__RCSID("$NetBSD: sigact.c,v 1.7 2017/06/23 00:07:15 kamil Exp $"); #endif @@ -169,28 +169,6 @@ __RCSID("$NetBSD: sigact.c,v 1.6 2017/06 #define USE_SIGMASK -/* - * if we haven't been told, - * try and guess what we should implement with. - */ -#if !defined(USE_SIGSET) && !defined(USE_SIGMASK) && !defined(USE_SIGNAL) -# if defined(sigmask) || defined(BSD) || defined(_BSD) && !defined(BSD41) -# define USE_SIGMASK -# else -# ifndef NO_SIGSET -# define USE_SIGSET -# else -# define USE_SIGNAL -# endif -# endif -#endif -/* - * if we still don't know, we're in trouble - */ -#if !defined(USE_SIGSET) && !defined(USE_SIGMASK) && !defined(USE_SIGNAL) -error must know what to implement with -#endif - #include "sigact.h" /*
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:04:20 UTC 2017 Modified Files: src/bin/ksh: tty.c Log Message: ksh: Drop BSD4.3 temporary hack in tty code To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/tty.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/tty.c diff -u src/bin/ksh/tty.c:1.4 src/bin/ksh/tty.c:1.5 --- src/bin/ksh/tty.c:1.4 Mon Jun 23 11:39:06 2003 +++ src/bin/ksh/tty.c Fri Jun 23 00:04:20 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: tty.c,v 1.4 2003/06/23 11:39:06 agc Exp $ */ +/* $NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: tty.c,v 1.4 2003/06/23 11:39:06 agc Exp $"); +__RCSID("$NetBSD: tty.c,v 1.5 2017/06/23 00:04:20 kamil Exp $"); #endif @@ -74,16 +74,6 @@ set_tty(fd, ts, flags) ret = -1; # endif # else /* HAVE_TERMIO_H */ -# if defined(__mips) && (defined(_SYSTYPE_BSD43) || defined(__SYSTYPE_BSD43)) - /* Under RISC/os 5.00, bsd43 environment, after a tty driver - * generated interrupt (eg, INTR, TSTP), all output to tty is - * lost until a SETP is done (there must be a better way of - * doing this...). - */ - if (flags & TF_MIPSKLUDGE) - ret = ioctl(fd, TIOCSETP, >sgttyb); - else -# endif /* _SYSTYPE_BSD43 */ ret = ioctl(fd, TIOCSETN, >sgttyb); # ifdef TIOCGATC if (ioctl(fd, TIOCSATC, >lchars) < 0) @@ -138,15 +128,12 @@ tty_init(init_ttystate) } #endif /* __NeXT */ -/* X11R5 xterm on mips doesn't set controlling tty properly - temporary hack */ -# if !defined(__mips) || !(defined(_SYSTYPE_BSD43) || defined(__SYSTYPE_BSD43)) if (tfd < 0) { tty_devtty = 0; warningf(FALSE, "No controlling tty (open %s: %s)", devtty, strerror(errno)); } -# endif /* __mips */ } #else /* !__SCO__ */ tfd = -1;
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Fri Jun 23 00:00:58 UTC 2017 Modified Files: src/bin/ksh: config.h trap.c Log Message: ksh: Drop support for UNIX V7-style signal routines To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/config.h cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.34 src/bin/ksh/config.h:1.35 --- src/bin/ksh/config.h:1.34 Thu Jun 22 23:59:28 2017 +++ src/bin/ksh/config.h Fri Jun 23 00:00:58 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.34 2017/06/22 23:59:28 kamil Exp $ */ +/* $NetBSD: config.h,v 1.35 2017/06/23 00:00:58 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -66,9 +66,6 @@ /* Define if you have posix signal routines (sigaction(), et. al.) */ #define POSIX_SIGNALS 1 -/* Define if you have v7 signal routines (signal(), signal reset on delivery) */ -/* #undef V7_SIGNALS */ - /* Define to use the fake posix signal routines (sigact.[ch]) */ /* #undef USE_FAKE_SIGACT */ Index: src/bin/ksh/trap.c diff -u src/bin/ksh/trap.c:1.11 src/bin/ksh/trap.c:1.12 --- src/bin/ksh/trap.c:1.11 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/trap.c Fri Jun 23 00:00:58 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.11 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: trap.c,v 1.12 2017/06/23 00:00:58 kamil Exp $ */ /* * signal handling @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: trap.c,v 1.11 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: trap.c,v 1.12 2017/06/23 00:00:58 kamil Exp $"); #endif #include "sh.h" @@ -141,10 +141,7 @@ trapsig(i) } if (p->shtrap) (*p->shtrap)(i); -#ifdef V7_SIGNALS - if (sigtraps[i].cursig == trapsig) /* this for SIGCHLD,SIGALRM */ - sigaction(i, _trap, (struct sigaction *) 0); -#endif /* V7_SIGNALS */ + errno = errno_; return RETSIGVAL; }
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:59:29 UTC 2017 Modified Files: src/bin/ksh: conf-end.h config.h sigact.c Log Message: ksh: Drop fallback for BSD4.2 signal routines To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/conf-end.h cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/config.h cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/sigact.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/conf-end.h diff -u src/bin/ksh/conf-end.h:1.3 src/bin/ksh/conf-end.h:1.4 --- src/bin/ksh/conf-end.h:1.3 Thu Jun 22 23:54:13 2017 +++ src/bin/ksh/conf-end.h Thu Jun 22 23:59:28 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: conf-end.h,v 1.3 2017/06/22 23:54:13 kamil Exp $ */ +/* $NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $ */ /* * End of configuration stuff for PD ksh. * - * RCSid: $NetBSD: conf-end.h,v 1.3 2017/06/22 23:54:13 kamil Exp $ + * RCSid: $NetBSD: conf-end.h,v 1.4 2017/06/22 23:59:28 kamil Exp $ */ #if defined(EMACS) || defined(VI) @@ -24,7 +24,7 @@ /* Can we safely catch sigchld and wait for processes? */ #if (defined(HAVE_WAITPID) || defined(HAVE_WAIT3)) \ -&& (defined(POSIX_SIGNALS) || defined(BSD42_SIGNALS)) +&& (defined(POSIX_SIGNALS)) # define JOB_SIGS #endif Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.33 src/bin/ksh/config.h:1.34 --- src/bin/ksh/config.h:1.33 Thu Jun 22 23:56:24 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:59:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.33 2017/06/22 23:56:24 kamil Exp $ */ +/* $NetBSD: config.h,v 1.34 2017/06/22 23:59:28 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -66,9 +66,6 @@ /* Define if you have posix signal routines (sigaction(), et. al.) */ #define POSIX_SIGNALS 1 -/* Define if you have BSD4.2 signal routines (sigsetmask(), et. al.) */ -/* #undef BSD42_SIGNALS */ - /* Define if you have v7 signal routines (signal(), signal reset on delivery) */ /* #undef V7_SIGNALS */ Index: src/bin/ksh/sigact.c diff -u src/bin/ksh/sigact.c:1.5 src/bin/ksh/sigact.c:1.6 --- src/bin/ksh/sigact.c:1.5 Thu Jun 22 23:56:24 2017 +++ src/bin/ksh/sigact.c Thu Jun 22 23:59:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sigact.c,v 1.5 2017/06/22 23:56:24 kamil Exp $ */ +/* $NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $ */ /* NAME: * sigact.c - fake sigaction(2) @@ -141,7 +141,7 @@ #include #ifndef lint -__RCSID("$NetBSD: sigact.c,v 1.5 2017/06/22 23:56:24 kamil Exp $"); +__RCSID("$NetBSD: sigact.c,v 1.6 2017/06/22 23:59:28 kamil Exp $"); #endif @@ -167,12 +167,7 @@ __RCSID("$NetBSD: sigact.c,v 1.5 2017/06 #ifdef USE_FAKE_SIGACT /* let autoconf decide.. */ /* #if !defined(SA_NOCLDSTOP) || defined(_SIGACT_H) || defined(USE_SIGNAL) || defined(USE_SIGSET) || defined(USE_SIGMASK) */ -/* Let autoconf decide which to use */ -#ifdef BSD42_SIGNALS -# define USE_SIGMASK -#else -# define USE_SIGNAL -#endif /* BSD42_SIGNALS */ +#define USE_SIGMASK /* * if we haven't been told,
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:56:24 UTC 2017 Modified Files: src/bin/ksh: config.h sigact.c Log Message: ksh: Remove fallback to BSD4.1 signal routines To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/config.h cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/sigact.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.32 src/bin/ksh/config.h:1.33 --- src/bin/ksh/config.h:1.32 Thu Jun 22 23:54:13 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:56:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.32 2017/06/22 23:54:13 kamil Exp $ */ +/* $NetBSD: config.h,v 1.33 2017/06/22 23:56:24 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -69,9 +69,6 @@ /* Define if you have BSD4.2 signal routines (sigsetmask(), et. al.) */ /* #undef BSD42_SIGNALS */ -/* Define if you have BSD4.1 signal routines (sigset(), et. al.) */ -/* #undef BSD41_SIGNALS */ - /* Define if you have v7 signal routines (signal(), signal reset on delivery) */ /* #undef V7_SIGNALS */ Index: src/bin/ksh/sigact.c diff -u src/bin/ksh/sigact.c:1.4 src/bin/ksh/sigact.c:1.5 --- src/bin/ksh/sigact.c:1.4 Mon Jun 23 11:39:03 2003 +++ src/bin/ksh/sigact.c Thu Jun 22 23:56:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sigact.c,v 1.4 2003/06/23 11:39:03 agc Exp $ */ +/* $NetBSD: sigact.c,v 1.5 2017/06/22 23:56:24 kamil Exp $ */ /* NAME: * sigact.c - fake sigaction(2) @@ -141,7 +141,7 @@ #include #ifndef lint -__RCSID("$NetBSD: sigact.c,v 1.4 2003/06/23 11:39:03 agc Exp $"); +__RCSID("$NetBSD: sigact.c,v 1.5 2017/06/22 23:56:24 kamil Exp $"); #endif @@ -171,11 +171,7 @@ __RCSID("$NetBSD: sigact.c,v 1.4 2003/06 #ifdef BSD42_SIGNALS # define USE_SIGMASK #else -# ifdef BSD41_SIGNALS -# define USE_SIGSET -# else -# define USE_SIGNAL -# endif +# define USE_SIGNAL #endif /* BSD42_SIGNALS */ /*
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:54:13 UTC 2017 Modified Files: src/bin/ksh: conf-end.h config.h Log Message: ksh: Drop support for systems without mmap(2) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/bin/ksh/conf-end.h cvs rdiff -u -r1.31 -r1.32 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/conf-end.h diff -u src/bin/ksh/conf-end.h:1.2 src/bin/ksh/conf-end.h:1.3 --- src/bin/ksh/conf-end.h:1.2 Sun Jan 12 19:11:43 1997 +++ src/bin/ksh/conf-end.h Thu Jun 22 23:54:13 2017 @@ -1,9 +1,9 @@ -/* $NetBSD: conf-end.h,v 1.2 1997/01/12 19:11:43 tls Exp $ */ +/* $NetBSD: conf-end.h,v 1.3 2017/06/22 23:54:13 kamil Exp $ */ /* * End of configuration stuff for PD ksh. * - * RCSid: $NetBSD: conf-end.h,v 1.2 1997/01/12 19:11:43 tls Exp $ + * RCSid: $NetBSD: conf-end.h,v 1.3 2017/06/22 23:54:13 kamil Exp $ */ #if defined(EMACS) || defined(VI) @@ -17,11 +17,7 @@ # define HISTORY #endif /* EDIT */ -/* - * if you don't have mmap() you can't use Peter Collinson's history - * mechanism. If that is the case, then define EASY_HISTORY - */ -#if defined(HISTORY) && (!defined(COMPLEX_HISTORY) || !defined(HAVE_MMAP) || !defined(HAVE_FLOCK)) +#if defined(HISTORY) && (!defined(COMPLEX_HISTORY) || !defined(HAVE_FLOCK)) # undef COMPLEX_HISTORY # define EASY_HISTORY /* sjg's trivial history file */ #endif Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.31 src/bin/ksh/config.h:1.32 --- src/bin/ksh/config.h:1.31 Thu Jun 22 23:50:24 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:54:13 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.31 2017/06/22 23:50:24 kamil Exp $ */ +/* $NetBSD: config.h,v 1.32 2017/06/22 23:54:13 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -14,9 +14,6 @@ /* Define to `int' if doesn't define. */ /* #undef gid_t */ -/* Define if you have a working `mmap' system call. */ -#define HAVE_MMAP 1 - /* Define if your struct stat has st_rdev. */ #define HAVE_ST_RDEV 1
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:50:25 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without dup2(2) To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/bin/ksh/config.h cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.30 src/bin/ksh/config.h:1.31 --- src/bin/ksh/config.h:1.30 Thu Jun 22 23:47:29 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:50:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.30 2017/06/22 23:47:29 kamil Exp $ */ +/* $NetBSD: config.h,v 1.31 2017/06/22 23:50:24 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -138,9 +138,6 @@ /* Define if opendir() will open non-directory files */ /* #undef OPENDIR_DOES_NONDIR */ -/* Define if you have a dup2() function in your C library */ -#define HAVE_DUP2 1 - /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */ /* #undef NEED_PGRP_SYNC */ Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.25 src/bin/ksh/sh.h:1.26 --- src/bin/ksh/sh.h:1.25 Thu Jun 22 23:47:29 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:50:24 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.25 2017/06/22 23:47:29 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.26 2017/06/22 23:50:24 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.25 2017/06/22 23:47:29 kamil Exp $ */ +/* $Id: sh.h,v 1.26 2017/06/22 23:50:24 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -126,10 +126,6 @@ typedef RETSIGTYPE (*handler_t) ARGS((in # define ksh_jmp_buf jmp_buf #endif /* HAVE_SIGSETJMP */ -#ifndef HAVE_DUP2 -extern int dup2 ARGS((int, int)); -#endif /* !HAVE_DUP2 */ - /* Find a integer type that is at least 32 bits (or die) - SIZEOF_* defined * by autoconf (assumes an 8 bit byte, but I'm not concerned). * NOTE: INT32 may end up being more than 32 bits.
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:47:29 UTC 2017 Modified Files: src/bin/ksh: config.h exec.c sh.h Log Message: ksh: Drop support for ISC UNIX To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/config.h cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/exec.c cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.29 src/bin/ksh/config.h:1.30 --- src/bin/ksh/config.h:1.29 Thu Jun 22 23:38:49 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:47:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.29 2017/06/22 23:38:49 kamil Exp $ */ +/* $NetBSD: config.h,v 1.30 2017/06/22 23:47:29 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -144,9 +144,6 @@ /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */ /* #undef NEED_PGRP_SYNC */ -/* Define if you arg running ISC unix */ -/* #undef OS_ISC */ - /* Define if you have a POSIX.1 compatible */ #define POSIX_SYS_WAIT 1 Index: src/bin/ksh/exec.c diff -u src/bin/ksh/exec.c:1.18 src/bin/ksh/exec.c:1.19 --- src/bin/ksh/exec.c:1.18 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/exec.c Thu Jun 22 23:47:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.18 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: exec.c,v 1.19 2017/06/22 23:47:29 kamil Exp $ */ /* * execute command tree @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: exec.c,v 1.18 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: exec.c,v 1.19 2017/06/22 23:47:29 kamil Exp $"); #endif @@ -420,7 +420,7 @@ execute(t, flags) #endif restoresigs(); cleanup_proc_env(); - ksh_execve(t->str, t->args, ap, flags); + execve(t->str, t->args, ap); if (errno == ENOEXEC) scriptexec(t, ap); else @@ -813,7 +813,7 @@ scriptexec(tp, ap) #endif /* SHARPBANG */ *tp->args = shellv; - ksh_execve(tp->args[0], tp->args, ap, 0); + execve(tp->args[0], tp->args, ap); /* report both the program that was run and the bogus shell */ errorf("%s: %s: %s", tp->str, shellv, strerror(errno)); Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.24 src/bin/ksh/sh.h:1.25 --- src/bin/ksh/sh.h:1.24 Thu Jun 22 23:42:35 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:47:29 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.24 2017/06/22 23:42:35 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.25 2017/06/22 23:47:29 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.24 2017/06/22 23:42:35 kamil Exp $ */ +/* $Id: sh.h,v 1.25 2017/06/22 23:47:29 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -108,19 +108,6 @@ typedef RETSIGTYPE (*handler_t) ARGS((in # define killpg(p, s) kill(-(p), (s)) #endif /* !HAVE_KILLPG */ -/* Special cases for execve(2) */ -# if defined(OS_ISC) && defined(_POSIX_SOURCE) -/* Kludge for ISC 3.2 (and other versions?) so programs will run correctly. */ -# define ksh_execve(p, av, ev, flags) \ -do { \ - __setostype(0); \ - execve(p, av, ev); \ - __setostype(1); \ -} while (0) -# else /* OS_ISC && _POSIX */ -# define ksh_execve(p, av, ev, flags) execve(p, av, ev) -# endif /* OS_ISC && _POSIX */ - /* this is a hang-over from older versions of the os2 port */ #define ksh_dupbase(fd, base) fcntl(fd, F_DUPFD, base)
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:42:35 UTC 2017 Modified Files: src/bin/ksh: sh.h Log Message: ksh: Drop support for systems without offsetof(3) To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.23 src/bin/ksh/sh.h:1.24 --- src/bin/ksh/sh.h:1.23 Thu Jun 22 23:38:49 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:42:35 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.23 2017/06/22 23:38:49 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.24 2017/06/22 23:42:35 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.23 2017/06/22 23:38:49 kamil Exp $ */ +/* $Id: sh.h,v 1.24 2017/06/22 23:42:35 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -104,10 +104,6 @@ typedef RETSIGTYPE (*handler_t) ARGS((in # define DEFAULT__PATH DEFAULT_PATH #endif /* _PATH_DEFPATH */ -#ifndef offsetof -# define offsetof(type,id) ((size_t)&((type*)NULL)->id) -#endif - #ifndef HAVE_KILLPG # define killpg(p, s) kill(-(p), (s)) #endif /* !HAVE_KILLPG */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:38:49 UTC 2017 Modified Files: src/bin/ksh: config.h misc.c sh.h Log Message: ksh: Drop support for systems without To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/config.h cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/misc.c cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.28 src/bin/ksh/config.h:1.29 --- src/bin/ksh/config.h:1.28 Thu Jun 22 23:37:00 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:38:49 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.28 2017/06/22 23:37:00 kamil Exp $ */ +/* $NetBSD: config.h,v 1.29 2017/06/22 23:38:49 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -259,9 +259,6 @@ /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ Index: src/bin/ksh/misc.c diff -u src/bin/ksh/misc.c:1.21 src/bin/ksh/misc.c:1.22 --- src/bin/ksh/misc.c:1.21 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/misc.c Thu Jun 22 23:38:49 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.21 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: misc.c,v 1.22 2017/06/22 23:38:49 kamil Exp $ */ /* * Miscellaneous functions @@ -6,15 +6,13 @@ #include #ifndef lint -__RCSID("$NetBSD: misc.c,v 1.21 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: misc.c,v 1.22 2017/06/22 23:38:49 kamil Exp $"); #endif #include "sh.h" #include /* for FILECHCONV */ -#ifdef HAVE_LIMITS_H -# include -#endif +#include #ifndef UCHAR_MAX # define UCHAR_MAX 0xFF Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.22 src/bin/ksh/sh.h:1.23 --- src/bin/ksh/sh.h:1.22 Thu Jun 22 23:37:00 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:38:49 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.22 2017/06/22 23:37:00 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.23 2017/06/22 23:38:49 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.22 2017/06/22 23:37:00 kamil Exp $ */ +/* $Id: sh.h,v 1.23 2017/06/22 23:38:49 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -61,9 +61,7 @@ /* Some machines (eg, FreeBSD 1.1.5) define CLK_TCK in limits.h * (ksh_limval.h assumes limits has been included, if available) */ -#ifdef HAVE_LIMITS_H -# include -#endif /* HAVE_LIMITS_H */ +#include #include #ifdef NSIG
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:37:00 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/config.h cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.27 src/bin/ksh/config.h:1.28 --- src/bin/ksh/config.h:1.27 Thu Jun 22 23:33:36 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:37:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.27 2017/06/22 23:33:36 kamil Exp $ */ +/* $NetBSD: config.h,v 1.28 2017/06/22 23:37:00 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -259,9 +259,6 @@ /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.21 src/bin/ksh/sh.h:1.22 --- src/bin/ksh/sh.h:1.21 Thu Jun 22 23:33:36 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:37:00 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.21 2017/06/22 23:33:36 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.22 2017/06/22 23:37:00 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.21 2017/06/22 23:33:36 kamil Exp $ */ +/* $Id: sh.h,v 1.22 2017/06/22 23:37:00 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -33,12 +33,8 @@ #endif /* HAVE_PROTOTYPES */ #include +#include -#ifdef HAVE_FCNTL_H -# include -#else -# include -#endif /* HAVE_FCNTL_H */ #ifndef O_ACCMODE # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #endif /* !O_ACCMODE */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:33:36 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without memmove(3) and stop using bcopy(3) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/config.h cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.26 src/bin/ksh/config.h:1.27 --- src/bin/ksh/config.h:1.26 Thu Jun 22 23:30:42 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:33:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.26 2017/06/22 23:30:42 kamil Exp $ */ +/* $NetBSD: config.h,v 1.27 2017/06/22 23:33:36 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -126,12 +126,6 @@ /* Define if you have a sane header file */ #define HAVE_TERMIOS_H 1 -/* Define if you have a memmove() function in your C library */ -#define HAVE_MEMMOVE 1 - -/* Define if you have a bcopy() function in your C library */ -#define HAVE_BCOPY - /* Define if you have a lstat() function in your C library */ #define HAVE_LSTAT 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.20 src/bin/ksh/sh.h:1.21 --- src/bin/ksh/sh.h:1.20 Thu Jun 22 23:30:42 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:33:36 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.20 2017/06/22 23:30:42 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.21 2017/06/22 23:33:36 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.20 2017/06/22 23:30:42 kamil Exp $ */ +/* $Id: sh.h,v 1.21 2017/06/22 23:33:36 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -24,14 +24,6 @@ #include #include -#ifndef HAVE_MEMMOVE -# ifdef HAVE_BCOPY -# define memmove(d, s, n) bcopy(s, d, n) -# else -void *memmove ARGS((void *d, const void *s, size_t n)); -# endif -#endif /* HAVE_MEMMOVE */ - #ifdef HAVE_PROTOTYPES # include # define SH_VA_START(va, argn) va_start(va, argn)
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:30:42 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without memset(3) To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/config.h cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.25 src/bin/ksh/config.h:1.26 --- src/bin/ksh/config.h:1.25 Thu Jun 22 23:29:35 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:30:42 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.25 2017/06/22 23:29:35 kamil Exp $ */ +/* $NetBSD: config.h,v 1.26 2017/06/22 23:30:42 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -126,9 +126,6 @@ /* Define if you have a sane header file */ #define HAVE_TERMIOS_H 1 -/* Define if you have a memset() function in your C library */ -#define HAVE_MEMSET 1 - /* Define if you have a memmove() function in your C library */ #define HAVE_MEMMOVE 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.19 src/bin/ksh/sh.h:1.20 --- src/bin/ksh/sh.h:1.19 Thu Jun 22 23:29:35 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:30:42 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.19 2017/06/22 23:29:35 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.20 2017/06/22 23:30:42 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.19 2017/06/22 23:29:35 kamil Exp $ */ +/* $Id: sh.h,v 1.20 2017/06/22 23:30:42 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -24,11 +24,6 @@ #include #include -#ifndef HAVE_MEMSET -# define memcpy(d, s, n) bcopy(s, d, n) -# define memcmp(s1, s2, n) bcmp(s1, s2, n) -void *memset ARGS((void *d, int c, size_t n)); -#endif /* HAVE_MEMSET */ #ifndef HAVE_MEMMOVE # ifdef HAVE_BCOPY # define memmove(d, s, n) bcopy(s, d, n)
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:29:35 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop usage of SVID header , it's legacy standard To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/config.h cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.24 src/bin/ksh/config.h:1.25 --- src/bin/ksh/config.h:1.24 Thu Jun 22 23:27:53 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:29:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.24 2017/06/22 23:27:53 kamil Exp $ */ +/* $NetBSD: config.h,v 1.25 2017/06/22 23:29:35 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -274,9 +274,6 @@ /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.18 src/bin/ksh/sh.h:1.19 --- src/bin/ksh/sh.h:1.18 Thu Jun 22 23:27:53 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:29:35 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.18 2017/06/22 23:27:53 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.19 2017/06/22 23:29:35 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.18 2017/06/22 23:27:53 kamil Exp $ */ +/* $Id: sh.h,v 1.19 2017/06/22 23:29:35 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -24,9 +24,6 @@ #include #include -#ifdef HAVE_MEMORY_H -# include -#endif #ifndef HAVE_MEMSET # define memcpy(d, s, n) bcopy(s, d, n) # define memcmp(s1, s2, n) bcmp(s1, s2, n)
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:27:53 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without strcasecmp(3) and strncasecmp(3) To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/config.h cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.23 src/bin/ksh/config.h:1.24 --- src/bin/ksh/config.h:1.23 Thu Jun 22 23:26:17 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:27:53 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.23 2017/06/22 23:26:17 kamil Exp $ */ +/* $NetBSD: config.h,v 1.24 2017/06/22 23:27:53 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -244,9 +244,6 @@ /* Define if you have the sigsetjmp function. */ #define HAVE_SIGSETJMP 1 -/* Define if you have the strcasecmp function. */ -#define HAVE_STRCASECMP 1 - /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.17 src/bin/ksh/sh.h:1.18 --- src/bin/ksh/sh.h:1.17 Thu Jun 22 23:26:17 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:27:53 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.17 2017/06/22 23:26:17 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.18 2017/06/22 23:27:53 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.17 2017/06/22 23:26:17 kamil Exp $ */ +/* $Id: sh.h,v 1.18 2017/06/22 23:27:53 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -24,11 +24,6 @@ #include #include -#ifndef HAVE_STRCASECMP -int strcasecmp ARGS((const char *s1, const char *s2)); -int strncasecmp ARGS((const char *s1, const char *s2, int n)); -#endif /* HAVE_STRCASECMP */ - #ifdef HAVE_MEMORY_H # include #endif
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:26:17 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without strstr(3) To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/config.h cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.22 src/bin/ksh/config.h:1.23 --- src/bin/ksh/config.h:1.22 Thu Jun 22 23:23:27 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:26:17 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.22 2017/06/22 23:23:27 kamil Exp $ */ +/* $NetBSD: config.h,v 1.23 2017/06/22 23:26:17 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -250,9 +250,6 @@ /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - /* Define if you have the sysconf function. */ #define HAVE_SYSCONF 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.16 src/bin/ksh/sh.h:1.17 --- src/bin/ksh/sh.h:1.16 Thu Jun 22 23:23:27 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:26:17 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.16 2017/06/22 23:23:27 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.17 2017/06/22 23:26:17 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.16 2017/06/22 23:23:27 kamil Exp $ */ +/* $Id: sh.h,v 1.17 2017/06/22 23:26:17 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -24,9 +24,6 @@ #include #include -#ifndef HAVE_STRSTR -char *strstr ARGS((const char *s, const char *p)); -#endif /* HAVE_STRSTR */ #ifndef HAVE_STRCASECMP int strcasecmp ARGS((const char *s1, const char *s2)); int strncasecmp ARGS((const char *s1, const char *s2, int n));
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:23:27 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/config.h cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.21 src/bin/ksh/config.h:1.22 --- src/bin/ksh/config.h:1.21 Thu Jun 22 23:19:53 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:23:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.21 2017/06/22 23:19:53 kamil Exp $ */ +/* $NetBSD: config.h,v 1.22 2017/06/22 23:23:27 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -289,9 +289,6 @@ /* Define if you have the header file. */ #define HAVE_PATHS_H 1 -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - /* Define if you have the header file. */ #define HAVE_SYS_DIR_H Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.15 src/bin/ksh/sh.h:1.16 --- src/bin/ksh/sh.h:1.15 Thu Jun 22 23:19:53 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:23:27 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.15 2017/06/22 23:19:53 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.16 2017/06/22 23:23:27 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.15 2017/06/22 23:19:53 kamil Exp $ */ +/* $Id: sh.h,v 1.16 2017/06/22 23:23:27 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -22,14 +22,8 @@ #include #include #include +#include -#ifdef HAVE_STRING_H -# include -#else -# include -# define strchr index -# define strrchr rindex -#endif /* HAVE_STRING_H */ #ifndef HAVE_STRSTR char *strstr ARGS((const char *s, const char *p)); #endif /* HAVE_STRSTR */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:19:53 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without No functional change. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/config.h cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.20 src/bin/ksh/config.h:1.21 --- src/bin/ksh/config.h:1.20 Thu Jun 22 23:17:50 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:19:53 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.20 2017/06/22 23:17:50 kamil Exp $ */ +/* $NetBSD: config.h,v 1.21 2017/06/22 23:19:53 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -289,9 +289,6 @@ /* Define if you have the header file. */ #define HAVE_PATHS_H 1 -/* Define if you have the header file. */ -#define HAVE_STDDEF_H 1 - /* Define if you have the header file. */ #define HAVE_STRING_H 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.14 src/bin/ksh/sh.h:1.15 --- src/bin/ksh/sh.h:1.14 Thu Jun 22 23:17:50 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:19:53 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.14 2017/06/22 23:17:50 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.15 2017/06/22 23:19:53 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.14 2017/06/22 23:17:50 kamil Exp $ */ +/* $Id: sh.h,v 1.15 2017/06/22 23:19:53 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -19,10 +19,7 @@ #include #include #include -#ifdef HAVE_STDDEF_H -# include -#endif - +#include #include #include
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:17:50 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without No functional change. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/config.h cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.19 src/bin/ksh/config.h:1.20 --- src/bin/ksh/config.h:1.19 Thu Jun 22 23:15:05 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:17:50 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.19 2017/06/22 23:15:05 kamil Exp $ */ +/* $NetBSD: config.h,v 1.20 2017/06/22 23:17:50 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -292,9 +292,6 @@ /* Define if you have the header file. */ #define HAVE_STDDEF_H 1 -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - /* Define if you have the header file. */ #define HAVE_STRING_H 1 Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.13 src/bin/ksh/sh.h:1.14 --- src/bin/ksh/sh.h:1.13 Thu Jun 22 23:15:05 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:17:50 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.13 2017/06/22 23:15:05 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.14 2017/06/22 23:17:50 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.13 2017/06/22 23:15:05 kamil Exp $ */ +/* $Id: sh.h,v 1.14 2017/06/22 23:17:50 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -23,20 +23,7 @@ # include #endif -#ifdef HAVE_STDLIB_H -# include -#else -/* just a useful subset of what stdlib.h would have */ -extern char * getenv ARGS((const char *)); -extern void * malloc ARGS((size_t)); -extern void * realloc ARGS((void *, size_t)); -extern intfreeARGS((void *)); -extern intexitARGS((int)); -extern intrandARGS((void)); -extern void srand ARGS((unsigned int)); -extern intatoiARGS((const char *)); -#endif /* HAVE_STDLIB_H */ - +#include #include #ifdef HAVE_STRING_H
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:15:05 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h Log Message: ksh: Drop support for systems without This code wouldn't work for them anyway. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/config.h cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.18 src/bin/ksh/config.h:1.19 --- src/bin/ksh/config.h:1.18 Thu Jun 22 23:11:48 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:15:05 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.18 2017/06/22 23:11:48 kamil Exp $ */ +/* $NetBSD: config.h,v 1.19 2017/06/22 23:15:05 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -23,9 +23,6 @@ /* Define if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 -/* Define if you have . */ -#define HAVE_UNISTD_H 1 - /* Define if on MINIX. */ /* #undef _MINIX */ Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.12 src/bin/ksh/sh.h:1.13 --- src/bin/ksh/sh.h:1.12 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/sh.h Thu Jun 22 23:15:05 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.12 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.13 2017/06/22 23:15:05 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.12 2017/06/22 14:20:46 kamil Exp $ */ +/* $Id: sh.h,v 1.13 2017/06/22 23:15:05 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -37,45 +37,7 @@ extern void srand ARGS((unsigned int extern intatoiARGS((const char *)); #endif /* HAVE_STDLIB_H */ -#ifdef HAVE_UNISTD_H -# include -#else -/* just a useful subset of what unistd.h would have */ -extern int access ARGS((const char *, int)); -extern int open ARGS((const char *, int, ...)); -extern int creat ARGS((const char *, mode_t)); -extern int read ARGS((int, char *, unsigned)); -extern int write ARGS((int, const char *, unsigned)); -extern off_t lseek ARGS((int, off_t, int)); -extern int close ARGS((int)); -extern int pipe ARGS((int [])); -extern int dup2 ARGS((int, int)); -extern int unlink ARGS((const char *)); -extern int fork ARGS((void)); -extern int execve ARGS((const char *, char * const[], char * const[])); -extern int chdir ARGS((const char *)); -extern int kill ARGS((pid_t, int)); -extern char *getcwd(); /* no ARGS here - differs on different machines */ -extern int geteuid ARGS((void)); -extern int readlink ARGS((const char *, char *, int)); -extern int getegid ARGS((void)); -extern int getpid ARGS((void)); -extern int getppid ARGS((void)); -extern unsigned int sleep ARGS((unsigned int)); -extern int isatty ARGS((int)); -# ifdef POSIX_PGRP -extern int getpgrp ARGS((void)); -extern int setpgid ARGS((pid_t, pid_t)); -# endif /* POSIX_PGRP */ -# ifdef BSD_PGRP -extern int getpgrp ARGS((pid_t)); -extern int setpgrp ARGS((pid_t, pid_t)); -# endif /* BSD_PGRP */ -# ifdef SYSV_PGRP -extern int getpgrp ARGS((void)); -extern int setpgrp ARGS((void)); -# endif /* SYSV_PGRP */ -#endif /* HAVE_UNISTD_H */ +#include #ifdef HAVE_STRING_H # include
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:11:48 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Kill switch for CLOSEDIR_VOID (closedir(2) returns void) No users in the code. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.17 src/bin/ksh/config.h:1.18 --- src/bin/ksh/config.h:1.17 Thu Jun 22 23:09:32 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:11:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.17 2017/06/22 23:09:32 kamil Exp $ */ +/* $NetBSD: config.h,v 1.18 2017/06/22 23:11:48 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -11,9 +11,6 @@ #ifndef CONFIG_H #define CONFIG_H -/* Define if the closedir function returns void instead of int. */ -/* #undef CLOSEDIR_VOID */ - /* Define to `int' if doesn't define. */ /* #undef gid_t */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 23:09:32 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: ksh: Assume that $CC handles const (ANSI C89) No functional change. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.16 src/bin/ksh/config.h:1.17 --- src/bin/ksh/config.h:1.16 Thu Jun 22 19:46:54 2017 +++ src/bin/ksh/config.h Thu Jun 22 23:09:32 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.16 2017/06/22 19:46:54 kamil Exp $ */ +/* $NetBSD: config.h,v 1.17 2017/06/22 23:09:32 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -14,9 +14,6 @@ /* Define if the closedir function returns void instead of int. */ /* #undef CLOSEDIR_VOID */ -/* Define to empty if the keyword does not work. */ -/* #undef const */ - /* Define to `int' if doesn't define. */ /* #undef gid_t */
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 19:46:54 UTC 2017 Modified Files: src/bin/ksh: config.h Log Message: Drop support for $CC incapable to use void* / volatile* (pre ANSI C89) To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/config.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.15 src/bin/ksh/config.h:1.16 --- src/bin/ksh/config.h:1.15 Thu Jun 22 19:41:07 2017 +++ src/bin/ksh/config.h Thu Jun 22 19:46:54 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.15 2017/06/22 19:41:07 kamil Exp $ */ +/* $NetBSD: config.h,v 1.16 2017/06/22 19:46:54 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -105,12 +105,6 @@ /* Define if you don't have setpgrp(), setpgid() or getpgrp() routines */ /* #undef NO_PGRP */ -/* Define to char if your compiler doesn't like the void keyword */ -/* #undef void */ - -/* Define to nothing if compiler doesn't like the volatile keyword */ -/* #undef volatile */ - /* Define if C compiler groks function prototypes */ #define HAVE_PROTOTYPES 1
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 19:41:07 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c config.h io.c Log Message: Drop Ultrix support from ksh(1), a DEC UNIX for VAX To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/config.h cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.23 src/bin/ksh/c_ksh.c:1.24 --- src/bin/ksh/c_ksh.c:1.23 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/c_ksh.c Thu Jun 22 19:41:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.23 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.24 2017/06/22 19:41:07 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.23 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.24 2017/06/22 19:41:07 kamil Exp $"); #endif #include "sh.h" @@ -325,7 +325,7 @@ c_print(wp) switch ((c = *s++)) { /* Oddly enough, \007 seems more portable than - * \a (due to Ultrix cc, old pcc's, + * \a (due to old pcc's, * etc.). */ case 'a': c = '\007'; break; Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.14 src/bin/ksh/config.h:1.15 --- src/bin/ksh/config.h:1.14 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/config.h Thu Jun 22 19:41:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.14 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: config.h,v 1.15 2017/06/22 19:41:07 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -72,9 +72,6 @@ /* Define if your kernel doesn't handle scripts starting with #! */ /* #undef SHARPBANG */ -/* Define if dup2() preserves the close-on-exec flag (ultrix does this) */ -/* #undef DUP2_BROKEN */ - /* Define as the return value of signal handlers (0 or ). */ #define RETSIGVAL Index: src/bin/ksh/io.c diff -u src/bin/ksh/io.c:1.12 src/bin/ksh/io.c:1.13 --- src/bin/ksh/io.c:1.12 Thu Jun 22 14:20:46 2017 +++ src/bin/ksh/io.c Thu Jun 22 19:41:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.12 2017/06/22 14:20:46 kamil Exp $ */ +/* $NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $ */ /* * shell buffered IO and formatted output @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: io.c,v 1.12 2017/06/22 14:20:46 kamil Exp $"); +__RCSID("$NetBSD: io.c,v 1.13 2017/06/22 19:41:07 kamil Exp $"); #endif @@ -283,12 +283,6 @@ ksh_dup2(ofd, nfd, errok) if (ret < 0 && errno != EBADF && !errok) errorf("too many files open in shell"); -#ifdef DUP2_BROKEN - /* Ultrix systems like to preserve the close-on-exec flag */ - if (ret >= 0) - (void) fcntl(nfd, F_SETFD, 0); -#endif /* DUP2_BROKEN */ - return ret; }
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 14:20:46 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c c_sh.c c_ulimit.c config.h edit.c emacs.c eval.c exec.c history.c io.c jobs.c lex.c main.c misc.c path.c sh.h shf.c trap.c tree.h vi.c Log Message: Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix Added missing #endif terminator in emacs.c To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/c_sh.c src/bin/ksh/eval.c cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/c_ulimit.c src/bin/ksh/history.c cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/config.h cvs rdiff -u -r1.29 -r1.30 src/bin/ksh/edit.c cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/emacs.c cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/exec.c src/bin/ksh/lex.c \ src/bin/ksh/main.c cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/io.c src/bin/ksh/path.c \ src/bin/ksh/sh.h cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/jobs.c cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/misc.c cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/shf.c cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/trap.c cvs rdiff -u -r1.6 -r1.7 src/bin/ksh/tree.h cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.22 src/bin/ksh/c_ksh.c:1.23 --- src/bin/ksh/c_ksh.c:1.22 Thu Jun 22 14:11:27 2017 +++ src/bin/ksh/c_ksh.c Thu Jun 22 14:20:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.22 2017/06/22 14:11:27 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.23 2017/06/22 14:20:46 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,17 +6,13 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.22 2017/06/22 14:11:27 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.23 2017/06/22 14:20:46 kamil Exp $"); #endif #include "sh.h" #include "ksh_stat.h" #include -#ifdef __CYGWIN__ -#include -#endif /* __CYGWIN__ */ - int c_cd(wp) char **wp; @@ -145,15 +141,7 @@ c_cd(wp) setstr(oldpwd_s, current_wd, KSH_RETURN_ERROR); if (!ISABSPATH(Xstring(xs, xp))) { -#ifdef OS2 - /* simplify_path() doesn't know about os/2's drive contexts, - * so it can't set current_wd when changing to a:foo. - * Handle this by calling getcwd()... - */ - pwd = ksh_get_wd((char *) 0, 0); -#else /* OS2 */ pwd = (char *) 0; -#endif /* OS2 */ } else #ifdef S_ISLNK if (!physical || !(pwd = get_phys_path(Xstring(xs, xp @@ -162,12 +150,7 @@ c_cd(wp) /* Set PWD */ if (pwd) { -#ifdef __CYGWIN__ - char ptmp[PATH]; /* larger than MAX_PATH */ - cygwin_conv_to_full_posix_path(pwd, ptmp); -#else /* __CYGWIN__ */ char *ptmp = pwd; -#endif /* __CYGWIN__ */ set_current_wd(ptmp); /* Ignore failure (happens if readonly or integer) */ setstr(pwd_s, ptmp, KSH_RETURN_ERROR); @@ -241,7 +224,6 @@ c_print(wp) #define PO_PMINUSMINUS BIT(2) /* print a -- argument */ #define PO_HIST BIT(3) /* print to history instead of stdout */ #define PO_COPROC BIT(4) /* printing to coprocess: block SIGPIPE */ -#define PO_FSLASH BIT(5) /* swap slash for backslash (for os2 ) */ int fd = 1; int flags = PO_EXPAND|PO_NL; char *s; @@ -282,11 +264,7 @@ c_print(wp) } } else { int optc; -#if OS2 - const char *options = "Rnpfrsu,"; /* added f flag */ -#else const char *options = "Rnprsu,"; -#endif while ((optc = ksh_getopt(wp, _opt, options)) != EOF) switch (optc) { case 'R': /* fake BSD echo command */ @@ -297,11 +275,6 @@ c_print(wp) case 'e': flags |= PO_EXPAND; break; -#ifdef OS2 - case 'f': -flags |= PO_FSLASH; -break; -#endif case 'n': flags &= ~PO_NL; break; @@ -347,19 +320,12 @@ c_print(wp) s = *wp; while ((c = *s++) != '\0') { Xcheck(xs, xp); -#ifdef OS2 - if ((flags & PO_FSLASH) && c == '\\') -if (*s == '\\') - *s++; -else - c = '/'; -#endif /* OS2 */ if ((flags & PO_EXPAND) && c == '\\') { int i; switch ((c = *s++)) { /* Oddly enough, \007 seems more portable than - * \a (due to HP-UX cc, Ultrix cc, old pcc's, + * \a (due to Ultrix cc, old pcc's, * etc.). */ case 'a': c = '\007'; break; Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.18 src/bin/ksh/c_sh.c:1.19 --- src/bin/ksh/c_sh.c:1.18 Thu Jun 22 14:11:27 2017 +++ src/bin/ksh/c_sh.c Thu Jun 22 14:20:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.18 2017/06/22 14:11:27 kamil Exp $ */ +/* $NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $ */ /* * built-in Bourne commands @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.18 2017/06/22 14:11:27 kamil Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.19 2017/06/22 14:20:46 kamil Exp $"); #endif @@ -331,9 +331,6 @@ c_read(wp) while (1) { c = shf_getc(shf); if (c == '\0' -#ifdef OS2 -|| c == '\r' -#endif /* OS2 */ ) continue;
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 14:11:28 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c c_sh.c c_ulimit.c config.h edit.c emacs.c eval.c exec.c history.c io.c jobs.c lex.c main.c misc.c path.c sh.h shf.c trap.c tree.h vi.c Log Message: Temporarily revert previous. emacs.* gets wrong code in generation To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/c_sh.c src/bin/ksh/eval.c cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/c_ulimit.c src/bin/ksh/history.c cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/config.h cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/edit.c cvs rdiff -u -r1.33 -r1.34 src/bin/ksh/emacs.c cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/exec.c src/bin/ksh/lex.c \ src/bin/ksh/main.c cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/io.c src/bin/ksh/path.c \ src/bin/ksh/sh.h cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/jobs.c cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/misc.c cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/shf.c cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/trap.c cvs rdiff -u -r1.5 -r1.6 src/bin/ksh/tree.h cvs rdiff -u -r1.14 -r1.15 src/bin/ksh/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.21 src/bin/ksh/c_ksh.c:1.22 --- src/bin/ksh/c_ksh.c:1.21 Thu Jun 22 13:35:47 2017 +++ src/bin/ksh/c_ksh.c Thu Jun 22 14:11:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.21 2017/06/22 13:35:47 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.22 2017/06/22 14:11:27 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,13 +6,17 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.21 2017/06/22 13:35:47 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.22 2017/06/22 14:11:27 kamil Exp $"); #endif #include "sh.h" #include "ksh_stat.h" #include +#ifdef __CYGWIN__ +#include +#endif /* __CYGWIN__ */ + int c_cd(wp) char **wp; @@ -141,7 +145,15 @@ c_cd(wp) setstr(oldpwd_s, current_wd, KSH_RETURN_ERROR); if (!ISABSPATH(Xstring(xs, xp))) { +#ifdef OS2 + /* simplify_path() doesn't know about os/2's drive contexts, + * so it can't set current_wd when changing to a:foo. + * Handle this by calling getcwd()... + */ + pwd = ksh_get_wd((char *) 0, 0); +#else /* OS2 */ pwd = (char *) 0; +#endif /* OS2 */ } else #ifdef S_ISLNK if (!physical || !(pwd = get_phys_path(Xstring(xs, xp @@ -150,7 +162,12 @@ c_cd(wp) /* Set PWD */ if (pwd) { +#ifdef __CYGWIN__ + char ptmp[PATH]; /* larger than MAX_PATH */ + cygwin_conv_to_full_posix_path(pwd, ptmp); +#else /* __CYGWIN__ */ char *ptmp = pwd; +#endif /* __CYGWIN__ */ set_current_wd(ptmp); /* Ignore failure (happens if readonly or integer) */ setstr(pwd_s, ptmp, KSH_RETURN_ERROR); @@ -224,6 +241,7 @@ c_print(wp) #define PO_PMINUSMINUS BIT(2) /* print a -- argument */ #define PO_HIST BIT(3) /* print to history instead of stdout */ #define PO_COPROC BIT(4) /* printing to coprocess: block SIGPIPE */ +#define PO_FSLASH BIT(5) /* swap slash for backslash (for os2 ) */ int fd = 1; int flags = PO_EXPAND|PO_NL; char *s; @@ -264,7 +282,11 @@ c_print(wp) } } else { int optc; +#if OS2 + const char *options = "Rnpfrsu,"; /* added f flag */ +#else const char *options = "Rnprsu,"; +#endif while ((optc = ksh_getopt(wp, _opt, options)) != EOF) switch (optc) { case 'R': /* fake BSD echo command */ @@ -275,6 +297,11 @@ c_print(wp) case 'e': flags |= PO_EXPAND; break; +#ifdef OS2 + case 'f': +flags |= PO_FSLASH; +break; +#endif case 'n': flags &= ~PO_NL; break; @@ -320,12 +347,19 @@ c_print(wp) s = *wp; while ((c = *s++) != '\0') { Xcheck(xs, xp); +#ifdef OS2 + if ((flags & PO_FSLASH) && c == '\\') +if (*s == '\\') + *s++; +else + c = '/'; +#endif /* OS2 */ if ((flags & PO_EXPAND) && c == '\\') { int i; switch ((c = *s++)) { /* Oddly enough, \007 seems more portable than - * \a (due to Ultrix cc, old pcc's, + * \a (due to HP-UX cc, Ultrix cc, old pcc's, * etc.). */ case 'a': c = '\007'; break; Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.17 src/bin/ksh/c_sh.c:1.18 --- src/bin/ksh/c_sh.c:1.17 Thu Jun 22 13:33:39 2017 +++ src/bin/ksh/c_sh.c Thu Jun 22 14:11:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.17 2017/06/22 13:33:39 kamil Exp $ */ +/* $NetBSD: c_sh.c,v 1.18 2017/06/22 14:11:27 kamil Exp $ */ /* * built-in Bourne commands @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.17 2017/06/22 13:33:39 kamil Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.18 2017/06/22 14:11:27 kamil Exp $"); #endif @@ -331,6 +331,9 @@ c_read(wp) while (1) { c = shf_getc(shf); if (c == '\0' +#ifdef OS2 +|| c == '\r' +#endif /* OS2 */ ) continue; if (c == EOF && shf_error(shf) @@ -902,5 +905,13
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 13:37:16 UTC 2017 Modified Files: src/bin/ksh: config.h sh.h trap.c Log Message: Remove code for AIX, including hack for 3.2.5 (from 1997) - from ksh(1) OK by To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/bin/ksh/config.h cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/sh.h cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.11 src/bin/ksh/config.h:1.12 --- src/bin/ksh/config.h:1.11 Thu Jun 22 13:35:47 2017 +++ src/bin/ksh/config.h Thu Jun 22 13:37:16 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.11 2017/06/22 13:35:47 kamil Exp $ */ +/* $NetBSD: config.h,v 1.12 2017/06/22 13:37:16 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -11,13 +11,6 @@ #ifndef CONFIG_H #define CONFIG_H -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -/* #undef _ALL_SOURCE */ -#endif - /* Define if the closedir function returns void instead of int. */ /* #undef CLOSEDIR_VOID */ Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.9 src/bin/ksh/sh.h:1.10 --- src/bin/ksh/sh.h:1.9 Thu Jun 22 13:33:39 2017 +++ src/bin/ksh/sh.h Thu Jun 22 13:37:16 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.9 2017/06/22 13:33:39 kamil Exp $ */ +/* $NetBSD: sh.h,v 1.10 2017/06/22 13:37:16 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.9 2017/06/22 13:33:39 kamil Exp $ */ +/* $Id: sh.h,v 1.10 2017/06/22 13:37:16 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -545,10 +545,7 @@ typedef struct trap { EXTERN int volatile trap; /* traps pending? */ EXTERN int volatile intrsig; /* pending trap interrupts executing command */ EXTERN int volatile fatal_trap;/* received a fatal signal */ -#ifndef FROM_TRAP_C -/* Kludge to avoid bogus re-declaration of sigtraps[] error on AIX 3.2.5 */ extern Trap sigtraps[SIGNALS+1]; -#endif /* !FROM_TRAP_C */ #ifdef KSH /* Index: src/bin/ksh/trap.c diff -u src/bin/ksh/trap.c:1.8 src/bin/ksh/trap.c:1.9 --- src/bin/ksh/trap.c:1.8 Mon Oct 16 00:07:32 2006 +++ src/bin/ksh/trap.c Thu Jun 22 13:37:16 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.8 2006/10/16 00:07:32 christos Exp $ */ +/* $NetBSD: trap.c,v 1.9 2017/06/22 13:37:16 kamil Exp $ */ /* * signal handling @@ -6,12 +6,9 @@ #include #ifndef lint -__RCSID("$NetBSD: trap.c,v 1.8 2006/10/16 00:07:32 christos Exp $"); +__RCSID("$NetBSD: trap.c,v 1.9 2017/06/22 13:37:16 kamil Exp $"); #endif - -/* Kludge to avoid bogus re-declaration of sigtraps[] error on AIX 3.2.5 */ -#define FROM_TRAP_C #include "sh.h" /* Table is indexed by signal number
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 13:35:47 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c c_ulimit.c config.h misc.c Log Message: Drop HP-UX support from ksh(1) OK by To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/c_ulimit.c cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/config.h cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/misc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.20 src/bin/ksh/c_ksh.c:1.21 --- src/bin/ksh/c_ksh.c:1.20 Thu Jun 22 13:33:39 2017 +++ src/bin/ksh/c_ksh.c Thu Jun 22 13:35:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.20 2017/06/22 13:33:39 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.21 2017/06/22 13:35:47 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.20 2017/06/22 13:33:39 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.21 2017/06/22 13:35:47 kamil Exp $"); #endif #include "sh.h" @@ -325,7 +325,7 @@ c_print(wp) switch ((c = *s++)) { /* Oddly enough, \007 seems more portable than - * \a (due to HP-UX cc, Ultrix cc, old pcc's, + * \a (due to Ultrix cc, old pcc's, * etc.). */ case 'a': c = '\007'; break; Index: src/bin/ksh/c_ulimit.c diff -u src/bin/ksh/c_ulimit.c:1.12 src/bin/ksh/c_ulimit.c:1.13 --- src/bin/ksh/c_ulimit.c:1.12 Sat May 9 13:26:06 2015 +++ src/bin/ksh/c_ulimit.c Thu Jun 22 13:35:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ulimit.c,v 1.12 2015/05/09 13:26:06 christos Exp $ */ +/* $NetBSD: c_ulimit.c,v 1.13 2017/06/22 13:35:47 kamil Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -20,7 +20,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ulimit.c,v 1.12 2015/05/09 13:26:06 christos Exp $"); +__RCSID("$NetBSD: c_ulimit.c,v 1.13 2017/06/22 13:35:47 kamil Exp $"); #endif @@ -113,9 +113,6 @@ c_ulimit(wp) # ifdef UL_GETBREAK /* osf/1 */ { "vmemory(maxaddr)", ULIMIT, UL_GETBREAK, -1, 1, 'v' }, # else /* UL_GETBREAK */ -# ifdef UL_GETMAXBRK /* hpux */ - { "vmemory(maxaddr)", ULIMIT, UL_GETMAXBRK, -1, 1, 'v' }, -# endif /* UL_GETMAXBRK */ # endif /* UL_GETBREAK */ # endif /* UL_GMEMLIM */ #endif /* RLIMIT_VMEM */ Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.10 src/bin/ksh/config.h:1.11 --- src/bin/ksh/config.h:1.10 Thu Jun 22 13:34:48 2017 +++ src/bin/ksh/config.h Thu Jun 22 13:35:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.10 2017/06/22 13:34:48 kamil Exp $ */ +/* $NetBSD: config.h,v 1.11 2017/06/22 13:35:47 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -194,10 +194,6 @@ #define DEFAULT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" #endif -/* Define if your C library's getwd/getcwd function dumps core in unreadable - * directories. */ -/* #undef HPUX_GETWD_BUG */ - /* Include ksh features? */ #define KSH 1 Index: src/bin/ksh/misc.c diff -u src/bin/ksh/misc.c:1.18 src/bin/ksh/misc.c:1.19 --- src/bin/ksh/misc.c:1.18 Thu Jun 22 13:33:39 2017 +++ src/bin/ksh/misc.c Thu Jun 22 13:35:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.18 2017/06/22 13:33:39 kamil Exp $ */ +/* $NetBSD: misc.c,v 1.19 2017/06/22 13:35:47 kamil Exp $ */ /* * Miscellaneous functions @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: misc.c,v 1.18 2017/06/22 13:33:39 kamil Exp $"); +__RCSID("$NetBSD: misc.c,v 1.19 2017/06/22 13:35:47 kamil Exp $"); #endif @@ -1284,25 +1284,6 @@ reset_nonblock(fd) # define MAXPATHLEN PATH #endif /* MAXPATHLEN */ -#ifdef HPUX_GETWD_BUG -# include "ksh_dir.h" - -/* - * Work around bug in hpux 10.x C library - getwd/getcwd dump core - * if current directory is not readable. Done in macro 'cause code - * is needed in GETWD and GETCWD cases. - */ -# define HPUX_GETWD_BUG_CODE \ - { \ - DIR *d = ksh_opendir("."); \ - if (!d) \ - return (char *) 0; \ - closedir(d); \ - } -#else /* HPUX_GETWD_BUG */ -# define HPUX_GETWD_BUG_CODE -#endif /* HPUX_GETWD_BUG */ - /* Like getcwd(), except bsize is ignored if buf is 0 (MAXPATHLEN is used) */ char * ksh_get_wd(buf, bsize) @@ -1313,9 +1294,6 @@ ksh_get_wd(buf, bsize) char *b; char *ret; - /* Before memory allocated */ - HPUX_GETWD_BUG_CODE - /* Assume getcwd() available */ if (!buf) { bsize = MAXPATHLEN; @@ -1338,9 +1316,6 @@ ksh_get_wd(buf, bsize) char *b; int len; - /* Before memory allocated */ - HPUX_GETWD_BUG_CODE - if (buf && bsize > MAXPATHLEN) b = buf; else
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 13:34:48 UTC 2017 Modified Files: src/bin/ksh: config.h edit.c Log Message: Remove sco unix 3.2v4.1 support (from 1992) from ksh(1) OK by To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/config.h cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/edit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/config.h diff -u src/bin/ksh/config.h:1.9 src/bin/ksh/config.h:1.10 --- src/bin/ksh/config.h:1.9 Thu Jun 22 13:33:39 2017 +++ src/bin/ksh/config.h Thu Jun 22 13:34:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.9 2017/06/22 13:33:39 kamil Exp $ */ +/* $NetBSD: config.h,v 1.10 2017/06/22 13:34:48 kamil Exp $ */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ @@ -178,9 +178,6 @@ /* Define if the pgrp of setpgrp() can't be the pid of a zombie process */ /* #undef NEED_PGRP_SYNC */ -/* Define if you arg running SCO unix */ -/* #undef OS_SCO */ - /* Define if you arg running ISC unix */ /* #undef OS_ISC */ Index: src/bin/ksh/edit.c diff -u src/bin/ksh/edit.c:1.27 src/bin/ksh/edit.c:1.28 --- src/bin/ksh/edit.c:1.27 Thu Jun 22 13:33:39 2017 +++ src/bin/ksh/edit.c Thu Jun 22 13:34:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: edit.c,v 1.27 2017/06/22 13:33:39 kamil Exp $ */ +/* $NetBSD: edit.c,v 1.28 2017/06/22 13:34:48 kamil Exp $ */ /* * Command line editing - common code @@ -7,7 +7,7 @@ #include #ifndef lint -__RCSID("$NetBSD: edit.c,v 1.27 2017/06/22 13:33:39 kamil Exp $"); +__RCSID("$NetBSD: edit.c,v 1.28 2017/06/22 13:34:48 kamil Exp $"); #endif @@ -19,10 +19,6 @@ __RCSID("$NetBSD: edit.c,v 1.27 2017/06/ #define EXTERN #include "edit.h" #undef EXTERN -#ifdef OS_SCO /* SCO Unix 3.2v4.1 */ -# include /* needed for */ -# include /* needed for struct winsize */ -#endif /* OS_SCO */ #include #include #include "ksh_stat.h"
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 13:33:39 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c c_sh.c config.h edit.c emacs.c eval.c exec.c history.c io.c jobs.c lex.c main.c misc.c path.c sh.h shf.c tree.h vi.c Log Message: Remove os2 support in ksh(1) OK by To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.16 -r1.17 src/bin/ksh/c_sh.c src/bin/ksh/eval.c cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/config.h src/bin/ksh/sh.h cvs rdiff -u -r1.26 -r1.27 src/bin/ksh/edit.c cvs rdiff -u -r1.32 -r1.33 src/bin/ksh/emacs.c cvs rdiff -u -r1.15 -r1.16 src/bin/ksh/exec.c src/bin/ksh/lex.c \ src/bin/ksh/main.c cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/history.c cvs rdiff -u -r1.9 -r1.10 src/bin/ksh/io.c src/bin/ksh/path.c cvs rdiff -u -r1.10 -r1.11 src/bin/ksh/jobs.c cvs rdiff -u -r1.17 -r1.18 src/bin/ksh/misc.c cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/shf.c cvs rdiff -u -r1.4 -r1.5 src/bin/ksh/tree.h cvs rdiff -u -r1.13 -r1.14 src/bin/ksh/vi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.19 src/bin/ksh/c_ksh.c:1.20 --- src/bin/ksh/c_ksh.c:1.19 Thu Jun 22 13:32:04 2017 +++ src/bin/ksh/c_ksh.c Thu Jun 22 13:33:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $ */ +/* $NetBSD: c_ksh.c,v 1.20 2017/06/22 13:33:39 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.20 2017/06/22 13:33:39 kamil Exp $"); #endif #include "sh.h" @@ -141,15 +141,7 @@ c_cd(wp) setstr(oldpwd_s, current_wd, KSH_RETURN_ERROR); if (!ISABSPATH(Xstring(xs, xp))) { -#ifdef OS2 - /* simplify_path() doesn't know about os/2's drive contexts, - * so it can't set current_wd when changing to a:foo. - * Handle this by calling getcwd()... - */ - pwd = ksh_get_wd((char *) 0, 0); -#else /* OS2 */ pwd = (char *) 0; -#endif /* OS2 */ } else #ifdef S_ISLNK if (!physical || !(pwd = get_phys_path(Xstring(xs, xp @@ -232,7 +224,6 @@ c_print(wp) #define PO_PMINUSMINUS BIT(2) /* print a -- argument */ #define PO_HIST BIT(3) /* print to history instead of stdout */ #define PO_COPROC BIT(4) /* printing to coprocess: block SIGPIPE */ -#define PO_FSLASH BIT(5) /* swap slash for backslash (for os2 ) */ int fd = 1; int flags = PO_EXPAND|PO_NL; char *s; @@ -273,11 +264,7 @@ c_print(wp) } } else { int optc; -#if OS2 - const char *options = "Rnpfrsu,"; /* added f flag */ -#else const char *options = "Rnprsu,"; -#endif while ((optc = ksh_getopt(wp, _opt, options)) != EOF) switch (optc) { case 'R': /* fake BSD echo command */ @@ -288,11 +275,6 @@ c_print(wp) case 'e': flags |= PO_EXPAND; break; -#ifdef OS2 - case 'f': -flags |= PO_FSLASH; -break; -#endif case 'n': flags &= ~PO_NL; break; @@ -338,13 +320,6 @@ c_print(wp) s = *wp; while ((c = *s++) != '\0') { Xcheck(xs, xp); -#ifdef OS2 - if ((flags & PO_FSLASH) && c == '\\') -if (*s == '\\') - *s++; -else - c = '/'; -#endif /* OS2 */ if ((flags & PO_EXPAND) && c == '\\') { int i; Index: src/bin/ksh/c_sh.c diff -u src/bin/ksh/c_sh.c:1.16 src/bin/ksh/c_sh.c:1.17 --- src/bin/ksh/c_sh.c:1.16 Tue Oct 11 06:31:07 2016 +++ src/bin/ksh/c_sh.c Thu Jun 22 13:33:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_sh.c,v 1.16 2016/10/11 06:31:07 dholland Exp $ */ +/* $NetBSD: c_sh.c,v 1.17 2017/06/22 13:33:39 kamil Exp $ */ /* * built-in Bourne commands @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: c_sh.c,v 1.16 2016/10/11 06:31:07 dholland Exp $"); +__RCSID("$NetBSD: c_sh.c,v 1.17 2017/06/22 13:33:39 kamil Exp $"); #endif @@ -331,9 +331,6 @@ c_read(wp) while (1) { c = shf_getc(shf); if (c == '\0' -#ifdef OS2 -|| c == '\r' -#endif /* OS2 */ ) continue; if (c == EOF && shf_error(shf) @@ -905,13 +902,5 @@ const struct builtin shbuiltins [] = { {"ulimit", c_ulimit}, {"+umask", c_umask}, {"*=unset", c_unset}, -#ifdef OS2 - /* In OS2, the first line of a file can be "extproc name", which - * tells the command interpreter (cmd.exe) to use name to execute - * the file. For this to be useful, ksh must ignore commands - * starting with extproc and this does the trick... - */ - {"extproc", c_label}, -#endif /* OS2 */ {NULL, NULL} }; Index: src/bin/ksh/eval.c diff -u src/bin/ksh/eval.c:1.16 src/bin/ksh/eval.c:1.17 --- src/bin/ksh/eval.c:1.16 Tue Oct 4 15:09:03 2016 +++ src/bin/ksh/eval.c Thu Jun 22 13:33:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.16 2016/10/04 15:09:03 joerg Exp $ */ +/* $NetBSD: eval.c,v 1.17 2017/06/22 13:33:39 kamil Exp $ */ /* * Expansion - quoting, separation, substitution, globbing @@
CVS commit: src/bin/ksh
Module Name:src Committed By: kamil Date: Thu Jun 22 13:32:04 UTC 2017 Modified Files: src/bin/ksh: c_ksh.c edit.c path.c sh.h Log Message: Remove ancient cygwin support in ksh(1) OK by To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/bin/ksh/c_ksh.c cvs rdiff -u -r1.25 -r1.26 src/bin/ksh/edit.c cvs rdiff -u -r1.8 -r1.9 src/bin/ksh/path.c cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/sh.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ksh/c_ksh.c diff -u src/bin/ksh/c_ksh.c:1.18 src/bin/ksh/c_ksh.c:1.19 --- src/bin/ksh/c_ksh.c:1.18 Sun Oct 16 17:12:11 2011 +++ src/bin/ksh/c_ksh.c Thu Jun 22 13:32:04 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: c_ksh.c,v 1.18 2011/10/16 17:12:11 joerg Exp $ */ +/* $NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $ */ /* * built-in Korn commands: c_* @@ -6,17 +6,13 @@ #include #ifndef lint -__RCSID("$NetBSD: c_ksh.c,v 1.18 2011/10/16 17:12:11 joerg Exp $"); +__RCSID("$NetBSD: c_ksh.c,v 1.19 2017/06/22 13:32:04 kamil Exp $"); #endif #include "sh.h" #include "ksh_stat.h" #include -#ifdef __CYGWIN__ -#include -#endif /* __CYGWIN__ */ - int c_cd(wp) char **wp; @@ -162,12 +158,7 @@ c_cd(wp) /* Set PWD */ if (pwd) { -#ifdef __CYGWIN__ - char ptmp[PATH]; /* larger than MAX_PATH */ - cygwin_conv_to_full_posix_path(pwd, ptmp); -#else /* __CYGWIN__ */ char *ptmp = pwd; -#endif /* __CYGWIN__ */ set_current_wd(ptmp); /* Ignore failure (happens if readonly or integer) */ setstr(pwd_s, ptmp, KSH_RETURN_ERROR); Index: src/bin/ksh/edit.c diff -u src/bin/ksh/edit.c:1.25 src/bin/ksh/edit.c:1.26 --- src/bin/ksh/edit.c:1.25 Sat Jun 5 03:02:37 2010 +++ src/bin/ksh/edit.c Thu Jun 22 13:32:04 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: edit.c,v 1.25 2010/06/05 03:02:37 sjg Exp $ */ +/* $NetBSD: edit.c,v 1.26 2017/06/22 13:32:04 kamil Exp $ */ /* * Command line editing - common code @@ -7,7 +7,7 @@ #include #ifndef lint -__RCSID("$NetBSD: edit.c,v 1.25 2010/06/05 03:02:37 sjg Exp $"); +__RCSID("$NetBSD: edit.c,v 1.26 2017/06/22 13:32:04 kamil Exp $"); #endif @@ -293,11 +293,6 @@ x_mode(onoff) set_tty(tty_fd, , TF_WAIT); -#ifdef __CYGWIN__ - if (edchars.eof == '\0') - edchars.eof = '\4'; -#endif /* __CYGWIN__ */ - /* Convert unset values to internal `unset' value */ if (edchars.erase == vdisable_c) edchars.erase = -1; Index: src/bin/ksh/path.c diff -u src/bin/ksh/path.c:1.8 src/bin/ksh/path.c:1.9 --- src/bin/ksh/path.c:1.8 Sat Apr 25 05:11:37 2009 +++ src/bin/ksh/path.c Thu Jun 22 13:32:04 2017 @@ -1,8 +1,8 @@ -/* $NetBSD: path.c,v 1.8 2009/04/25 05:11:37 lukem Exp $ */ +/* $NetBSD: path.c,v 1.9 2017/06/22 13:32:04 kamil Exp $ */ #include #ifndef lint -__RCSID("$NetBSD: path.c,v 1.8 2009/04/25 05:11:37 lukem Exp $"); +__RCSID("$NetBSD: path.c,v 1.9 2017/06/22 13:32:04 kamil Exp $"); #endif @@ -130,10 +130,10 @@ simplify_path(pathx) if ((isrooted = ISROOTEDPATH(pathx))) very_start++; -#if defined (OS2) || defined (__CYGWIN__) +#if defined (OS2) if (pathx[0] && pathx[1] == ':') /* skip a: */ very_start += 2; -#endif /* OS2 || __CYGWIN__ */ +#endif /* OS2 */ /* Before After * /foo/ /foo @@ -143,19 +143,13 @@ simplify_path(pathx) * .... * ./foo foo * foo/../../../bar ../../bar - * OS2 and CYGWIN: + * OS2: * a:/foo/../.. a:/ * a:.a: * a:.. a:.. * a:foo/../../blah a:../blah */ -#ifdef __CYGWIN__ - /* preserve leading double-slash on pathnames (for UNC paths) */ - if (pathx[0] && ISDIRSEP(pathx[0]) && pathx[1] && ISDIRSEP(pathx[1])) - very_start++; -#endif /* __CYGWIN__ */ - for (cur = t = start = very_start; ; ) { /* treat multiple '/'s as one '/' */ while (ISDIRSEP(*t)) Index: src/bin/ksh/sh.h diff -u src/bin/ksh/sh.h:1.7 src/bin/ksh/sh.h:1.8 --- src/bin/ksh/sh.h:1.7 Sun Jun 26 19:09:00 2005 +++ src/bin/ksh/sh.h Thu Jun 22 13:32:04 2017 @@ -1,10 +1,10 @@ -/* $NetBSD: sh.h,v 1.7 2005/06/26 19:09:00 christos Exp $ */ +/* $NetBSD: sh.h,v 1.8 2017/06/22 13:32:04 kamil Exp $ */ /* * Public Domain Bourne/Korn shell */ -/* $Id: sh.h,v 1.7 2005/06/26 19:09:00 christos Exp $ */ +/* $Id: sh.h,v 1.8 2017/06/22 13:32:04 kamil Exp $ */ #include "config.h" /* system and option configuration info */ @@ -323,14 +323,8 @@ extern char *ksh_strrchr_dirsep(const ch # define DIRSEP '/' # define DIRSEPSTR "/" # define ISDIRSEP(c)((c) == '/') -#ifdef __CYGWIN__ -# define ISABSPATH(s) \ - (((s)[0] && (s)[1] == ':' && ISDIRSEP((s)[2])) || ISDIRSEP((s)[0])) -# define ISRELPATH(s) (!(s)[0] || ((s)[1] != ':' && !ISDIRSEP((s)[0]))) -#else /* __CYGWIN__ */ # define ISABSPATH(s) ISDIRSEP((s)[0]) # define ISRELPATH(s) (!ISABSPATH(s)) -#endif /* __CYGWIN__ */ # define ISROOTEDPATH(s) ISABSPATH(s) # define FILECHCONV(c) c # define FILECMP(s1, s2) strcmp(s1, s2)
CVS commit: src
Module Name:src Committed By: kamil Date: Tue Jun 20 01:17:13 UTC 2017 Modified Files: src/distrib/sets/lists/comp: mi src/sys/sys: Makefile Removed Files: src/sys/sys: user.h Log Message: Remove Proposed on the the tech-userlevel mailing list without strong objections. This file no longer serves any purpose in any supported release branch. There will be fallout in pkgsrc, please restrict inclusion to FreeBSD and DragonflyBSD. I tried to iterate over packages in pkgsrc and there was little fallout, however I don't have the full sources to scan every source code. I already upstreamed to several projects removal of inclusion on NetBSD of (like Qt5). To generate a diff of this commit: cvs rdiff -u -r1.2140 -r1.2141 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.161 -r1.162 src/sys/sys/Makefile cvs rdiff -u -r1.19 -r0 src/sys/sys/user.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2140 src/distrib/sets/lists/comp/mi:1.2141 --- src/distrib/sets/lists/comp/mi:1.2140 Tue Jun 13 06:39:09 2017 +++ src/distrib/sets/lists/comp/mi Tue Jun 20 01:17:13 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2140 2017/06/13 06:39:09 nat Exp $ +# $NetBSD: mi,v 1.2141 2017/06/20 01:17:13 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -2994,7 +2994,7 @@ ./usr/include/sys/un.hcomp-c-include ./usr/include/sys/unistd.h comp-c-include ./usr/include/sys/unpcb.h comp-c-include -./usr/include/sys/user.h comp-c-include +./usr/include/sys/user.h comp-obsolete obsolete ./usr/include/sys/utsname.h comp-c-include ./usr/include/sys/uuid.h comp-c-include ./usr/include/sys/vadvise.h comp-c-include Index: src/sys/sys/Makefile diff -u src/sys/sys/Makefile:1.161 src/sys/sys/Makefile:1.162 --- src/sys/sys/Makefile:1.161 Fri May 19 00:01:34 2017 +++ src/sys/sys/Makefile Tue Jun 20 01:17:13 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.161 2017/05/19 00:01:34 pgoyette Exp $ +# $NetBSD: Makefile,v 1.162 2017/06/20 01:17:13 kamil Exp $ .include @@ -43,7 +43,7 @@ INCS= acct.h agpio.h aio.h ansi.h aout_m tape.h termios.h time.h timeb.h timepps.h times.h timespec.h \ timex.h tls.h trace.h tree.h tty.h ttychars.h ttycom.h \ ttydefaults.h ttydev.h types.h \ - ucontext.h ucred.h uio.h un.h unistd.h unpcb.h user.h utsname.h uuid.h \ + ucontext.h ucred.h uio.h un.h unistd.h unpcb.h utsname.h uuid.h \ vadvise.h verified_exec.h videoio.h vmmeter.h vnode.h vnode_if.h \ wait.h wapbl.h wapbl_replay.h wdog.h xattr.h
CVS commit: src/external/bsd/ipf/dist/ipsend
Module Name:src Committed By: kamil Date: Thu Jun 15 23:55:42 UTC 2017 Modified Files: src/external/bsd/ipf/dist/ipsend: lsock.c Log Message: Don't include on NetBSD in IPF (lsock) This header in this context is freebsdism. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/dist/ipsend/lsock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/ipf/dist/ipsend/lsock.c diff -u src/external/bsd/ipf/dist/ipsend/lsock.c:1.2 src/external/bsd/ipf/dist/ipsend/lsock.c:1.3 --- src/external/bsd/ipf/dist/ipsend/lsock.c:1.2 Sun Jul 22 14:27:36 2012 +++ src/external/bsd/ipf/dist/ipsend/lsock.c Thu Jun 15 23:55:42 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: lsock.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $ */ +/* $NetBSD: lsock.c,v 1.3 2017/06/15 23:55:42 kamil Exp $ */ /* * lsock.c (C) 1995-1998 Darren Reed @@ -39,7 +39,9 @@ static const char rcsid[] = "@(#)Id: lso #include #include #include +#if defined(__FreeBSD__) #include +#endif #include #include #include
CVS commit: src/external/bsd/ipf/dist/ipsend
Module Name:src Committed By: kamil Date: Thu Jun 15 23:53:56 UTC 2017 Modified Files: src/external/bsd/ipf/dist/ipsend: iptests.c Log Message: Don't include on NetBSD in IPF (iptests) This header in this context is freebsdism. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ipf/dist/ipsend/iptests.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/ipf/dist/ipsend/iptests.c diff -u src/external/bsd/ipf/dist/ipsend/iptests.c:1.3 src/external/bsd/ipf/dist/ipsend/iptests.c:1.4 --- src/external/bsd/ipf/dist/ipsend/iptests.c:1.3 Sun Jul 22 14:27:36 2012 +++ src/external/bsd/ipf/dist/ipsend/iptests.c Thu Jun 15 23:53:56 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: iptests.c,v 1.3 2012/07/22 14:27:36 darrenr Exp $ */ +/* $NetBSD: iptests.c,v 1.4 2017/06/15 23:53:56 kamil Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -41,7 +41,9 @@ typedef int boolean_t; #endif #if !defined(solaris) && !defined(linux) && !defined(__sgi) # include +#if defined(__FreeBSD__) # include +#endif # include #endif #if !defined(ultrix) && !defined(hpux) && !defined(linux) && \
CVS commit: src/external/bsd/ipf/dist/ipsend
Module Name:src Committed By: kamil Date: Thu Jun 15 23:50:20 UTC 2017 Modified Files: src/external/bsd/ipf/dist/ipsend: sock.c Log Message: Don't include on NetBSD in IPF This header in this context is freebsdism. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ipf/dist/ipsend/sock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/ipf/dist/ipsend/sock.c diff -u src/external/bsd/ipf/dist/ipsend/sock.c:1.3 src/external/bsd/ipf/dist/ipsend/sock.c:1.4 --- src/external/bsd/ipf/dist/ipsend/sock.c:1.3 Sun Jul 22 14:27:36 2012 +++ src/external/bsd/ipf/dist/ipsend/sock.c Thu Jun 15 23:50:20 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sock.c,v 1.3 2012/07/22 14:27:36 darrenr Exp $ */ +/* $NetBSD: sock.c,v 1.4 2017/06/15 23:50:20 kamil Exp $ */ /* * sock.c (C) 1995-1998 Darren Reed @@ -47,7 +47,9 @@ typedef int boolean_t; # undef KERNEL #endif #include +#if defined(__FreeBSD__) #include +#endif #include #include #include
CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: kamil Date: Thu Jun 15 23:46:30 UTC 2017 Modified Files: src/external/gpl3/gdb/dist/gdb: bsd-kvm.c Log Message: Don't include on NetBSD in GDB This header in this context is freebsdism. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.9 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.10 --- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.9 Wed Oct 12 20:20:33 2016 +++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c Thu Jun 15 23:46:30 2017 @@ -37,7 +37,9 @@ #include "readline/readline.h" #include #include +#if defined(__FreeBSD__) #include +#endif #include "bsd-kvm.h"
CVS commit: src/external/bsd/libproc/dist
Module Name:src Committed By: kamil Date: Thu Jun 15 23:44:58 UTC 2017 Modified Files: src/external/bsd/libproc/dist: proc_sym.c Log Message: Don't include on NetBSD in libproc This header in this context is freebsdism. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libproc/dist/proc_sym.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libproc/dist/proc_sym.c diff -u src/external/bsd/libproc/dist/proc_sym.c:1.3 src/external/bsd/libproc/dist/proc_sym.c:1.4 --- src/external/bsd/libproc/dist/proc_sym.c:1.3 Tue Apr 26 14:28:39 2016 +++ src/external/bsd/libproc/dist/proc_sym.c Thu Jun 15 23:44:58 2017 @@ -32,7 +32,7 @@ #ifdef __FBSDID __FBSDID("$FreeBSD: head/lib/libproc/proc_sym.c 279946 2015-03-13 04:26:48Z stas $"); #else -__RCSID("$NetBSD: proc_sym.c,v 1.3 2016/04/26 14:28:39 chs Exp $"); +__RCSID("$NetBSD: proc_sym.c,v 1.4 2017/06/15 23:44:58 kamil Exp $"); #endif #include @@ -40,7 +40,9 @@ __RCSID("$NetBSD: proc_sym.c,v 1.3 2016/ #include #include #endif +#if defined(__FreeBSD__) #include +#endif #include #include
CVS commit: src/etc/mtree
Module Name:src Committed By: kamil Date: Thu Jun 15 15:20:14 UTC 2017 Modified Files: src/etc/mtree: NetBSD.dist.tests Log Message: G/C libpthread_dbg from mtree Remove entries: - ./usr/libdata/debug/usr/tests/lib/libpthread_dbg - ./usr/tests/lib/libpthread_dbg Noted by via private mail. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/etc/mtree/NetBSD.dist.tests Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.tests diff -u src/etc/mtree/NetBSD.dist.tests:1.147 src/etc/mtree/NetBSD.dist.tests:1.148 --- src/etc/mtree/NetBSD.dist.tests:1.147 Sat May 27 21:02:55 2017 +++ src/etc/mtree/NetBSD.dist.tests Thu Jun 15 15:20:13 2017 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.147 2017/05/27 21:02:55 bouyer Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.148 2017/06/15 15:20:13 kamil Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -116,7 +116,6 @@ ./usr/libdata/debug/usr/tests/lib/libprop ./usr/libdata/debug/usr/tests/lib/libpthread ./usr/libdata/debug/usr/tests/lib/libpthread/dlopen -./usr/libdata/debug/usr/tests/lib/libpthread_dbg ./usr/libdata/debug/usr/tests/lib/librefuse ./usr/libdata/debug/usr/tests/lib/librt ./usr/libdata/debug/usr/tests/lib/librumpclient @@ -303,7 +302,6 @@ ./usr/tests/lib/libprop ./usr/tests/lib/libpthread ./usr/tests/lib/libpthread/dlopen -./usr/tests/lib/libpthread_dbg ./usr/tests/lib/librefuse ./usr/tests/lib/librt ./usr/tests/lib/librumpclient
CVS commit: src/external/bsd/cron/bin/cron
Module Name:src Committed By: kamil Date: Wed Jun 14 17:11:39 UTC 2017 Modified Files: src/external/bsd/cron/bin/cron: Makefile Log Message: Unbreak MKPAM=no build Make cron(8) linkage with PAM conditional. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/cron/bin/cron/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/cron/bin/cron/Makefile diff -u src/external/bsd/cron/bin/cron/Makefile:1.4 src/external/bsd/cron/bin/cron/Makefile:1.5 --- src/external/bsd/cron/bin/cron/Makefile:1.4 Fri Jun 9 17:36:29 2017 +++ src/external/bsd/cron/bin/cron/Makefile Wed Jun 14 17:11:39 2017 @@ -1,14 +1,23 @@ -# $NetBSD: Makefile,v 1.4 2017/06/09 17:36:29 christos Exp $ +# $NetBSD: Makefile,v 1.5 2017/06/14 17:11:39 kamil Exp $ + +.include BINDIR= /usr/sbin PROG= cron SRCS= cron.c database.c do_command.c entry.c env.c job.c \ - misc.c pam_auth.c popen.c pw_dup.c user.c -CPPFLAGS+=-I${.CURDIR} -DLOGIN_CAP -DUSE_PAM -DPADD+=${LIBPAM} ${LIBUTIL} -LDADD+=-lpam -lutil + misc.c popen.c pw_dup.c user.c +CPPFLAGS+=-I${.CURDIR} -DLOGIN_CAP +DPADD+= ${LIBUTIL} +LDADD+= -lutil MAN= cron.8 +.if (${MKPAM} != "no") +SRCS+= pam_auth.c +CPPFLAGS+= -DUSE_PAM +DPADD+= ${LIBPAM} +LDADD+= -lpam +.endif + CWARNFLAGS.clang+= -Wno-string-plus-int .include
CVS commit: src/lib
Module Name:src Committed By: kamil Date: Wed Jun 14 12:24:51 UTC 2017 Modified Files: src/lib/libkvm: kvm_aarch64.c src/lib/libutil: kinfo_getvmmap.c Log Message: Stop including in userland libraries This header in this context is freebsdism. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libkvm/kvm_aarch64.c cvs rdiff -u -r1.3 -r1.4 src/lib/libutil/kinfo_getvmmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libkvm/kvm_aarch64.c diff -u src/lib/libkvm/kvm_aarch64.c:1.1 src/lib/libkvm/kvm_aarch64.c:1.2 --- src/lib/libkvm/kvm_aarch64.c:1.1 Sun Aug 10 05:47:37 2014 +++ src/lib/libkvm/kvm_aarch64.c Wed Jun 14 12:24:51 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_aarch64.c,v 1.1 2014/08/10 05:47:37 matt Exp $ */ +/* $NetBSD: kvm_aarch64.c,v 1.2 2017/06/14 12:24:51 kamil Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,6 @@ */ #include -#include #include #include #include @@ -49,7 +48,7 @@ #include "kvm_private.h" -__RCSID("$NetBSD: kvm_aarch64.c,v 1.1 2014/08/10 05:47:37 matt Exp $"); +__RCSID("$NetBSD: kvm_aarch64.c,v 1.2 2017/06/14 12:24:51 kamil Exp $"); /*ARGSUSED*/ void Index: src/lib/libutil/kinfo_getvmmap.c diff -u src/lib/libutil/kinfo_getvmmap.c:1.3 src/lib/libutil/kinfo_getvmmap.c:1.4 --- src/lib/libutil/kinfo_getvmmap.c:1.3 Sat Sep 26 20:28:55 2015 +++ src/lib/libutil/kinfo_getvmmap.c Wed Jun 14 12:24:51 2017 @@ -2,10 +2,9 @@ #ifdef __FBSDID __FBSDID("$FreeBSD: head/lib/libutil/kinfo_getvmmap.c 186512 2008-12-27 11:12:23Z rwatson $"); #endif -__RCSID("$NetBSD: kinfo_getvmmap.c,v 1.3 2015/09/26 20:28:55 christos Exp $"); +__RCSID("$NetBSD: kinfo_getvmmap.c,v 1.4 2017/06/14 12:24:51 kamil Exp $"); #include -#include #include #include #include
CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common
Module Name:src Committed By: kamil Date: Wed Jun 14 12:16:27 UTC 2017 Modified Files: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: sanitizer_procmaps_netbsd.cc Log Message: Detach from sanitizer_procmaps_netbsd.cc (GCC) This header in this context is freebsdism. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.3 --- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2 Wed Jun 1 04:06:15 2016 +++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc Wed Jun 14 12:16:27 2017 @@ -15,7 +15,6 @@ #include #include -#include namespace __sanitizer {
CVS commit: src/lib/libc/sys
Module Name:src Committed By: kamil Date: Wed Jun 7 20:54:59 UTC 2017 Modified Files: src/lib/libc/sys: kqueue.2 Log Message: EV_SET(2) - simplify description Note only the information that it does not evaluate multiple times its parameters. Suggested by . To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/lib/libc/sys/kqueue.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/kqueue.2 diff -u src/lib/libc/sys/kqueue.2:1.44 src/lib/libc/sys/kqueue.2:1.45 --- src/lib/libc/sys/kqueue.2:1.44 Wed Jun 7 05:26:19 2017 +++ src/lib/libc/sys/kqueue.2 Wed Jun 7 20:54:59 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: kqueue.2,v 1.44 2017/06/07 05:26:19 abhinav Exp $ +.\" $NetBSD: kqueue.2,v 1.45 2017/06/07 20:54:59 kamil Exp $ .\" .\" Copyright (c) 2000 Jonathan Lemon .\" All rights reserved. @@ -156,18 +156,7 @@ and .Pp .Fn EV_SET is a macro which is provided for ease of initializing a kevent structure. -It wraps an internal static inline function to prevent preprocessor misuse. -In the past this code would behave incorrectly and damage process's memory, -if incrementation or decrementation would be used as the first argument. -This example has been taken from LLDB, that caused the memory corruption and -inspired the -.Nx -developers for improving the implementation. -.Bd -literal -offset indent -EV_SET(_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0); -.Ed -.Pp -This macro is now safe in all major BSDs. +This macro does not evaluate its parameters multiple times. .Pp The .Va kevent @@ -681,6 +670,7 @@ The function first appeared in .Nx 6.0 . .Pp +The .Fn EV_SET -was converted from a macro implementation to the macro wrapping a static inline function in +macro was protected from evaluating multiple times the first argument in .Nx 8.0 .
CVS commit: src/lib/libc/sys
Module Name:src Committed By: kamil Date: Tue Jun 6 17:01:59 UTC 2017 Modified Files: src/lib/libc/sys: kqueue.2 Log Message: Update the EV_SET() description with newer implementation. EV_SET(2) is a macro again, that wraps an inline function which is still new in NetBSD 8.0. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/lib/libc/sys/kqueue.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/kqueue.2 diff -u src/lib/libc/sys/kqueue.2:1.41 src/lib/libc/sys/kqueue.2:1.42 --- src/lib/libc/sys/kqueue.2:1.41 Wed May 31 01:03:01 2017 +++ src/lib/libc/sys/kqueue.2 Tue Jun 6 17:01:59 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: kqueue.2,v 1.41 2017/05/31 01:03:01 kamil Exp $ +.\" $NetBSD: kqueue.2,v 1.42 2017/06/06 17:01:59 kamil Exp $ .\" .\" Copyright (c) 2000 Jonathan Lemon .\" All rights reserved. @@ -155,10 +155,19 @@ and .Fa eventlist . .Pp .Fn EV_SET -is a static inline function which is provided for ease of initializing a -kevent structure. -Its original form was a preprocessor macro, -which caused bugs in third party code. +is a macro which is provided for ease of initializing a kevent structure. +It wraps an internal static inline function to prevent preprocessor misuse. +In the past this code would behave incorrectly and damage process's memory, +if incrementation or decrementation would be used as the first argument. +This example has been taken from LLDB, that caused the memory corruption and +inspired the +.Nx +developers for improving the implementation. +.Bd -literal -offset indent +EV_SET(_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0); +.Ed +.Pp +This macro is now safe in all major BSDs. .Pp The .Va kevent @@ -673,5 +682,5 @@ function first appeared in .Nx 6.0 . .Pp .Fn EV_SET -was converted from a macro to a static inline function in +was converted from a macro implementation to the macro wrapping a static inline function in .Nx 8.0 .
CVS commit: src/sys/sys
Module Name:src Committed By: kamil Date: Fri Jun 2 19:44:06 UTC 2017 Modified Files: src/sys/sys: event.h Log Message: Convert EV_SET(2) back into macro again This retains compatibility with other moder BSDs if someone uses: "#ifdef EV_SET". This code also casts the last parameter to intptr_t, as other BSDs keep this argument with a different type void*. This change renames function EV_SET to EV_SET_, and calls it from EV_SET(). Credit to and for feedback. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/event.h diff -u src/sys/sys/event.h:1.27 src/sys/sys/event.h:1.28 --- src/sys/sys/event.h:1.27 Wed May 31 00:45:59 2017 +++ src/sys/sys/event.h Fri Jun 2 19:44:06 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: event.h,v 1.27 2017/05/31 00:45:59 kamil Exp $ */ +/* $NetBSD: event.h,v 1.28 2017/06/02 19:44:06 kamil Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon@@ -54,8 +54,11 @@ struct kevent { intptr_t udata; /* opaque user data identifier */ }; +#define EV_SET(kevp, a, b, c, d, e, f) \ + EV_SET_((kevp), (a), (b), (c), (d), (e), __CAST(intptr_t, (f))) + static __inline void -EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter, +EV_SET_(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter, uint32_t _flags, uint32_t _fflags, int64_t _data, intptr_t _udata) { _kevp->ident = _ident;
CVS commit: src/lib/libc/sys
Module Name:src Committed By: kamil Date: Wed May 31 01:03:01 UTC 2017 Modified Files: src/lib/libc/sys: kqueue.2 Log Message: Document transition of EV_SET() from a macro to a static inline function Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/lib/libc/sys/kqueue.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/kqueue.2 diff -u src/lib/libc/sys/kqueue.2:1.40 src/lib/libc/sys/kqueue.2:1.41 --- src/lib/libc/sys/kqueue.2:1.40 Tue Apr 11 17:59:23 2017 +++ src/lib/libc/sys/kqueue.2 Wed May 31 01:03:01 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: kqueue.2,v 1.40 2017/04/11 17:59:23 abhinav Exp $ +.\" $NetBSD: kqueue.2,v 1.41 2017/05/31 01:03:01 kamil Exp $ .\" .\" Copyright (c) 2000 Jonathan Lemon .\" All rights reserved. @@ -155,8 +155,10 @@ and .Fa eventlist . .Pp .Fn EV_SET -is a macro which is provided for ease of initializing a +is a static inline function which is provided for ease of initializing a kevent structure. +Its original form was a preprocessor macro, +which caused bugs in third party code. .Pp The .Va kevent @@ -669,3 +671,7 @@ The .Fn kqueue1 function first appeared in .Nx 6.0 . +.Pp +.Fn EV_SET +was converted from a macro to a static inline function in +.Nx 8.0 .
CVS commit: src/sys/sys
Module Name:src Committed By: kamil Date: Wed May 31 00:45:59 UTC 2017 Modified Files: src/sys/sys: event.h Log Message: Convert EV_SET from macro to static __inline function LLDB introduced support for kevent(2) and it contains the following function: Status MainLoop::RunImpl::Poll() { in_events.resize(loop.m_read_fds.size()); unsigned i = 0; for (auto : loop.m_read_fds) EV_SET(_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0); num_events = kevent(loop.m_kqueue, in_events.data(), in_events.size(), out_events, llvm::array_lengthof(out_events), nullptr); if (num_events < 0) return Status("kevent() failed with error %d\n", num_events); return Status(); } It works on FreeBSD and MacOSX, however it broke on NetBSD. Culrpit line: EV_SET(_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0); FreeBSD defined EV_SET() as a macro this way: #define EV_SET(kevp_, a, b, c, d, e, f) do {\ struct kevent *kevp = (kevp_); \ (kevp)->ident = (a);\ (kevp)->filter = (b); \ (kevp)->flags = (c);\ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f);\ } while(0) NetBSD version was different: #define EV_SET(kevp, a, b, c, d, e, f) \ do {\ (kevp)->ident = (a);\ (kevp)->filter = (b); \ (kevp)->flags = (c);\ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f);\ } while (/* CONSTCOND */ 0) This resulted in heap damage, as keyp was incremented every time value was assigned to (keyp)->. As suggested by Joerg, convert this macro on NetBSD to static __inline function. Credit to for asan+ubsan research wiki entry that helped to narrow down the bug. Credit to for peer-review Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/sys/event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/event.h diff -u src/sys/sys/event.h:1.26 src/sys/sys/event.h:1.27 --- src/sys/sys/event.h:1.26 Sun Jan 31 04:40:01 2016 +++ src/sys/sys/event.h Wed May 31 00:45:59 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: event.h,v 1.26 2016/01/31 04:40:01 christos Exp $ */ +/* $NetBSD: event.h,v 1.27 2017/05/31 00:45:59 kamil Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon@@ -45,17 +45,6 @@ #define EVFILT_TIMER 6U /* arbitrary timer (in ms) */ #define EVFILT_SYSCOUNT 7U /* number of filters */ -#define EV_SET(kevp, a, b, c, d, e, f) \ -do { \ - (kevp)->ident = (a); \ - (kevp)->filter = (b); \ - (kevp)->flags = (c); \ - (kevp)->fflags = (d); \ - (kevp)->data = (e); \ - (kevp)->udata = (f); \ -} while (/* CONSTCOND */ 0) - - struct kevent { uintptr_t ident; /* identifier for this event */ uint32_t filter; /* filter for event */ @@ -65,6 +54,18 @@ struct kevent { intptr_t udata; /* opaque user data identifier */ }; +static __inline void +EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter, + uint32_t _flags, uint32_t _fflags, int64_t _data, intptr_t _udata) +{ + _kevp->ident = _ident; + _kevp->filter = _filter; + _kevp->flags = _flags; + _kevp->fflags = _fflags; + _kevp->data = _data; + _kevp->udata = _udata; +} + /* actions */ #define EV_ADD 0x0001U /* add event to kq (implies ENABLE) */ #define EV_DELETE 0x0002U /* delete event from kq */
CVS commit: src/external/bsd/libarchive
Module Name:src Committed By: kamil Date: Sun May 21 22:32:56 UTC 2017 Modified Files: src/external/bsd/libarchive/include: config_netbsd.h src/external/bsd/libarchive/lib/libarchive: Makefile Log Message: Simplify linking libarchive with libcrypto To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/libarchive/include/config_netbsd.h cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libarchive/lib/libarchive/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libarchive/include/config_netbsd.h diff -u src/external/bsd/libarchive/include/config_netbsd.h:1.8 src/external/bsd/libarchive/include/config_netbsd.h:1.9 --- src/external/bsd/libarchive/include/config_netbsd.h:1.8 Sat Apr 22 15:12:59 2017 +++ src/external/bsd/libarchive/include/config_netbsd.h Sun May 21 22:32:55 2017 @@ -606,7 +606,7 @@ /* #undef HAVE_LIBCHARSET */ /* Define to 1 if you have the `crypto' library (-lcrypto). */ -/* #undef1 HAVE_LIBCRYPTO */ +#define HAVE_LIBCRYPTO 1 /* Define to 1 if you have the `eay32' library (-leay32). */ /* #undef HAVE_LIBEAY32 */ Index: src/external/bsd/libarchive/lib/libarchive/Makefile diff -u src/external/bsd/libarchive/lib/libarchive/Makefile:1.6 src/external/bsd/libarchive/lib/libarchive/Makefile:1.7 --- src/external/bsd/libarchive/lib/libarchive/Makefile:1.6 Sun May 21 15:28:39 2017 +++ src/external/bsd/libarchive/lib/libarchive/Makefile Sun May 21 22:32:56 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2017/05/21 15:28:39 riastradh Exp $ +# $NetBSD: Makefile,v 1.7 2017/05/21 22:32:56 kamil Exp $ .include @@ -6,10 +6,9 @@ LIB= archive -LIBDPLIBS+= crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto -CPPFLAGS+= -DHAVE_LIBCRYPTO LIBDPLIBS+= bz2 ${NETBSDSRCDIR}/lib/libbz2 \ + crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto \ expat ${NETBSDSRCDIR}/external/mit/expat/lib/libexpat \ lzma ${NETBSDSRCDIR}/external/public-domain/xz/lib \ z ${NETBSDSRCDIR}/lib/libz
CVS commit: src/sys/uvm
Module Name:src Committed By: kamil Date: Fri May 19 16:56:35 UTC 2017 Modified Files: src/sys/uvm: uvm_map.c Log Message: Add missing , to fix syntax Unbreaks build after recent change adding a message for vm.user_va0_disable To generate a diff of this commit: cvs rdiff -u -r1.347 -r1.348 src/sys/uvm/uvm_map.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_map.c diff -u src/sys/uvm/uvm_map.c:1.347 src/sys/uvm/uvm_map.c:1.348 --- src/sys/uvm/uvm_map.c:1.347 Fri May 19 15:30:19 2017 +++ src/sys/uvm/uvm_map.c Fri May 19 16:56:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.347 2017/05/19 15:30:19 chs Exp $ */ +/* $NetBSD: uvm_map.c,v 1.348 2017/05/19 16:56:35 kamil Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.347 2017/05/19 15:30:19 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.348 2017/05/19 16:56:35 kamil Exp $"); #include "opt_ddb.h" #include "opt_pax.h" @@ -1068,7 +1068,7 @@ uvm_map(struct vm_map *map, vaddr_t *sta if ((flags & UVM_FLAG_FIXED) && *startp == 0 && !VM_MAP_IS_KERNEL(map) && user_va0_disable) { uprintf("%s: process wants to map virtual address 0; see " - "vm.user_va0_disable in sysctl(7).\n" __func__); + "vm.user_va0_disable in sysctl(7).\n", __func__); return EACCES; } #endif
CVS commit: src/regress/sys
Module Name:src Committed By: kamil Date: Sun May 14 04:26:40 UTC 2017 Modified Files: src/regress/sys: Makefile Removed Files: src/regress/sys/fs/lseek: Makefile lseek.c Log Message: Remove regress lseek tests, obsoleted by ATF Many tests verify lseek through rumpkernels: - tests/dev/cgd/t_cgd_3des - tests/dev/cgd/t_cgd_aes - tests/dev/cgd/t_cgd_blowfish - tests/rump/rumpvfs/t_basic - tests/rump/rumpvfs/t_etfs There are traditional lseek(2) tests too: - tests/kernel/kqueue/read/t_file - tests/kernel/kqueue/read/t_file2 - tests/kernel/t_lockf - tests/lib/libc/stdio/t_fflush - tests/lib/libc/stdio/t_fopen - tests/lib/libc/sys/t_msync - etc To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/regress/sys/Makefile cvs rdiff -u -r1.3 -r0 src/regress/sys/fs/lseek/Makefile cvs rdiff -u -r1.8 -r0 src/regress/sys/fs/lseek/lseek.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/sys/Makefile diff -u src/regress/sys/Makefile:1.15 src/regress/sys/Makefile:1.16 --- src/regress/sys/Makefile:1.15 Sun May 14 04:17:25 2017 +++ src/regress/sys/Makefile Sun May 14 04:26:40 2017 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.15 2017/05/14 04:17:25 kamil Exp $ +# $NetBSD: Makefile,v 1.16 2017/05/14 04:26:40 kamil Exp $ .include -SUBDIR= kern fs +SUBDIR= kern .if exists(arch/${MACHINE}/Makefile) SUBDIR+= arch/${MACHINE} .endif
CVS commit: src/regress/sys/fs
Module Name:src Committed By: kamil Date: Sun May 14 04:21:52 UTC 2017 Modified Files: src/regress/sys/fs: Makefile Removed Files: src/regress/sys/fs/getdents: Makefile getdents.c Log Message: Remove regress getdents test, obsoleted by ATF tests There are ATF tests using rumpkernel to verify getdents: - tests/fs/hfs/t_pathconvert - tests/fs/kernfs/t_basic - tests/fs/vfs/t_union To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/regress/sys/fs/Makefile cvs rdiff -u -r1.1 -r0 src/regress/sys/fs/getdents/Makefile cvs rdiff -u -r1.9 -r0 src/regress/sys/fs/getdents/getdents.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/sys/fs/Makefile diff -u src/regress/sys/fs/Makefile:1.8 src/regress/sys/fs/Makefile:1.9 --- src/regress/sys/fs/Makefile:1.8 Fri Feb 20 21:45:47 2009 +++ src/regress/sys/fs/Makefile Sun May 14 04:21:52 2017 @@ -1,5 +1,5 @@ -# $NetBSD: Makefile,v 1.8 2009/02/20 21:45:47 jmmv Exp $ +# $NetBSD: Makefile,v 1.9 2017/05/14 04:21:52 kamil Exp $ -SUBDIR= getdents lseek +SUBDIR= lseek .include
CVS commit: src/regress/sys/uvm
Module Name:src Committed By: kamil Date: Sun May 14 04:19:06 UTC 2017 Removed Files: src/regress/sys/uvm: Makefile Makefile.inc Log Message: Remove dead leftover Makefiles from src/regress To generate a diff of this commit: cvs rdiff -u -r1.11 -r0 src/regress/sys/uvm/Makefile cvs rdiff -u -r1.1 -r0 src/regress/sys/uvm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/regress/sys
Module Name:src Committed By: kamil Date: Sun May 14 04:17:26 UTC 2017 Modified Files: src/regress/sys: Makefile src/regress/sys/uvm: Makefile Removed Files: src/regress/sys/uvm/stack_exec: Makefile tramptest.c src/regress/sys/uvm/stack_noexec: Makefile tramptest.c Log Message: Remove tests for executable/non-executable stack. These tests were not portable across compilers and recently NetBSD moved to PaX MPROTECT. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/regress/sys/Makefile cvs rdiff -u -r1.10 -r1.11 src/regress/sys/uvm/Makefile cvs rdiff -u -r1.3 -r0 src/regress/sys/uvm/stack_exec/Makefile cvs rdiff -u -r1.1 -r0 src/regress/sys/uvm/stack_exec/tramptest.c cvs rdiff -u -r1.4 -r0 src/regress/sys/uvm/stack_noexec/Makefile cvs rdiff -u -r1.2 -r0 src/regress/sys/uvm/stack_noexec/tramptest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/sys/Makefile diff -u src/regress/sys/Makefile:1.14 src/regress/sys/Makefile:1.15 --- src/regress/sys/Makefile:1.14 Sun May 14 03:50:42 2017 +++ src/regress/sys/Makefile Sun May 14 04:17:25 2017 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.14 2017/05/14 03:50:42 kamil Exp $ +# $NetBSD: Makefile,v 1.15 2017/05/14 04:17:25 kamil Exp $ .include -SUBDIR= kern fs uvm +SUBDIR= kern fs .if exists(arch/${MACHINE}/Makefile) SUBDIR+= arch/${MACHINE} .endif Index: src/regress/sys/uvm/Makefile diff -u src/regress/sys/uvm/Makefile:1.10 src/regress/sys/uvm/Makefile:1.11 --- src/regress/sys/uvm/Makefile:1.10 Thu Jul 14 11:08:44 2011 +++ src/regress/sys/uvm/Makefile Sun May 14 04:17:25 2017 @@ -1,19 +1,5 @@ -# $NetBSD: Makefile,v 1.10 2011/07/14 11:08:44 jruoho Exp $ +# $NetBSD: Makefile,v 1.11 2017/05/14 04:17:25 kamil Exp $ .include -.if !empty(SUPPORTED_CC:Mgcc) -SUBDIR+= stack_exec -.endif - -# -# Test for no-executable stack; applies only to architectures -# where CPU and kernel support it. -# -STACKNOX_ARCHS= alpha i386 powerpc sparc sparc64 x86_64 - -.if !empty(SUPPORTED_CC:Mgcc) && !empty(STACKNOX_ARCHS:M${MACHINE_ARCH}) -SUBDIR+= stack_noexec -.endif - .include
CVS commit: src/regress/sys/kern
Module Name:src Committed By: kamil Date: Sun May 14 04:01:10 UTC 2017 Removed Files: src/regress/sys/kern/callout1: Makefile test_callout1.c src/regress/sys/kern/mutex1: Makefile test_mutex1.c src/regress/sys/kern/mutex2: Makefile test_mutex2.c src/regress/sys/kern/priority_inheritance1: Makefile test_priority_inheritance1.c src/regress/sys/kern/rwlock1: Makefile test_rwlock1.c Log Message: Drop broken tests (no longer builds in years) Removed: - callout1 - mutex1 - mutex2 - priority_inheritance1 - rwlock1 These tests used to require lkm code, that has been removed. Today they are implicitly mostly verified by rumpkernel tests in ATF. To generate a diff of this commit: cvs rdiff -u -r1.1 -r0 src/regress/sys/kern/callout1/Makefile cvs rdiff -u -r1.3 -r0 src/regress/sys/kern/callout1/test_callout1.c cvs rdiff -u -r1.3 -r0 src/regress/sys/kern/mutex1/Makefile cvs rdiff -u -r1.5 -r0 src/regress/sys/kern/mutex1/test_mutex1.c cvs rdiff -u -r1.2 -r0 src/regress/sys/kern/mutex2/Makefile cvs rdiff -u -r1.5 -r0 src/regress/sys/kern/mutex2/test_mutex2.c cvs rdiff -u -r1.1 -r0 src/regress/sys/kern/priority_inheritance1/Makefile cvs rdiff -u -r1.2 -r0 \ src/regress/sys/kern/priority_inheritance1/test_priority_inheritance1.c cvs rdiff -u -r1.2 -r0 src/regress/sys/kern/rwlock1/Makefile cvs rdiff -u -r1.6 -r0 src/regress/sys/kern/rwlock1/test_rwlock1.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/regress/sys
Module Name:src Committed By: kamil Date: Sun May 14 03:50:43 UTC 2017 Modified Files: src/regress/sys: Makefile Removed Files: src/regress/sys/net: Makefile src/regress/sys/net/bpf: Makefile src/regress/sys/net/bpf/interface: Makefile interface.c src/regress/sys/net/bpf/out-of-bounds: Makefile out-of-bounds.sh Log Message: Remove bpf regress tests, obsoleted by ATF net/bpf and rump To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/regress/sys/Makefile cvs rdiff -u -r1.3 -r0 src/regress/sys/net/Makefile cvs rdiff -u -r1.3 -r0 src/regress/sys/net/bpf/Makefile cvs rdiff -u -r1.1 -r0 src/regress/sys/net/bpf/interface/Makefile cvs rdiff -u -r1.2 -r0 src/regress/sys/net/bpf/interface/interface.c cvs rdiff -u -r1.1 -r0 src/regress/sys/net/bpf/out-of-bounds/Makefile \ src/regress/sys/net/bpf/out-of-bounds/out-of-bounds.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/sys/Makefile diff -u src/regress/sys/Makefile:1.13 src/regress/sys/Makefile:1.14 --- src/regress/sys/Makefile:1.13 Sun May 14 03:42:42 2017 +++ src/regress/sys/Makefile Sun May 14 03:50:42 2017 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.13 2017/05/14 03:42:42 kamil Exp $ +# $NetBSD: Makefile,v 1.14 2017/05/14 03:50:42 kamil Exp $ .include -SUBDIR= kern fs uvm net +SUBDIR= kern fs uvm .if exists(arch/${MACHINE}/Makefile) SUBDIR+= arch/${MACHINE} .endif
CVS commit: src/regress/sys
Module Name:src Committed By: kamil Date: Sun May 14 03:42:42 UTC 2017 Modified Files: src/regress/sys: Makefile Removed Files: src/regress/sys/crypto: Makefile Makefile.inc src/regress/sys/crypto/blowfish: Makefile bftest.c src/regress/sys/crypto/blowfish_asm: Makefile src/regress/sys/crypto/cast128: Makefile casttest.c src/regress/sys/crypto/des_asm: Makefile src/regress/sys/crypto/rijndael: Makefile rijndaeltest.c Log Message: Remove regress sys/crypto tests, obsoleted by ATF ones These algorithms are used in ATF tests/net/ipsec Today it's better to use rumpkernel to verify this code instead of reinventing testsuites linking with selected kernel private source files. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/regress/sys/Makefile cvs rdiff -u -r1.4 -r0 src/regress/sys/crypto/Makefile cvs rdiff -u -r1.8 -r0 src/regress/sys/crypto/Makefile.inc cvs rdiff -u -r1.5 -r0 src/regress/sys/crypto/blowfish/Makefile cvs rdiff -u -r1.6 -r0 src/regress/sys/crypto/blowfish/bftest.c cvs rdiff -u -r1.3 -r0 src/regress/sys/crypto/blowfish_asm/Makefile cvs rdiff -u -r1.5 -r0 src/regress/sys/crypto/cast128/Makefile cvs rdiff -u -r1.6 -r0 src/regress/sys/crypto/cast128/casttest.c cvs rdiff -u -r1.4 -r0 src/regress/sys/crypto/des_asm/Makefile cvs rdiff -u -r1.6 -r0 src/regress/sys/crypto/rijndael/Makefile cvs rdiff -u -r1.8 -r0 src/regress/sys/crypto/rijndael/rijndaeltest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/sys/Makefile diff -u src/regress/sys/Makefile:1.12 src/regress/sys/Makefile:1.13 --- src/regress/sys/Makefile:1.12 Wed Dec 14 23:56:45 2005 +++ src/regress/sys/Makefile Sun May 14 03:42:42 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2005/12/14 23:56:45 rpaulo Exp $ +# $NetBSD: Makefile,v 1.13 2017/05/14 03:42:42 kamil Exp $ .include @@ -9,9 +9,6 @@ SUBDIR+= arch/${MACHINE} .if exists(arch/${MACHINE_ARCH}/Makefile) SUBDIR+= arch/${MACHINE_ARCH} .endif -.if ${MKCRYPTO} != "no" -SUBDIR+= crypto -.endif SUBDIR := ${SUBDIR:O:u}
CVS commit: src/regress/sys/crypto
Module Name:src Committed By: kamil Date: Sun May 14 03:36:36 UTC 2017 Modified Files: src/regress/sys/crypto: Makefile Removed Files: src/regress/sys/crypto/des: Makefile destest.c Log Message: Drop regress test for des, obsoleted by ATF tests/lib/libdes/t_des To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/regress/sys/crypto/Makefile cvs rdiff -u -r1.6 -r0 src/regress/sys/crypto/des/Makefile cvs rdiff -u -r1.3 -r0 src/regress/sys/crypto/des/destest.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/sys/crypto/Makefile diff -u src/regress/sys/crypto/Makefile:1.3 src/regress/sys/crypto/Makefile:1.4 --- src/regress/sys/crypto/Makefile:1.3 Wed Feb 27 02:21:08 2002 +++ src/regress/sys/crypto/Makefile Sun May 14 03:36:36 2017 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2002/02/27 02:21:08 itojun Exp $ +# $NetBSD: Makefile,v 1.4 2017/05/14 03:36:36 kamil Exp $ # $KAME: Makefile,v 1.4 2000/11/01 14:55:39 itojun Exp $ -SUBDIR= des blowfish cast128 rijndael +SUBDIR= blowfish cast128 rijndael .if ${MACHINE_ARCH} == "i386" SUBDIR+= des_asm blowfish_asm .endif
CVS commit: src/regress
Module Name:src Committed By: kamil Date: Sun May 14 02:30:27 UTC 2017 Modified Files: src/regress: Makefile Removed Files: src/regress/usr.bin: Makefile src/regress/usr.bin/rtld: Makefile src/regress/usr.bin/rtld/testlib: Makefile ccexc.cc construct.cc virt.cc Log Message: Drop usr.bin/rtld/testlib, replaced with ATF tests in usr.bin/c++/* This regress tests used to check dynamically loaded objects: constructor/destructor call for static objects, C++ runtime support. This is mostly - although without virtual functions, inheritance - covered by existing ATF tests. Stop descending into regress/usr.bin. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/regress/Makefile cvs rdiff -u -r1.20 -r0 src/regress/usr.bin/Makefile cvs rdiff -u -r1.4 -r0 src/regress/usr.bin/rtld/Makefile cvs rdiff -u -r1.10 -r0 src/regress/usr.bin/rtld/testlib/Makefile cvs rdiff -u -r1.1 -r0 src/regress/usr.bin/rtld/testlib/ccexc.cc \ src/regress/usr.bin/rtld/testlib/virt.cc cvs rdiff -u -r1.2 -r0 src/regress/usr.bin/rtld/testlib/construct.cc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/Makefile diff -u src/regress/Makefile:1.19 src/regress/Makefile:1.20 --- src/regress/Makefile:1.19 Sun Jul 18 12:44:38 2010 +++ src/regress/Makefile Sun May 14 02:30:27 2017 @@ -1,6 +1,5 @@ -# $NetBSD: Makefile,v 1.19 2010/07/18 12:44:38 jmmv Exp $ +# $NetBSD: Makefile,v 1.20 2017/05/14 02:30:27 kamil Exp $ -# missing: libexec sbin usr.sbin share -SUBDIR+= lib libexec sys usr.bin +SUBDIR+= lib libexec sys .include
CVS commit: src/regress/usr.bin
Module Name:src Committed By: kamil Date: Sun May 14 02:07:59 UTC 2017 Modified Files: src/regress/usr.bin: Makefile Removed Files: src/regress/usr.bin/c++: Makefile src/regress/usr.bin/c++/static_destructor: Makefile expected static_destructor.cc Log Message: Eliminate regress/usr.bin/c++/static_destructor - obsoleted with ATF tests Replaced and enhanced with tests/usr.bin/c++/t_static_destructor. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/regress/usr.bin/Makefile cvs rdiff -u -r1.1 -r0 src/regress/usr.bin/c++/Makefile cvs rdiff -u -r1.1 -r0 src/regress/usr.bin/c++/static_destructor/Makefile \ src/regress/usr.bin/c++/static_destructor/expected \ src/regress/usr.bin/c++/static_destructor/static_destructor.cc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/regress/usr.bin/Makefile diff -u src/regress/usr.bin/Makefile:1.19 src/regress/usr.bin/Makefile:1.20 --- src/regress/usr.bin/Makefile:1.19 Sun Aug 1 16:44:31 2010 +++ src/regress/usr.bin/Makefile Sun May 14 02:07:58 2017 @@ -1,11 +1,7 @@ -# $NetBSD: Makefile,v 1.19 2010/08/01 16:44:31 jmmv Exp $ +# $NetBSD: Makefile,v 1.20 2017/05/14 02:07:58 kamil Exp $ .include -.if ${MKCXX} != "no" -SUBDIR+= c++ -.endif - SUBDIR+= rtld .include
CVS commit: src
Module Name:src Committed By: kamil Date: Sun May 14 02:02:25 UTC 2017 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/c++: Makefile Added Files: src/tests/usr.bin/c++: t_static_destructor.sh Log Message: Add new ATF C++ tests in usr.bin/c++: t_static_destructor These tests are cloned from t_cxxruntime and check proper order of destructor calls. They must be reported in reverse order of constructor completion. Added tests: - static_destructor - static_destructor_pic - static_destructor_pie - static_destructor32 This test file replaces src/regress/usr.bin/c++/static_destructor. To generate a diff of this commit: cvs rdiff -u -r1.740 -r1.741 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/t_static_destructor.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.740 src/distrib/sets/lists/tests/mi:1.741 --- src/distrib/sets/lists/tests/mi:1.740 Sun May 14 01:03:21 2017 +++ src/distrib/sets/lists/tests/mi Sun May 14 02:02:25 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.740 2017/05/14 01:03:21 kamil Exp $ +# $NetBSD: mi,v 1.741 2017/05/14 02:02:25 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3589,6 +3589,7 @@ ./usr/tests/usr.bin/c++/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua,cxx ./usr/tests/usr.bin/c++/t_cxxruntime tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/c++/t_hello tests-usr.bin-tests compattestfile,atf,cxx +./usr/tests/usr.bin/c++/t_static_destructor tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/cctests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/cc/Atffile tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/cc/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua Index: src/tests/usr.bin/c++/Makefile diff -u src/tests/usr.bin/c++/Makefile:1.2 src/tests/usr.bin/c++/Makefile:1.3 --- src/tests/usr.bin/c++/Makefile:1.2 Sun May 14 01:03:21 2017 +++ src/tests/usr.bin/c++/Makefile Sun May 14 02:02:25 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2017/05/14 01:03:21 kamil Exp $ +# $NetBSD: Makefile,v 1.3 2017/05/14 02:02:25 kamil Exp $ .include @@ -6,5 +6,6 @@ TESTSDIR= ${TESTSBASE}/usr.bin/c++ TESTS_SH= t_cxxruntime TESTS_SH+= t_hello +TESTS_SH+= t_static_destructor .include Added files: Index: src/tests/usr.bin/c++/t_static_destructor.sh diff -u /dev/null src/tests/usr.bin/c++/t_static_destructor.sh:1.1 --- /dev/null Sun May 14 02:02:25 2017 +++ src/tests/usr.bin/c++/t_static_destructor.sh Sun May 14 02:02:25 2017 @@ -0,0 +1,194 @@ +# $NetBSD: t_static_destructor.sh,v 1.1 2017/05/14 02:02:25 kamil Exp $ +# +# Copyright (c) 2017 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Kamil Rytarowski. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +atf_test_case static_destructor +static_destructor_head() { + atf_set "descr" "compile and run \"hello world\"" + atf_set "require.progs" "c++" +} + +atf_test_case static_destructor_pic +static_destructor_pic_head() { + atf_set "descr" "compile and run PIC \"hello world\"" + atf_set "require.progs" "c++" +} + +atf_test_case static_destructor_pie +static_destructor_pie_head() { + atf_set "descr" "compile and run position independent (PIE) \"hello world\"&qu
CVS commit: src/tests/usr.bin/c++
Module Name:src Committed By: kamil Date: Sun May 14 01:13:44 UTC 2017 Modified Files: src/tests/usr.bin/c++: t_cxxruntime.sh Log Message: Use more C++ sugar in t_cxxruntime (ATF test) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/t_cxxruntime.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/c++/t_cxxruntime.sh diff -u src/tests/usr.bin/c++/t_cxxruntime.sh:1.1 src/tests/usr.bin/c++/t_cxxruntime.sh:1.2 --- src/tests/usr.bin/c++/t_cxxruntime.sh:1.1 Sun May 14 01:03:21 2017 +++ src/tests/usr.bin/c++/t_cxxruntime.sh Sun May 14 01:13:44 2017 @@ -1,4 +1,4 @@ -# $NetBSD: t_cxxruntime.sh,v 1.1 2017/05/14 01:03:21 kamil Exp $ +# $NetBSD: t_cxxruntime.sh,v 1.2 2017/05/14 01:13:44 kamil Exp $ # # Copyright (c) 2017 The NetBSD Foundation, Inc. # All rights reserved. @@ -110,9 +110,9 @@ cxxruntime32_body() { fi cat > test.cpp << EOF -#include -#include -int main(void) {printf("hello world\n");exit(0);} +#include +#include +int main(void) {std::cout << "hello world" << std::endl;exit(0);} EOF atf_check -s exit:0 -o ignore -e ignore c++ -o hello32 -m32 test.cpp atf_check -s exit:0 -o ignore -e ignore c++ -o hello64 test.cpp @@ -129,8 +129,8 @@ EOF # do another test with static 32bit binaries cat > test.cpp << EOF -#include #include +#include int main(void) {std::cout << "hello static world" << std::endl;exit(0);} EOF atf_check -s exit:0 -o ignore -e ignore c++ -o hello -m32 \
CVS commit: src
Module Name:src Committed By: kamil Date: Sun May 14 01:03:21 UTC 2017 Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/c++: Makefile Added Files: src/tests/usr.bin/c++: t_cxxruntime.sh Log Message: Add new ATF C++ tests in usr.bin/c++ These tests are cloned from t_hello and use c++ runtime basic functions. Added tests: - hello - hello_pic - hello_pie - hello32 To generate a diff of this commit: cvs rdiff -u -r1.739 -r1.740 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/t_cxxruntime.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.739 src/distrib/sets/lists/tests/mi:1.740 --- src/distrib/sets/lists/tests/mi:1.739 Sun May 14 00:07:07 2017 +++ src/distrib/sets/lists/tests/mi Sun May 14 01:03:21 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.739 2017/05/14 00:07:07 kamil Exp $ +# $NetBSD: mi,v 1.740 2017/05/14 01:03:21 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3587,6 +3587,7 @@ ./usr/tests/usr.bin/c++tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/c++/Atffile tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/c++/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua,cxx +./usr/tests/usr.bin/c++/t_cxxruntime tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/c++/t_hello tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/cctests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/cc/Atffile tests-usr.bin-tests compattestfile,atf Index: src/tests/usr.bin/c++/Makefile diff -u src/tests/usr.bin/c++/Makefile:1.1 src/tests/usr.bin/c++/Makefile:1.2 --- src/tests/usr.bin/c++/Makefile:1.1 Sun May 14 00:07:07 2017 +++ src/tests/usr.bin/c++/Makefile Sun May 14 01:03:21 2017 @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.1 2017/05/14 00:07:07 kamil Exp $ +# $NetBSD: Makefile,v 1.2 2017/05/14 01:03:21 kamil Exp $ .include TESTSDIR= ${TESTSBASE}/usr.bin/c++ -TESTS_SH= t_hello +TESTS_SH= t_cxxruntime +TESTS_SH+= t_hello .include Added files: Index: src/tests/usr.bin/c++/t_cxxruntime.sh diff -u /dev/null src/tests/usr.bin/c++/t_cxxruntime.sh:1.1 --- /dev/null Sun May 14 01:03:21 2017 +++ src/tests/usr.bin/c++/t_cxxruntime.sh Sun May 14 01:03:21 2017 @@ -0,0 +1,148 @@ +# $NetBSD: t_cxxruntime.sh,v 1.1 2017/05/14 01:03:21 kamil Exp $ +# +# Copyright (c) 2017 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Kamil Rytarowski. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +atf_test_case cxxruntime +cxxruntime_head() { + atf_set "descr" "compile and run \"hello world\"" + atf_set "require.progs" "c++" +} + +atf_test_case cxxruntime_pic +cxxruntime_pic_head() { + atf_set "descr" "compile and run PIC \"hello world\"" + atf_set "require.progs" "c++" +} + +atf_test_case cxxruntime_pie +cxxruntime_pie_head() { + atf_set "descr" "compile and run position independent (PIE) \"hello world\"" + atf_set "require.progs" "c++" +} + +atf_test_case cxxruntime32 +cxxruntime32_head() { + atf_set "descr" "compile and run \"hello world\" for/in netbsd32 emulation" + atf_set "require.progs" "c++ file diff cat" +} + +cxxruntime_body() { + cat > test.cpp <<
CVS commit: src
Module Name:src Committed By: kamil Date: Sun May 14 00:07:07 UTC 2017 Modified Files: src/distrib/sets/lists/tests: mi src/etc/mtree: NetBSD.dist.tests src/tests/usr.bin: Makefile Added Files: src/tests/usr.bin/c++: Makefile t_hello.sh Log Message: Add new c++ ATF tests in usr.bin/c++: t_hello This is a copy of t_hello from usr.bin/cc. Added tests: - hello - hello_pic - hello_pie - hello32 These tests do not use c++ runtime library functions. Protect these tests with MKCXX. To generate a diff of this commit: cvs rdiff -u -r1.738 -r1.739 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.145 -r1.146 src/etc/mtree/NetBSD.dist.tests cvs rdiff -u -r1.24 -r1.25 src/tests/usr.bin/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/Makefile \ src/tests/usr.bin/c++/t_hello.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.738 src/distrib/sets/lists/tests/mi:1.739 --- src/distrib/sets/lists/tests/mi:1.738 Wed May 10 09:08:25 2017 +++ src/distrib/sets/lists/tests/mi Sun May 14 00:07:07 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.738 2017/05/10 09:08:25 ozaki-r Exp $ +# $NetBSD: mi,v 1.739 2017/05/14 00:07:07 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -3584,6 +3584,10 @@ ./usr/tests/usr.bin/bzip2/d_sample3.bz2 tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/bzip2/d_sample3.ref tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/bzip2/t_bzip2 tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/c++tests-usr.bin-tests compattestfile,atf,cxx +./usr/tests/usr.bin/c++/Atffile tests-usr.bin-tests compattestfile,atf,cxx +./usr/tests/usr.bin/c++/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua,cxx +./usr/tests/usr.bin/c++/t_hello tests-usr.bin-tests compattestfile,atf,cxx ./usr/tests/usr.bin/cctests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/cc/Atffile tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/cc/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua Index: src/etc/mtree/NetBSD.dist.tests diff -u src/etc/mtree/NetBSD.dist.tests:1.145 src/etc/mtree/NetBSD.dist.tests:1.146 --- src/etc/mtree/NetBSD.dist.tests:1.145 Fri Apr 14 02:56:48 2017 +++ src/etc/mtree/NetBSD.dist.tests Sun May 14 00:07:07 2017 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.145 2017/04/14 02:56:48 ozaki-r Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.146 2017/05/14 00:07:07 kamil Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -376,6 +376,7 @@ ./usr/tests/usr.bin/awk ./usr/tests/usr.bin/basename ./usr/tests/usr.bin/bzip2 +./usr/tests/usr.bin/c++ ./usr/tests/usr.bin/cc ./usr/tests/usr.bin/cmp ./usr/tests/usr.bin/config Index: src/tests/usr.bin/Makefile diff -u src/tests/usr.bin/Makefile:1.24 src/tests/usr.bin/Makefile:1.25 --- src/tests/usr.bin/Makefile:1.24 Tue Feb 21 10:40:30 2017 +++ src/tests/usr.bin/Makefile Sun May 14 00:07:07 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.24 2017/02/21 10:40:30 kre Exp $ +# $NetBSD: Makefile,v 1.25 2017/05/14 00:07:07 kamil Exp $ # .include @@ -11,4 +11,8 @@ TESTS_SUBDIRS= awk basename bzip2 cc cmp pkill pr rump_server shmif_dumpbus sdiff \ sed sort tmux tr unifdef uniq vmstat xlint +.if ${MKCXX} != "no" +TESTS_SUBDIRS+= c++ +.endif + .include Added files: Index: src/tests/usr.bin/c++/Makefile diff -u /dev/null src/tests/usr.bin/c++/Makefile:1.1 --- /dev/null Sun May 14 00:07:07 2017 +++ src/tests/usr.bin/c++/Makefile Sun May 14 00:07:07 2017 @@ -0,0 +1,9 @@ +# $NetBSD: Makefile,v 1.1 2017/05/14 00:07:07 kamil Exp $ + +.include + +TESTSDIR= ${TESTSBASE}/usr.bin/c++ + +TESTS_SH= t_hello + +.include Index: src/tests/usr.bin/c++/t_hello.sh diff -u /dev/null src/tests/usr.bin/c++/t_hello.sh:1.1 --- /dev/null Sun May 14 00:07:07 2017 +++ src/tests/usr.bin/c++/t_hello.sh Sun May 14 00:07:07 2017 @@ -0,0 +1,145 @@ +# $NetBSD: t_hello.sh,v 1.1 2017/05/14 00:07:07 kamil Exp $ +# +# Copyright (c) 2011 The NetBSD Foundation, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO
CVS commit: src/tests/usr.bin/cc
Module Name:src Committed By: kamil Date: Sat May 13 23:51:39 UTC 2017 Modified Files: src/tests/usr.bin/cc: t_hello.sh Log Message: Correct hellp_pic ATF test in usr.bin/cc Drop "-dPIC", this is misspelled "-DPIC" option for libtool. Enhance code example to be more pedantic. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/cc/t_hello.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/cc/t_hello.sh diff -u src/tests/usr.bin/cc/t_hello.sh:1.3 src/tests/usr.bin/cc/t_hello.sh:1.4 --- src/tests/usr.bin/cc/t_hello.sh:1.3 Sun Apr 3 14:41:30 2016 +++ src/tests/usr.bin/cc/t_hello.sh Sat May 13 23:51:39 2017 @@ -1,4 +1,4 @@ -# $NetBSD: t_hello.sh,v 1.3 2016/04/03 14:41:30 gson Exp $ +# $NetBSD: t_hello.sh,v 1.4 2017/05/13 23:51:39 kamil Exp $ # # Copyright (c) 2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -62,15 +62,16 @@ EOF hello_pic_body() { cat > test.c << EOF #include +int callpic(void); int main(void) {callpic();exit(0);} EOF cat > pic.c << EOF #include -int callpic(void) {printf("hello world\n");} +int callpic(void) {printf("hello world\n");return 0;} EOF atf_check -s exit:0 -o ignore -e ignore \ - cc -fPIC -dPIC -shared -o libtest.so pic.c + cc -fPIC -shared -o libtest.so pic.c atf_check -s exit:0 -o ignore -e ignore \ cc -o hello test.c -L. -ltest
CVS commit: src/share/misc
Module Name:src Committed By: kamil Date: Fri May 12 21:14:47 UTC 2017 Modified Files: src/share/misc: acronyms.comp Log Message: Fix typo in "Interrupt" Noted by To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.182 src/share/misc/acronyms.comp:1.183 --- src/share/misc/acronyms.comp:1.182 Thu May 11 22:19:29 2017 +++ src/share/misc/acronyms.comp Fri May 12 21:14:47 2017 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.182 2017/05/11 22:19:29 kamil Exp $ +$NetBSD: acronyms.comp,v 1.183 2017/05/12 21:14:47 kamil Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -962,7 +962,7 @@ PIC programmable interrupt controller PICNIC problem in chair, not in computer PID process id PIE position independent executable -PIL Priority Interrut Level +PIL Priority Interrupt Level PIM personal information manager PIM platform-independent model PIO programmed input/output
CVS commit: src/share/misc
Module Name:src Committed By: kamil Date: Thu May 11 22:19:29 UTC 2017 Modified Files: src/share/misc: acronyms.comp Log Message: Document SPL in wtf(6) SPLsystem interrupt priority level SPLspinlock The former is documented in spl(9) in the NetBSD context. The latter is used in some spinlock implementations. To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.181 src/share/misc/acronyms.comp:1.182 --- src/share/misc/acronyms.comp:1.181 Thu May 11 21:59:28 2017 +++ src/share/misc/acronyms.comp Thu May 11 22:19:29 2017 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.181 2017/05/11 21:59:28 kamil Exp $ +$NetBSD: acronyms.comp,v 1.182 2017/05/11 22:19:29 kamil Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -1219,6 +1219,8 @@ SPD serial presence detect SPDIF Sony/Philips digital interface format SPI serial peripheral interface SPI stateful packet inspection +SPL system interrupt priority level +SPL spinlock SPMD single process, multiple data SPR special purpose register SPT sectors per track
CVS commit: src/share/misc
Module Name:src Committed By: kamil Date: Thu May 11 21:59:28 UTC 2017 Modified Files: src/share/misc: acronyms.comp Log Message: Add new entries for wtf(6) CCNUMA cache-coherent non-uniform memory access PILPriority Interrut Level RMORelaxed Memory Ordering TSOTotal Store Ordering To generate a diff of this commit: cvs rdiff -u -r1.180 -r1.181 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.180 src/share/misc/acronyms.comp:1.181 --- src/share/misc/acronyms.comp:1.180 Fri May 5 14:23:47 2017 +++ src/share/misc/acronyms.comp Thu May 11 21:59:28 2017 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.180 2017/05/05 14:23:47 ginsbach Exp $ +$NetBSD: acronyms.comp,v 1.181 2017/05/11 21:59:28 kamil Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -178,6 +178,7 @@ CBR constant bit rate CC carbon coby CCD charge coupled device CCI co-channel interferer +CCNUMA cache-coherent non-uniform memory access CD cache disable CD compact disc CDDA compact disc digital audio @@ -961,6 +962,7 @@ PIC programmable interrupt controller PICNIC problem in chair, not in computer PID process id PIE position independent executable +PIL Priority Interrut Level PIM personal information manager PIM platform-independent model PIO programmed input/output @@ -1081,6 +1083,7 @@ RLL run length limited RLO right-to-left override RM read miss RMI remote method invocation +RMO Relaxed Memory Ordering RMPM rapid memory power management RMS root mean square RMW read, modify, write @@ -1311,6 +1314,7 @@ TSC time stamp counter TSD time stamp disable TSL test, set, lock TSO time sharing option +TSO Total Store Ordering TSP Time-Stamp Protocol TSP Tunnel Setup Protocol TSP time synchronization protocol
CVS commit: src/sbin/mount_portal
Module Name:src Committed By: kamil Date: Tue May 9 23:26:49 UTC 2017 Modified Files: src/sbin/mount_portal: Makefile pt_conf.c src/sbin/mount_portal/examples: advanced.1 advanced.1.conf cvs.1 cvs.conf cvs.sh.sh fing.c fs.1 fs.1.conf rfilter.1 rfilter.2 rfilter.2.conf tcp.1 tcp.1.conf Removed Files: src/sbin/mount_portal: pt_exec.c Log Message: Minor and non-functional enhancements in mount_portal(8) Since day0 pt_exec.c shipped with a dummy stub for "exec" operation, stop waiting longer and eliminate it now. This functionality can be achieved with filters. Drop FreeBSD CVS repos references. There are certainly still some mirrors or old mirrors available, but since the project moved to SVN+GIT entirely drop it. Add CVS Id - where missing - to the documentation files. This helps users to determine how recent are the files. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/mount_portal/Makefile cvs rdiff -u -r1.7 -r1.8 src/sbin/mount_portal/pt_conf.c cvs rdiff -u -r1.9 -r0 src/sbin/mount_portal/pt_exec.c cvs rdiff -u -r1.5 -r1.6 src/sbin/mount_portal/examples/advanced.1 cvs rdiff -u -r1.2 -r1.3 src/sbin/mount_portal/examples/advanced.1.conf \ src/sbin/mount_portal/examples/cvs.conf \ src/sbin/mount_portal/examples/fing.c \ src/sbin/mount_portal/examples/rfilter.2 \ src/sbin/mount_portal/examples/tcp.1 cvs rdiff -u -r1.6 -r1.7 src/sbin/mount_portal/examples/cvs.1 cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_portal/examples/cvs.sh.sh cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_portal/examples/fs.1 \ src/sbin/mount_portal/examples/fs.1.conf \ src/sbin/mount_portal/examples/rfilter.1 \ src/sbin/mount_portal/examples/rfilter.2.conf \ src/sbin/mount_portal/examples/tcp.1.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_portal/Makefile diff -u src/sbin/mount_portal/Makefile:1.26 src/sbin/mount_portal/Makefile:1.27 --- src/sbin/mount_portal/Makefile:1.26 Sat Jan 23 21:22:47 2016 +++ src/sbin/mount_portal/Makefile Tue May 9 23:26:49 2017 @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.26 2016/01/23 21:22:47 christos Exp $ +# $NetBSD: Makefile,v 1.27 2017/05/09 23:26:49 kamil Exp $ # @(#)Makefile 8.3 (Berkeley) 3/27/94 .include PROG= mount_portal SRCS= puffs_portal.c activate.c conf.c pt_conf.c \ - pt_exec.c pt_file.c pt_tcp.c pt_filter.c + pt_file.c pt_tcp.c pt_filter.c SUBDIR= examples MAN= mount_portal.8 Index: src/sbin/mount_portal/pt_conf.c diff -u src/sbin/mount_portal/pt_conf.c:1.7 src/sbin/mount_portal/pt_conf.c:1.8 --- src/sbin/mount_portal/pt_conf.c:1.7 Thu Aug 7 10:04:30 2003 +++ src/sbin/mount_portal/pt_conf.c Tue May 9 23:26:49 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pt_conf.c,v 1.7 2003/08/07 10:04:30 agc Exp $ */ +/* $NetBSD: pt_conf.c,v 1.8 2017/05/09 23:26:49 kamil Exp $ */ /* * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: pt_conf.c,v 1.7 2003/08/07 10:04:30 agc Exp $"); +__RCSID("$NetBSD: pt_conf.c,v 1.8 2017/05/09 23:26:49 kamil Exp $"); #endif /* not lint */ #include @@ -45,7 +45,6 @@ __RCSID("$NetBSD: pt_conf.c,v 1.7 2003/0 #include "portald.h" provider providers[] = { - { "exec", portal_exec }, { "file", portal_file }, { "tcp", portal_tcp }, { "rfilter", portal_rfilter }, Index: src/sbin/mount_portal/examples/advanced.1 diff -u src/sbin/mount_portal/examples/advanced.1:1.5 src/sbin/mount_portal/examples/advanced.1:1.6 --- src/sbin/mount_portal/examples/advanced.1:1.5 Sat Jul 26 19:46:32 2003 +++ src/sbin/mount_portal/examples/advanced.1 Tue May 9 23:26:49 2017 @@ -1,3 +1,5 @@ +$NetBSD: advanced.1,v 1.6 2017/05/09 23:26:49 kamil Exp $ + Using the file advanced.1.conf, we might obtain the following results: % mkdir /p @@ -107,4 +109,3 @@ mcllowat = 8 % cat /p/sysctl/kern/mbuf/msize 128 - Index: src/sbin/mount_portal/examples/advanced.1.conf diff -u src/sbin/mount_portal/examples/advanced.1.conf:1.2 src/sbin/mount_portal/examples/advanced.1.conf:1.3 --- src/sbin/mount_portal/examples/advanced.1.conf:1.2 Mon Jan 17 07:22:45 2000 +++ src/sbin/mount_portal/examples/advanced.1.conf Tue May 9 23:26:49 2017 @@ -1,3 +1,5 @@ +# $NetBSD: advanced.1.conf,v 1.3 2017/05/09 23:26:49 kamil Exp $ +# # This file contains an example of just about every feature. # The file "advanced.1" provides a walk-through tutorial using # this configuration. Index: src/sbin/mount_portal/examples/cvs.conf diff -u src/sbin/mount_portal/examples/cvs.conf:1.2 src/sbin/mount_portal/examples/cvs.conf:1.3 --- src/sbin/mount_portal/examples/cvs.conf:1.2 Mon Oct 15 17:34:50 2001 +++ src/sbin/mount_portal/examples/cvs.conf Tue May 9 23:26:49 2017 @@ -1,3 +1,4 @@ +# $NetBSD: cvs.conf,v 1.3 2017/05/09 23:26:49 kamil Exp $ + netbsd/ rfilter netbsd/ /usr/share/examples/mount_portal/cvs.sh netbsd %s -freebsd/ rfilter freebsd/
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: kamil Date: Tue May 9 22:43:09 UTC 2017 Modified Files: src/distrib/sets/lists/comp: mi Log Message: Fix distribution build for MKCATPAGES=yes Add: cat3/signalname.0, cat3/signalnext.0, cat3/signalnumber.0 To generate a diff of this commit: cvs rdiff -u -r1.2131 -r1.2132 src/distrib/sets/lists/comp/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2131 src/distrib/sets/lists/comp/mi:1.2132 --- src/distrib/sets/lists/comp/mi:1.2131 Tue May 9 11:14:16 2017 +++ src/distrib/sets/lists/comp/mi Tue May 9 22:43:09 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2131 2017/05/09 11:14:16 kre Exp $ +# $NetBSD: mi,v 1.2132 2017/05/09 22:43:09 kamil Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -9116,6 +9116,9 @@ ./usr/share/man/cat3/signal_initialized.0 comp-obsolete obsolete ./usr/share/man/cat3/signal_pending.0 comp-obsolete obsolete ./usr/share/man/cat3/signal_set.0 comp-obsolete obsolete +./usr/share/man/cat3/signalname.0 comp-c-catman .cat +./usr/share/man/cat3/signalnext.0 comp-c-catman .cat +./usr/share/man/cat3/signalnumber.0 comp-c-catman .cat ./usr/share/man/cat3/signbit.0 comp-c-catman .cat ./usr/share/man/cat3/significand.0 comp-c-catman .cat ./usr/share/man/cat3/significandf.0 comp-c-catman .cat