The original Steve R. Bourne shell from the 7th edition Unix including System III, 4.3BSD-Reno, Ultrix 3.1 and ``home made'' fixes and enhancements : * `--' end of options added (sysIII). `set +x' and such added (sysIII). `/etc/bsh_profile' (sysIII) and `$HOME/.bsh_profile' (unsw) are sourced at login time if they exist. Initially, only the `.profile' located in the current directory was sourced at login time if it exists. They have been `bsh_' prefixed to avoid conflicts w/ the standards `profiles' which can contains unsupported expressions such as shell functions. negation (! or ^) in `[]' added (sysIII). `${x:-x}' and similar expressions added (sysIII). '<<-' (aka strip leading tab in here document) added (sysIII). `#' comments are allowed in shell scripts (sysIII/reno), but not on the command line (reno) ! `break N' and `continue N' fixed (sysIII/ultrix). `if... then... [elif... [else...]] fi' fixed (reno). `test' (sysIII) and `ulimit' (ultrix) builtins added. * ANSI-fication to permit an almost warning free compilation (home made). `union trenod' taken from 4.3BSD-Reno. better signal handling and error recovery (sysIII/reno). better restricted shell (sysIII) and IFS protection (reno). * functions aren't supported and command line input is not 8 bit clean. How-To-Repeat: n/a
State Changed From-To: open->feedback Does not build on 4-STABLE, there is no ulimit.h: ===> Building for v7sh-1.0 Warning: Object directory not changed from original /tmp/a/ports/shells/v7sh/work cc -O -pipe -DSYSIII -DRENO -DULTRIX -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -ansi -Wbad-function-cast -c args.c In file included from args.c:10: defs.h:22: ulimit.h: No such file or directory *** Error code 1 Stop in /tmp/a/ports/shells/v7sh/work. *** Error code 1 Stop in /a/ports/shells/v7sh.
Responsible Changed From-To: freebsd-ports-bugs->pav Handle.
On Jun 21, 2004 10:05:32 pm GMT, Pav Lucistnik wrote: > Synopsis: New port: shells/v7sh (the bourne one) > > State-Changed-From-To: open->feedback > State-Changed-By: pav > State-Changed-When: Mon Jun 21 22:05:00 GMT 2004 > State-Changed-Why: > Does not build on 4-STABLE, there is no ulimit.h: hope this works :) Makefile copy ulimit.[ch] from FILEDIR if OSVERSION < 500005 files/Makefile compile ulimit.o if OSVERSION < 500005 files/defs.h include "ulimit.h" if OSVERSION < 500005 files/ulimit.[ch] from -current --- Makefile.orig Sat Jun 19 23:18:01 2004 +++ Makefile Tue Jun 22 01:59:18 2004 @@ -51,6 +51,9 @@ @${CP} ${FILESDIR}/Makefile ${WRKSRC} @${CP} ${FILESDIR}/test.c ${WRKSRC} # sysIII @${CP} ${FILESDIR}/pathnames.h ${WRKSRC} # 43reno +.if ${OSVERSION} < 500005 + @${CP} ${FILESDIR}/ulimit.[ch] ${WRKSRC} # fbsd52 +.endif post-install: @${ECHO_MSG} "updating /etc/shells" --- files.orig/Makefile Sat Jun 19 23:18:11 2004 +++ files/Makefile Tue Jun 22 02:13:39 2004 @@ -8,6 +8,9 @@ SRCS= args.c blok.c builtin.c cmd.c ctype.c error.c expand.c \ fault.c io.c macro.c main.c msg.c name.c print.c service.c \ setbrk.c stak.c string.c test.c word.c xec.c +.if ${OSVERSION} < 500005 +SRCS+= ulimit.c +.endif #CFLAGS+= -DSYSIII #CFLAGS+= -DRENO diff -uN files.orig/patch-defs.h files/patch-defs.h --- files.orig/patch-defs.h Sat Jun 19 22:16:58 2004 +++ files/patch-defs.h Tue Jun 22 02:03:57 2004 @@ -1,7 +1,7 @@ diff -u -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ defs.h.orig defs.h ---- defs.h.orig Fri Jun 4 02:51:01 2004 -+++ defs.h Sat Jun 19 18:42:22 2004 -@@ -1,8 +1,28 @@ +--- defs.h.orig Tue Jun 22 01:43:19 2004 ++++ defs.h Tue Jun 22 01:55:49 2004 +@@ -1,8 +1,32 @@ # /* * UNIX shell @@ -23,14 +23,18 @@ +#include <stdlib.h> +#include <string.h> +#if defined(ULTRIX) ++#if (__FreeBSD_version - 0) >= 500005 +#include <ulimit.h> ++#else ++#include "ulimit.h" ++#endif +#endif +#include <unistd.h> + /* error exits from various parts of shell */ #define ERROR 1 #define SYNBAD 2 -@@ -51,11 +71,22 @@ +@@ -51,11 +75,22 @@ #define SYSNULL 16 #define SYSREAD 17 #define SYSTST 18 @@ -56,7 +60,7 @@ /*io nodes*/ #define USERIO 10 -@@ -77,35 +108,145 @@ +@@ -77,35 +112,145 @@ /* result type declarations */ @@ -231,7 +235,7 @@ #define attrib(n,f) (n->namflg |= f) #define round(a,b) (((int)((ADR(a)+b)-1))&~((b)-1)) -@@ -115,16 +256,20 @@ +@@ -115,16 +260,20 @@ #define assert(x) ; /* temp files and io */ @@ -260,7 +264,7 @@ /* stack */ #define BLK(x) ((BLKPTR)(x)) -@@ -136,68 +281,77 @@ +@@ -136,68 +285,77 @@ #include "stak.h" /* string constants */ @@ -384,7 +388,7 @@ /* flags */ #define noexec 01 -@@ -211,77 +365,122 @@ +@@ -211,77 +369,122 @@ #define rshflg 0400 #define waiting 01000 #define stdflg 02000 diff -uN files.orig/ulimit.c files/ulimit.c --- files.orig/ulimit.c Thu Jan 1 01:00:00 1970 +++ files/ulimit.c Fri May 30 06:08:22 2003 @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2002 Kyle Martin <mkm@ieee.org> + * 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 AUTHOR 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 AUTHOR 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. + * + * from FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/ulimit.c,v 1.1.2.1 2003/01/08 01:23:00 tjr Exp $ + */ + +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> + +#include <errno.h> +#include <limits.h> +#include <stdarg.h> +#include <ulimit.h> + +long +ulimit(int cmd, ...) +{ + struct rlimit limit; + va_list ap; + long arg; + + if (cmd == UL_GETFSIZE) { + if (getrlimit(RLIMIT_FSIZE, &limit) == -1) + return (-1); + limit.rlim_cur /= 512; + if (limit.rlim_cur > LONG_MAX) + return (LONG_MAX); + return ((long)limit.rlim_cur); + } else if (cmd == UL_SETFSIZE) { + va_start(ap, cmd); + arg = va_arg(ap, long); + va_end(ap); + limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; + + /* The setrlimit() function sets errno to EPERM if needed. */ + if (setrlimit(RLIMIT_FSIZE, &limit) == -1) + return (-1); + if (arg * 512 > LONG_MAX) + return (LONG_MAX); + return (arg); + } else { + errno = EINVAL; + return (-1); + } +} diff -uN files.orig/ulimit.h files/ulimit.h --- files.orig/ulimit.h Thu Jan 1 01:00:00 1970 +++ files/ulimit.h Fri May 30 06:07:45 2003 @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2002 Kyle Martin <mkm@ieee.org> + * 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 AUTHOR 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 AUTHOR 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. + * + * from FreeBSD: /repoman/r/ncvs/src/include/ulimit.h,v 1.1.2.1 2003/01/08 01:23:00 tjr Exp $ + */ + +#ifndef _ULIMIT_H_ +#define _ULIMIT_H_ + +#include <sys/cdefs.h> + +#define UL_GETFSIZE 1 +#define UL_SETFSIZE 2 + +__BEGIN_DECLS +long ulimit(int, ...); +__END_DECLS + +#endif /* !_ULIMIT_H_ */ CC -gnats Cyrille Lefevre -- mailto:cyrille.lefevre@laposte.net
State Changed From-To: feedback->closed New port added, thank you!